Skip to content

Commit 09a4c96

Browse files
committed
Fixed python dir
1 parent 56165de commit 09a4c96

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

.github/workflows/macos-dmg.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,19 @@ jobs:
147147
148148
# 3) Vendor Python.framework
149149
BREW_PREFIX="$(brew --prefix)"
150-
rsync -a "$BREW_PREFIX/Frameworks/Python.framework" "$FRAMEWORKS/"
150+
# Dereference symlinks so the framework is self-contained inside the app bundle
151+
rsync -aL "$BREW_PREFIX/Frameworks/Python.framework" "$FRAMEWORKS/"
151152
# Ensure a bin/python3 exists inside the vendored framework (Homebrew's may omit it)
152-
if [ ! -x "$FRAMEWORKS/Python.framework/Versions/3.13/bin/python3" ]; then
153-
mkdir -p "$FRAMEWORKS/Python.framework/Versions/3.13/bin"
154-
if [ -x "$FRAMEWORKS/Python.framework/Versions/3.13/Resources/Python.app/Contents/MacOS/Python" ]; then
155-
ln -sf "../Resources/Python.app/Contents/MacOS/Python" "$FRAMEWORKS/Python.framework/Versions/3.13/bin/python3"
153+
PYFW="$FRAMEWORKS/Python.framework"
154+
if [ -d "$PYFW/Versions/3.13" ]; then
155+
PYHOME_DIR="$PYFW/Versions/3.13"
156+
else
157+
PYHOME_DIR="$PYFW/Versions/Current"
158+
fi
159+
if [ ! -x "$PYHOME_DIR/bin/python3" ]; then
160+
mkdir -p "$PYHOME_DIR/bin"
161+
if [ -x "$PYHOME_DIR/Resources/Python.app/Contents/MacOS/Python" ]; then
162+
ln -sf "../Resources/Python.app/Contents/MacOS/Python" "$PYHOME_DIR/bin/python3"
156163
fi
157164
fi
158165
@@ -197,7 +204,11 @@ jobs:
197204
RES="$SCRIPT_DIR/../Resources"
198205
FW="$SCRIPT_DIR/../Frameworks"
199206
200-
export PYTHONHOME="$FW/Python.framework/Versions/3.13"
207+
if [ -d "$FW/Python.framework/Versions/3.13" ]; then
208+
export PYTHONHOME="$FW/Python.framework/Versions/3.13"
209+
else
210+
export PYTHONHOME="$FW/Python.framework/Versions/Current"
211+
fi
201212
export PYTHONPATH="$RES/python"
202213
export DYLD_FALLBACK_LIBRARY_PATH="$FW:$FW/glib/lib:$FW/gtk4/lib:$FW/libadwaita/lib:$FW/pango/lib:$FW/cairo/lib:$FW/gtksourceview5/lib"
203214
export GI_TYPELIB_PATH="$RES/girepository-1.0"

0 commit comments

Comments
 (0)