Fix relative python path

This commit is contained in:
Matthias Kuhn 2025-01-27 09:38:47 +01:00
parent a8b2cd7a5f
commit a912987c3b
2 changed files with 6 additions and 5 deletions

View File

@ -44,10 +44,10 @@ if(WITH_BINDINGS)
cmake_path(GET Python_SITEARCH PARENT_PATH _SOURCE_PYTHON_DIR)
set(_TARGET_PYTHON_DIR "${APP_FRAMEWORKS_DIR}/lib")
set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}")
install(PROGRAMS ${PYTHON_EXECUTABLE}
get_filename_component(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" NAME)
install(PROGRAMS ${Python_EXECUTABLE}
DESTINATION "${QGIS_BIN_SUBDIR}")
configure_file("${CMAKE_SOURCE_DIR}/platform/macos/python.in" "${CMAKE_BINARY_DIR}/platform/macos/python")
configure_file("${CMAKE_SOURCE_DIR}/platform/macos/python.in" "${CMAKE_BINARY_DIR}/platform/macos/python" @ONLY)
install(PROGRAMS "${CMAKE_BINARY_DIR}/platform/macos/python"
DESTINATION "${QGIS_BIN_SUBDIR}")
endif()

View File

@ -1,5 +1,6 @@
#!/bin/bash
# This is a wrapper for python, to launch python with the proper PYTHONHOME set
# to make it relocatable.
export PYTHONHOME="$(cd "$(dirname "$0")/../Frameworks" && pwd)"
exec @PYTHON_EXECUTABLE@ "$@"
BASEDIR="$(cd "$(dirname "$0")" && pwd)"
export PYTHONHOME="${BASEDIR}/../Frameworks"
exec ${BASEDIR}/@PYTHON_EXECUTABLE@ "$@"