aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt23
-rw-r--r--cmake/modules/FindSQLite3.cmake55
-rw-r--r--cmake/modules/PaludisAddTest.cmake2
-rw-r--r--doc/api/cplusplus/examples/example_package_id.cc4
-rw-r--r--doc/api/python/CMakeLists.txt2
-rw-r--r--paludis/CMakeLists.txt12
-rw-r--r--paludis/repositories/e/CMakeLists.txt6
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_config.bash2
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/pkg_postinst.bash2
-rw-r--r--paludis/repositories/e/ebuild/utils/CMakeLists.txt3
-rw-r--r--python/CMakeLists.txt32
-rw-r--r--src/clients/cave/CMakeLists.txt3
12 files changed, 41 insertions, 105 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a4ae883a6..5495b1329 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
# vim: set et fdm=marker fmr={{{,}}} sw=2 sts=2 ts=8:
-cmake_minimum_required(VERSION 3.5.0)
+cmake_minimum_required(VERSION 3.17.0)
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0051 NEW)
cmake_policy(SET CMP0057 NEW)
@@ -50,7 +50,7 @@ endif()
set(PALUDIS_VIM_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/vim/vimfiles" CACHE PATH
"vim installation directory")
-set(PYTHON_SUPPORTED_VERSIONS 2.7 3.6 3.7 3.8 3.9)
+set(PYTHON_SUPPORTED_VERSIONS 2.7 3.6 3.7 3.8 3.9 3.10)
set(PYTHON_VERSION "2.7" CACHE STRING
"Python version (${PYTHON_SUPPORTED_VERSIONS}) (requires corresponding Boost.Python as well)")
@@ -315,20 +315,19 @@ if(ENABLE_PYTHON)
message(SEND_ERROR "Invalid Python version specified (${PYTHON_VERSION})")
endif()
- find_package(PythonInterp ${PYTHON_VERSION})
- if(NOT PYTHONINTERP_FOUND)
+ find_package(Python ${PYTHON_VERSION} EXACT COMPONENTS Interpreter Development)
+
+ if(NOT Python_Interpreter_FOUND)
message(SEND_ERROR "python is required for python support")
endif()
execute_process(COMMAND
- "${PYTHON_EXECUTABLE}" -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1))"
+ "${Python_EXECUTABLE}" -c "from distutils import sysconfig; print(sysconfig.get_python_lib(1))"
OUTPUT_VARIABLE
PALUDIS_PYEXECDIR
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
get_filename_component(PALUDIS_PYEXECDIR ${PALUDIS_PYEXECDIR} REALPATH)
- find_package(PythonLibs ${PYTHON_VERSION})
-
find_package(Boost 1.67.0 REQUIRED
COMPONENTS
python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
@@ -343,6 +342,16 @@ if(ENABLE_PYTHON_DOCS)
endif()
find_package(Sphinx REQUIRED)
+
+ execute_process(COMMAND
+ "${Python_EXECUTABLE}" "${SPHINX_EXECUTABLE}" --help
+ RESULT_VARIABLE
+ exit_code
+ OUTPUT_QUIET
+ ERROR_QUIET)
+ if(NOT ${exit_code} EQUAL 0)
+ message(SEND_ERROR "Sphinx is not compatible with selected Python version")
+ endif()
endif()
if(ENABLE_RUBY)
diff --git a/cmake/modules/FindSQLite3.cmake b/cmake/modules/FindSQLite3.cmake
deleted file mode 100644
index 306fd9f22..000000000
--- a/cmake/modules/FindSQLite3.cmake
+++ /dev/null
@@ -1,55 +0,0 @@
-#.rst:
-# FindSQLite3
-# ------------
-#
-# Find SQLite3 library and headers
-#
-# The module defines the following variables:
-#
-# ::
-#
-# SQLite3_FOUND - true if SQLite3 was found
-# SQLite3_INCLUDE_DIR - include search path
-# SQLite3_LIBRARIES - libraries to link
-# SQLite3_VERSION - libmagic 3-component version number
-
-if(SQLite3_INCLUDE_DIRS AND SQLite3_LIBRARIES)
- set(SQLite3_FOUND TRUE)
-else()
- find_package(PkgConfig QUIET)
- pkg_check_modules(PC_SQLITE3 QUIET sqlite3)
-
- find_path(SQLite3_INCLUDE_DIR
- NAMES
- sqlite3.h
- HINTS
- ${PC_SQLITE3_INCLUDEDIR}
- ${PC_SQLITE3_INCLUDE_DIRS}
- ${CMAKE_INSTALL_FULL_INCLUDEDIR})
- find_library(SQLite3_LIBRARIES
- NAMES
- sqlite3 libsqlite3
- HINTS
- ${PC_SQLITE3_LIBDIR}
- ${PC_SQLITE3_LIBRARY_DIRS}
- ${CMAKE_INSTALL_FULL_LIBDIR})
-
- if(SQLite3_INCLUDE_DIR AND EXISTS "${SQLite3_INCLUDE_DIR}/sqlite3.h")
- file(STRINGS "${SQLite3_INCLUDE_DIR}/sqlite3.h"
- sqlite3_version_str
- REGEX "^#define SQLITE_VERSION[ ]+\".*\"")
- string(REGEX REPLACE "^#define SQLITE_VERSION[ ]+\"([^\"]*)\".*" "\\1"
- SQLite3_VERSION_STRING "${sqlite3_version_str}")
- unset(sqlite3_version_str)
- endif()
-
- include(FindPackageHandleStandardArgs)
- find_package_handle_standard_args(SQLite3
- REQUIRED_VARS
- SQLite3_LIBRARIES
- SQLite3_INCLUDE_DIR
- VERSION_VAR
- SQLite3_VERSION_STRING)
- mark_as_advanced(SQLite3_INCLUDE_DIR SQLite3_LIBRARIES)
-endif()
-
diff --git a/cmake/modules/PaludisAddTest.cmake b/cmake/modules/PaludisAddTest.cmake
index 15463cd4a..858e025cb 100644
--- a/cmake/modules/PaludisAddTest.cmake
+++ b/cmake/modules/PaludisAddTest.cmake
@@ -89,7 +89,7 @@ function(paludis_add_test test_name)
PALUDIS_PYTHON_DIR=${PROJECT_SOURCE_DIR}/python
PALUDIS_SUFFIXES_FILE=${PROJECT_SOURCE_DIR}/paludis/repositories/e/ebuild_entries_suffixes.conf
PALUDIS_TMPDIR=${CMAKE_CURRENT_BINARY_DIR}
- PYTHON=${PYTHON_EXECUTABLE}
+ PYTHON=${Python_EXECUTABLE}
PYTHONPATH=${CMAKE_BINARY_DIR}/python
RUBY=${RUBY_EXECUTABLE}
RUBYLIB=${CMAKE_BINARY_DIR}/ruby
diff --git a/doc/api/cplusplus/examples/example_package_id.cc b/doc/api/cplusplus/examples/example_package_id.cc
index c1cdc8894..8746d78ad 100644
--- a/doc/api/cplusplus/examples/example_package_id.cc
+++ b/doc/api/cplusplus/examples/example_package_id.cc
@@ -107,11 +107,11 @@ int main(int argc, char * argv[])
if ((*i)->supports_action(config_action))
actions.insert("config");
- SupportsActionTest<UninstallAction> fetch_action;
+ SupportsActionTest<FetchAction> fetch_action;
if ((*i)->supports_action(fetch_action))
actions.insert("fetch");
- SupportsActionTest<UninstallAction> info_action;
+ SupportsActionTest<InfoAction> info_action;
if ((*i)->supports_action(info_action))
actions.insert("info");
}
diff --git a/doc/api/python/CMakeLists.txt b/doc/api/python/CMakeLists.txt
index 7652c1c0c..d913240d1 100644
--- a/doc/api/python/CMakeLists.txt
+++ b/doc/api/python/CMakeLists.txt
@@ -18,7 +18,7 @@ if(ENABLE_PYTHON_DOCS)
add_custom_command(COMMAND
env PYTHONPATH="${CMAKE_BINARY_DIR}/python"
- "${PYTHON_EXECUTABLE}" "${SPHINX_EXECUTABLE}"
+ "${Python_EXECUTABLE}" "${SPHINX_EXECUTABLE}"
-c "${CMAKE_CURRENT_BINARY_DIR}"
-b html
-d "${CMAKE_CURRENT_BINARY_DIR}/doctrees"
diff --git a/paludis/CMakeLists.txt b/paludis/CMakeLists.txt
index 8677d526c..eaee6bbae 100644
--- a/paludis/CMakeLists.txt
+++ b/paludis/CMakeLists.txt
@@ -46,7 +46,7 @@ execute_process(COMMAND
BUILDHOST
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND
- date +%&-%m-%dT%H:%M:%S%z
+ date +%Y-%m-%dT%H:%M:%S%z
OUTPUT_VARIABLE
BUILDDATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -223,15 +223,12 @@ if(ENABLE_PYTHON)
target_compile_definitions(libpaludispythonhooks
PRIVATE
-DPYTHONINSTALLDIR="${PALUDIS_PYTHON_INSTALL_DIR}")
- target_include_directories(libpaludispythonhooks
- PRIVATE
- ${PYTHON_INCLUDE_DIRS})
target_link_libraries(libpaludispythonhooks
PRIVATE
libpaludis
libpaludisutil
- Boost::python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}
- ${PYTHON_LIBRARY})
+ Boost::python
+ Python::Python)
endif()
if(ENABLE_PBINS)
@@ -242,7 +239,8 @@ if(ENABLE_PBINS)
PRIVATE
libpaludis
libpaludisutil
- ${LibArchive_LIBRARIES})
+ LibArchive::LibArchive
+ )
endif()
if(ENABLE_STRIPPER)
diff --git a/paludis/repositories/e/CMakeLists.txt b/paludis/repositories/e/CMakeLists.txt
index fb0b19648..4d085452c 100644
--- a/paludis/repositories/e/CMakeLists.txt
+++ b/paludis/repositories/e/CMakeLists.txt
@@ -7,14 +7,12 @@ if(ENABLE_XML)
paludis_add_library(libpaludiserepositoryxmlthings
"${CMAKE_CURRENT_SOURCE_DIR}/xml_things.cc")
- target_include_directories(libpaludiserepositoryxmlthings
- PRIVATE
- ${LIBXML2_INCLUDE_DIR})
target_link_libraries(libpaludiserepositoryxmlthings
PRIVATE
libpaludis
libpaludisutil
- ${LIBXML2_LIBRARIES})
+ LibXml2::LibXml2
+ )
endif()
paludis_add_library(libpaludiserepository
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_config.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_config.bash
index e72a998bc..570de0124 100644
--- a/paludis/repositories/e/ebuild/exheres-0/pkg_config.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_config.bash
@@ -49,7 +49,7 @@ exheres_internal_config()
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
- esandbox check >/dev/null 2>&1 && esandbox allow "${ROOT}"
+ esandbox check >/dev/null 2>&1 && esandbox disallow "${ROOT}"
fi
true
}
diff --git a/paludis/repositories/e/ebuild/exheres-0/pkg_postinst.bash b/paludis/repositories/e/ebuild/exheres-0/pkg_postinst.bash
index be3ea99ae..24bc95c78 100644
--- a/paludis/repositories/e/ebuild/exheres-0/pkg_postinst.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/pkg_postinst.bash
@@ -49,7 +49,7 @@ exheres_internal_postinst()
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]]; then
SANDBOX_WRITE="${old_sandbox_write}"
- esandbox check >/dev/null 2>&1 && esandbox allow "${ROOT}"
+ esandbox check >/dev/null 2>&1 && esandbox disallow "${ROOT}"
fi
true
}
diff --git a/paludis/repositories/e/ebuild/utils/CMakeLists.txt b/paludis/repositories/e/ebuild/utils/CMakeLists.txt
index 6633a3194..bfe61de2a 100644
--- a/paludis/repositories/e/ebuild/utils/CMakeLists.txt
+++ b/paludis/repositories/e/ebuild/utils/CMakeLists.txt
@@ -14,7 +14,8 @@ if(ENABLE_PBINS)
"${CMAKE_CURRENT_SOURCE_DIR}/unpaxinate.cc")
target_link_libraries(unpaxinate
PRIVATE
- ${LibArchive_LIBRARIES})
+ LibArchive::LibArchive
+ )
endif()
add_executable(print_exports
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index 87aeb2920..dd0a48014 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -37,27 +37,19 @@ if(ENABLE_PYTHON)
PRIVATE
-g0)
endif()
- target_include_directories(libpaludispython
- PRIVATE
- ${PYTHON_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS})
target_link_libraries(libpaludispython
PRIVATE
- ${Boost_LIBRARIES}
- ${PYTHON_LIBRARIES}
+ Boost::python
+ Python::Python
libpaludis
libpaludisutil)
paludis_add_library(paludis UNVERSIONED SHARED_LIBRARY
"${CMAKE_CURRENT_SOURCE_DIR}/paludis_python_so.cc")
- target_include_directories(paludis
- PRIVATE
- ${PYTHON_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS})
target_link_libraries(paludis
PRIVATE
- ${Boost_LIBRARIES}
- ${PYTHON_LIBRARIES}
+ Boost::python
+ Python::Python
libpaludispython)
set_target_properties(paludis PROPERTIES
OUTPUT_NAME
@@ -67,28 +59,20 @@ if(ENABLE_PYTHON)
paludis_add_library(libadditionaltests
"${CMAKE_CURRENT_SOURCE_DIR}/additional_tests.cc")
- target_include_directories(libadditionaltests
- PRIVATE
- ${PYTHON_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS})
target_link_libraries(libadditionaltests
PRIVATE
- ${Boost_LIBRARIES}
- ${PYTHON_LIBRARIES}
+ Boost::python
+ Python::Python
libpaludis
libpaludisutil
libpaludispython)
paludis_add_library(additional_tests UNVERSIONED SHARED_LIBRARY
"${CMAKE_CURRENT_SOURCE_DIR}/additional_tests_so.cc")
- target_include_directories(additional_tests
- PRIVATE
- ${PYTHON_INCLUDE_DIRS}
- ${Boost_INCLUDE_DIRS})
target_link_libraries(additional_tests
PRIVATE
- ${Boost_PYTHON_LIBRARY}
- ${PYTHON_LIBRARIES}
+ Boost::python
+ Python::Python
libadditionaltests)
set_target_properties(additional_tests PROPERTIES
OUTPUT_NAME
diff --git a/src/clients/cave/CMakeLists.txt b/src/clients/cave/CMakeLists.txt
index 2dd8cefaa..4eb316126 100644
--- a/src/clients/cave/CMakeLists.txt
+++ b/src/clients/cave/CMakeLists.txt
@@ -103,7 +103,8 @@ if(ENABLE_SEARCH_INDEX)
target_link_libraries(libcavesearchextras
PRIVATE
libpaludisutil
- ${SQLite3_LIBRARIES})
+ SQLite::SQLite3
+ )
endif()
add_executable(cave