From 6570cce4e484d9b5ad22e56b2861851fe1bcc4ce Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Thu, 28 Mar 2024 18:22:59 +0100 Subject: [PATCH] Allow working with a new python (#5401) * Workaround issue with CMake 3.29.0 * Allow working with a new python --- python-modules.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-modules.sh b/python-modules.sh index 2dc393192a..d264ffa554 100644 --- a/python-modules.sh +++ b/python-modules.sh @@ -24,7 +24,7 @@ unset VIRTUAL_ENV # NOTE: If you get an error saying "Error: This build of python cannot create # venvs without using symlinks", then you are using the MacOS Python. You # should be using the Homebrew Python instead, so run "brew install python". -python3 -m venv --copies "$INSTALLROOT" +python3 -m venv "$INSTALLROOT" . "$INSTALLROOT/bin/activate" # From now on, we use the python3 binary copied into the venv. This makes pip # install packages into the venv. @@ -46,7 +46,7 @@ find "$INSTALLROOT" -mindepth 2 -maxdepth 2 \ # Fix shebangs: remove hardcoded Python path. Scripts' shebangs will point at # the venv's python using an absolute path by default, which we must change. -sed -r -i.deleteme -e "1s,^#!$INSTALLROOT/bin/,#!/usr/bin/env ," "$INSTALLROOT"/bin/* +find "$INSTALLROOT"/bin -type f -exec sed -r -i.deleteme -e "1s,^#!$INSTALLROOT/bin/,#!/usr/bin/env ," {} \; rm -f "$INSTALLROOT"/bin/*.deleteme # Link python -> python$pyver, so we can refer to it in PYTHONPATH without knowing pyver.