Skip to content

Commit

Permalink
dev-ros/ament_cmake_python: honour DESTDIR when optimizing python
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Alexis Ballier <[email protected]>
  • Loading branch information
aballier committed Dec 12, 2019
1 parent 3cef02d commit a373c3a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions dev-ros/ament_cmake_python/ament_cmake_python-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions dev-ros/ament_cmake_python/files/destdir.patch
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit a373c3a

Please sign in to comment.