Fix nightly Linux test build and macOS signing after Python plugins merge

Export wxWidgets include dirs and defines from libslic3r_gui on Linux so
tests outside src/ compile against its GUI headers. Relocate the bundled
Python runtime to Contents/Resources with a Contents/MacOS/python symlink
(codesign cannot seal the dotted python3.12 dirs under Contents/MacOS) and
replace the deprecated codesign --deep with explicit inside-out signing of
every Mach-O in the bundle.
This commit is contained in:
SoftFever
2026-07-19 01:47:59 +08:00
parent a6226ba9cb
commit 3926475bb7
3 changed files with 65 additions and 9 deletions

View File

@@ -179,6 +179,22 @@ function pack_deps() {
)
}
# codesign cannot seal the runtime's dotted directories (include/python3.12,
# lib/python3.12) anywhere under Contents/MacOS -- it mistakes any dotted
# directory there for a nested bundle and fails with "bundle format
# unrecognized" -- so packaged apps ship the runtime under Contents/Resources
# with a compatibility symlink that keeps every Contents/MacOS/python path and
# the @executable_path/python/lib rpath resolving unchanged.
function relocate_python_runtime() {
local app="$1"
local pydir="$app/Contents/MacOS/python"
if [ -d "$pydir" ] && [ ! -L "$pydir" ]; then
rm -rf "$app/Contents/Resources/python"
mv "$pydir" "$app/Contents/Resources/python"
ln -s ../Resources/python "$pydir"
fi
}
# --- Bundled Python runtime verification --------------------------------------
# Relocation is handled at the source: deps/python3/python3.cmake stamps
# libpython with an @rpath id and src/CMakeLists.txt gives the app a matching
@@ -190,6 +206,11 @@ function verify_python_runtime() {
local app="$1"
local pydir="$app/Contents/MacOS/python"
[ -d "$pydir" ] || return 0 # app doesn't bundle Python (e.g. profile validator)
if [ ! -L "$pydir" ]; then
echo "ERROR: Contents/MacOS/python must be a symlink into Contents/Resources" >&2
echo " (see relocate_python_runtime in this script)" >&2
exit 1
fi
# Version-agnostic interpreter name so a CPython version bump cannot
# silently skip the gate; if the dir exists the interpreter must too.
local pybin="$pydir/bin/python3"
@@ -273,6 +294,7 @@ function build_slicer() {
resources_path=$(readlink ./OrcaSlicer.app/Contents/Resources)
rm ./OrcaSlicer.app/Contents/Resources
cp -R "$resources_path" ./OrcaSlicer.app/Contents/Resources
relocate_python_runtime ./OrcaSlicer.app
# delete .DS_Store file
find ./OrcaSlicer.app/ -name '.DS_Store' -delete