diff --git a/libexec/bkpyvenv b/libexec/bkpyvenv index 2e0f0b4e..73498cab 100755 --- a/libexec/bkpyvenv +++ b/libexec/bkpyvenv @@ -37,13 +37,23 @@ stage) poetry config virtualenvs.create true poetry config virtualenvs.in-project true else - # --copies: copy the python binary into the venv instead of - # symlinking it. With the default --symlinks behavior the resulting - # `$PREFIX/venv/bin/python` is an absolute symlink to - # `/opt/python.org/v/bin/python`, which breaks any bottle - # installed somewhere other than /opt (eg. /usr/local/pkgs/... - # via pkgm). See pkgxdev/pantry#8487 for the original report. - python -m venv --copies "$PREFIX"/venv + case "$(uname -s)" in + Linux) + # --copies: copy the python binary into the venv instead of + # symlinking it. With the default --symlinks behavior the resulting + # `$PREFIX/venv/bin/python` is an absolute symlink to + # `/opt/python.org/v/bin/python`, which breaks any bottle + # installed somewhere other than /opt (eg. /usr/local/pkgs/... + # via pkgm). See pkgxdev/pantry#8487 for the original report. + python -m venv --copies "$PREFIX"/venv + ;; + *) + # macOS: --copies breaks signed/framework python binaries. + # The pkgm-relocation problem #8487 doesn't apply on darwin in + # the same way (different runtime resolution) + python -m venv "$PREFIX"/venv + ;; + esac fi ;; seal)