Skip to content

Commit

Permalink
Python install respects DESTDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
jokva committed Nov 15, 2017
1 parent 8889369 commit 8a1c802
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.3.5
* make install respects DESTDIR, also for python files

# 1.3.4
* Reading a slice in gather mode is significantly faster
* Use ftello when available to support large files on systems where long is
Expand Down
25 changes: 17 additions & 8 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,23 @@ add_dependencies(segyio-python segyio-shared)
# write egg_info to the build dir in order not to pollute the source directory
# and install as if it was through some other distro by using single-version,
# so that install won't die on possibly missing pythonpath
install(CODE "execute_process(COMMAND
${python} ${setup-py}
install_egg_info --install-dir .
egg_info --egg-base .
install --prefix=${CMAKE_INSTALL_PREFIX}
--single-version-externally-managed
--record installed-files
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
# setup.py install doesn't respect DESTDIR, so "force" it by changing the
# --root if DESTDIR is passed
install(CODE "
if (DEFINED ENV{DESTDIR})
get_filename_component(abs-destdir \"\$ENV{DESTDIR}\" ABSOLUTE)
set(root_destdir --root=\${abs-destdir})
endif()
execute_process(COMMAND
${python} ${setup-py}
install_egg_info --install-dir .
egg_info --egg-base .
install --prefix=${CMAKE_INSTALL_PREFIX}
--single-version-externally-managed
--record installed-files
\${root_destdir}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)")

if(NOT BUILD_TESTING)
Expand Down

0 comments on commit 8a1c802

Please sign in to comment.