Files
deb-lite-xl/scripts/make-universal-binaries.sh
Takase 8782c8064f ci: use latest macos images (#1804)
* ci: use latest macos images

* ci/build: clarify the purpose of md5sha1sum

* meson.build: remove hidapi usage

* ci: downgrade macos version for universal build

* scripts: codesign the universal binary with sha1 and sha256

* ci: revert back to macos-14 for universal

* ci/build: remove old comment
2024-06-23 09:02:55 +08:00

38 lines
1.1 KiB
Bash

#!/usr/bin/env bash
set -ex
if [ ! -e "src/api/api.h" ]; then
echo "Please run this script from the root directory of Lite XL."
exit 1
fi
WORKDIR="work"
DMGDIR="$1"
if [[ -z "$DMGDIR" ]]; then
echo "Please provide a path containing the dmg files."
exit 1
fi
rm -rf "$WORKDIR"
mkdir -p "$WORKDIR"
for dmg_path in "$DMGDIR"/*.dmg; do
dmg="${dmg_path##*/}"
dmg="${dmg%.dmg}"
hdiutil attach -mountpoint "/Volumes/$dmg" "$dmg_path"
if [[ ! -d "$WORKDIR/dmg" ]]; then
ditto "/Volumes/$dmg/Lite XL.app" "Lite XL.app"
fi
cp "/Volumes/$dmg/Lite XL.app/Contents/MacOS/lite-xl" "$WORKDIR/$dmg-lite-xl"
hdiutil detach "/Volumes/$dmg"
done
lipo -create -output "Lite XL.app/Contents/MacOS/lite-xl" "$WORKDIR/"*-lite-xl
# https://eclecticlight.co/2019/01/17/code-signing-for-the-concerned-3-signing-an-app/
# https://wiki.lazarus.freepascal.org/Code_Signing_for_macOS#Big_Sur_and_later_on_Apple_M1_ARM64_processors
# codesign all the files again, hopefully this would fix signature validation
codesign --force --deep --digest-algorithm=sha1,sha256 -s - "Lite XL.app"
source scripts/appdmg.sh "$2"