@@ -37,7 +37,7 @@ echo "== 1. the program's rpath =="
3737rm -rf target
3838" $MCPP " build > bundle-build.log 2>&1 || fail " mcpp build failed" bundle-build.log
3939if find target -name ' *.app' | grep -q . ; then fail " a plain build produced a bundle" ; fi
40- programs=$( find target -type f -name " $EXE " ! -path ' */.build-mcpp/*' )
40+ programs=$( find target -type f -name " $EXE " ! -path ' */.build-mcpp/*' ! -path ' *.dSYM/* ' )
4141[ " $( printf ' %s\n' " $programs " | grep -c .) " = 1 ] \
4242 || fail " expected one linked $EXE under target/, found: $( echo $programs ) " bundle-build.log
4343otool -l " $programs " > bundle-loadcommands.log
@@ -48,9 +48,11 @@ printf '%s\n' "$rpaths" | grep -qxF '@executable_path/../Frameworks' \
4848if printf ' %s\n' " $rpaths " | grep -q ' .@executable_path' ; then
4949 fail " an rpath carries @executable_path after a directory, anchored" bundle-loadcommands.log
5050fi
51+ # The dependency's install name is the engine's choice and is recorded, not
52+ # asserted: criterion 3 is what shows the bundle loads the framework copy.
5153otool -L " $programs " > bundle-needed.log
52- grep -q " @rpath/ $ DYLIB" bundle-needed.log || fail " the program does not load @rpath/ $DYLIB " bundle-needed.log
53- echo " ok: LC_RPATH @executable_path/../Frameworks, as written, and the dependency is @rpath/ $DYLIB "
54+ reading install-name " $( grep " $ DYLIB" bundle-needed.log | sed ' s/^[[:space:]]*// ' | head -1 ) "
55+ echo " ok: LC_RPATH @executable_path/../Frameworks, as written"
5456
5557# ── 2. the bundle ──────────────────────────────────────────────────────────
5658echo " == 2. the bundle carries the framework and is signed ad hoc =="
@@ -91,7 +93,8 @@ reading bundle-run "exit=$rc $(cat bundle-run-out.log)"
9193grep -qx ' framework-1-2-3 argc=1' bundle-run-out.log || fail " the bundled program's output is missing" bundle-run-out.log
9294loaded=$( grep " $DYLIB " bundle-run-err.log | head -1)
9395reading loaded " $loaded "
94- case " $loaded " in * " /$NAME .app/Contents/Frameworks/$DYLIB " ) ;;
96+ # dyld may print the rpath expansion unnormalised (`Contents/MacOS/../Frameworks`).
97+ case " $loaded " in * " /$NAME .app/Contents/Frameworks/$DYLIB " | * " /$NAME .app/Contents/MacOS/../Frameworks/$DYLIB " ) ;;
9598 * ) fail " the program did not load the framework copy" bundle-run-err.log ;; esac
9699cp -R " $app " " $work /"
97100rm " $work /$NAME .app/Contents/Frameworks/$DYLIB "
0 commit comments