dev-ros/ament_cmake_python: honour DESTDIR when optimizing python
authorAlexis Ballier <aballier@gentoo.org>
Thu, 12 Dec 2019 15:37:26 +0000 (16:37 +0100)
committerAlexis Ballier <aballier@gentoo.org>
Thu, 12 Dec 2019 15:43:53 +0000 (16:43 +0100)
Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Alexis Ballier <aballier@gentoo.org>
dev-ros/ament_cmake_python/ament_cmake_python-0.8.1-r1.ebuild [moved from dev-ros/ament_cmake_python/ament_cmake_python-0.8.1.ebuild with 96% similarity]
dev-ros/ament_cmake_python/ament_cmake_python-9999.ebuild
dev-ros/ament_cmake_python/files/destdir.patch [new file with mode: 0644]

similarity index 96%
rename from dev-ros/ament_cmake_python/ament_cmake_python-0.8.1.ebuild
rename to dev-ros/ament_cmake_python/ament_cmake_python-0.8.1-r1.ebuild
index c60244e59795ccb0025cab7bf25bf7600f70f8e3..43d5e23304577b0836059b77437de7754c2e8c94 100644 (file)
@@ -37,6 +37,7 @@ DEPEND="
 RDEPEND="${DEPEND}"
 BDEPEND="${DEPEND}"
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+PATCHES=( "${FILESDIR}/destdir.patch" )
 
 src_configure() {
        # This is a build tool that does not install python-related files
index c60244e59795ccb0025cab7bf25bf7600f70f8e3..43d5e23304577b0836059b77437de7754c2e8c94 100644 (file)
@@ -37,6 +37,7 @@ DEPEND="
 RDEPEND="${DEPEND}"
 BDEPEND="${DEPEND}"
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+PATCHES=( "${FILESDIR}/destdir.patch" )
 
 src_configure() {
        # This is a build tool that does not install python-related files
diff --git a/dev-ros/ament_cmake_python/files/destdir.patch b/dev-ros/ament_cmake_python/files/destdir.patch
new file mode 100644 (file)
index 0000000..8e8f628
--- /dev/null
@@ -0,0 +1,26 @@
+Index: ament_cmake_python/cmake/ament_python_install_module.cmake
+===================================================================
+--- ament_cmake_python.orig/cmake/ament_python_install_module.cmake
++++ ament_cmake_python/cmake/ament_python_install_module.cmake
+@@ -64,7 +64,7 @@ function(_ament_cmake_python_install_mod
+       "execute_process(
+         COMMAND
+         \"${PYTHON_EXECUTABLE}\" \"-m\" \"compileall\"
+-        \"${CMAKE_INSTALL_PREFIX}/${destination}/${module_file}\"
++      \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${destination}/${module_file}\"
+       )"
+     )
+   endif()
+Index: ament_cmake_python/cmake/ament_python_install_package.cmake
+===================================================================
+--- ament_cmake_python.orig/cmake/ament_python_install_package.cmake
++++ ament_cmake_python/cmake/ament_python_install_package.cmake
+@@ -65,7 +65,7 @@ function(_ament_cmake_python_install_pac
+       "execute_process(
+         COMMAND
+         \"${PYTHON_EXECUTABLE}\" \"-m\" \"compileall\"
+-        \"${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_DIR}/${package_name}\"
++      \"\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_DIR}/${package_name}\"
+       )"
+     )
+   endif()