Skip to content

Commit

Permalink
Merge pull request #8825 from rouault/backport-8812-to-release/3.8
Browse files Browse the repository at this point in the history
[Backport 3.8]  CI: Linux: test install target, and fix installation of Python bindings on debian:unstable with py3.12
  • Loading branch information
rouault authored Nov 28, 2023
2 parents c98149d + 2daa60c commit 6bb51ba
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/alpine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ cmake ${GDAL_SOURCE_DIR:=..} \
-DIconv_LIBRARY=/usr/lib/libiconv.so \
-DCMAKE_C_FLAGS=-Werror -DCMAKE_CXX_FLAGS=-Werror -DWERROR_DEV_FLAG="-Werror=dev"
make -j$(nproc)
make -j$(nproc) install DESTDIR=/tmp/install-gdal
1 change: 1 addition & 0 deletions .github/workflows/fedora_rawhide/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ cmake ${GDAL_SOURCE_DIR:=..} \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWERROR_DEV_FLAG="-Werror=dev"
make -j$(nproc)
make -j$(nproc) install DESTDIR=/tmp/install-gdal
1 change: 1 addition & 0 deletions .github/workflows/ubuntu_20.04/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ unset CXXFLAGS
unset CFLAGS

make -j$(nproc)
make -j$(nproc) install DESTDIR=/tmp/install-gdal
7 changes: 6 additions & 1 deletion swig/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,12 @@ if (Python_Interpreter_FOUND)
set(SETUPTOOLS_USE_DISTUTILS stdlib)
elseif ("${SITE_PACKAGE_DIR}" MATCHES "dist-packages")
set(INSTALL_ARGS "${INSTALL_ARGS} --install-layout=deb")
set(SETUPTOOLS_USE_DISTUTILS stdlib)
if(Python_VERSION VERSION_LESS 3.12)
# It no longer seems needed to mess with SETUPTOOLS_USE_DISTUTILS
# with Debian Python 3.12 (or maybe its setuptools 68.1.2 version...),
# so only do that with older versions
set(SETUPTOOLS_USE_DISTUTILS stdlib)
endif()
endif ()

if (ONLY_GENERATE_FOR_NON_DEBUG)
Expand Down
7 changes: 5 additions & 2 deletions swig/python/install_python.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@ if(NOT "@SETUPTOOLS_USE_DISTUTILS@x" STREQUAL "x")
endif()
if(DEFINED INSTALL_PREFIX)
execute_process(COMMAND "@Python_EXECUTABLE_CMAKE@" "@SETUP_PY_FILENAME@" install ${ROOT_DIR_ARG} @INSTALL_ARGS@ "${INSTALL_PREFIX}"
WORKING_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@")
WORKING_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@" RESULT_VARIABLE res)
else()
execute_process(COMMAND "@Python_EXECUTABLE_CMAKE@" "@SETUP_PY_FILENAME@" install ${ROOT_DIR_ARG} @INSTALL_ARGS@
WORKING_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@")
WORKING_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@" RESULT_VARIABLE res)
endif()
if(NOT res EQUAL 0)
message( FATAL_ERROR "Installation of python bindings failed")
endif()

0 comments on commit 6bb51ba

Please sign in to comment.