Skip to content

Commit

Permalink
[Python] Fix staged installation of Python bindings
Browse files Browse the repository at this point in the history
The problem is that with a single slash as in \$ENV{DESTDIR}, the variable
gets expanded too early (i.e., when passing ${PIP_OPTIONS} in the call to
install(CODE...)), so when "make DESTDIR=$INSTALL_DIR install" is run, the
variable is not part of the recipe, as $ENV{DESTDIR} has been passed to
install(CODE..) and has been expanded into an empty value. By adding one
more level of quoting, the expansion of DESTDIR happens at the right place
and the staged installation works correctly.

Closes: xrootd#1768
  • Loading branch information
amadio committed Nov 8, 2022
1 parent 7ae8f16 commit 22ec5bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ configure_file(${SETUP_PY_IN} ${SETUP_PY})

string(FIND "${PIP_OPTIONS}" "--prefix" PIP_OPTIONS_PREFIX_POSITION)
if( "${PIP_OPTIONS_PREFIX_POSITION}" EQUAL "-1" )
string(APPEND PIP_OPTIONS " --prefix \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}")
string(APPEND PIP_OPTIONS " --prefix \\\$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}")
else()
message(WARNING
" The pip option --prefix has been set in '${PIP_OPTIONS}' which will change"
Expand Down

0 comments on commit 22ec5bd

Please sign in to comment.