diff --git a/build_tools/make_macos_pkg.sh b/build_tools/make_macos_pkg.sh index a6eabdaed..d6f36f5c9 100755 --- a/build_tools/make_macos_pkg.sh +++ b/build_tools/make_macos_pkg.sh @@ -82,17 +82,16 @@ do_cmake() { && env DESTDIR="$PKGDIR/root/" $ARM64_DEPLOY_TARGET make install; } -# Build for x86-64 but do not install; instead we will make some fat binaries inside the root. +# Build for x86-64 but do not install; instead we will make a fat binary inside the root. { cd "$PKGDIR/build_x86_64" \ && do_cmake -DRust_CARGO_TARGET=x86_64-apple-darwin \ && env $X86_64_DEPLOY_TARGET make VERBOSE=1 -j 12; } -# Fatten them up. -for FILE in "$PKGDIR"/root/usr/local/bin/*; do - X86_FILE="$PKGDIR/build_x86_64/$(basename "$FILE")" - rcodesign macho-universal-create --output "$FILE" "$FILE" "$X86_FILE" - chmod 755 "$FILE" -done +# Fatten it up. +FILE=$PKGDIR/root/usr/local/bin/fish +X86_FILE=$PKGDIR/build_x86_64/$(basename "$FILE") +rcodesign macho-universal-create --output "$FILE" "$FILE" "$X86_FILE" +chmod 755 "$FILE" if test -n "$SIGN"; then echo "Signing executables" @@ -105,9 +104,7 @@ if test -n "$SIGN"; then if [ -n "$ENTITLEMENTS_FILE" ]; then ARGS+=(--entitlements-xml-file "$ENTITLEMENTS_FILE") fi - for FILE in "$PKGDIR"/root/usr/local/bin/*; do - (set +x; rcodesign sign "${ARGS[@]}" "$FILE") - done + (set +x; rcodesign sign "${ARGS[@]}" "$PKGDIR"/root/usr/local/bin/fish) fi pkgbuild --scripts "$SRC_DIR/build_tools/osx_package_scripts" --root "$PKGDIR/root/" --identifier 'com.ridiculousfish.fish-shell-pkg' --version "$VERSION" "$PKGDIR/intermediates/fish.pkg" @@ -128,15 +125,13 @@ fi (cd "$PKGDIR/build_arm64" && env $ARM64_DEPLOY_TARGET make -j 12 fish_macapp) (cd "$PKGDIR/build_x86_64" && env $X86_64_DEPLOY_TARGET make -j 12 fish_macapp) -# Make the app's /usr/local/bin binaries universal. Note fish.app/Contents/MacOS/fish already is, courtesy of CMake. +# Make the app's /usr/local/bin/fish binary universal. Note fish.app/Contents/MacOS/fish already is, courtesy of CMake. cd "$PKGDIR/build_arm64" -for FILE in fish.app/Contents/Resources/base/usr/local/bin/*; do - X86_FILE="$PKGDIR/build_x86_64/fish.app/Contents/Resources/base/usr/local/bin/$(basename "$FILE")" - rcodesign macho-universal-create --output "$FILE" "$FILE" "$X86_FILE" - - # macho-universal-create screws up the permissions. - chmod 755 "$FILE" -done +FILE=fish.app/Contents/Resources/base/usr/local/bin/fish +X86_FILE=$PKGDIR/build_x86_64/fish.app/Contents/Resources/base/usr/local/bin/$(basename "$FILE") +rcodesign macho-universal-create --output "$FILE" "$FILE" "$X86_FILE" +# macho-universal-create screws up the permissions. +chmod 755 "$FILE" if test -n "$SIGN"; then echo "Signing app"