diff --git a/osx/Info.plist.in b/osx/Info.plist.in index 073886eb..3e3a0c75 100644 --- a/osx/Info.plist.in +++ b/osx/Info.plist.in @@ -11,7 +11,7 @@ CFBundleIconFile zoitechat.icns CFBundleIdentifier - org.zoitechat + net.zoite.Zoitechat CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType @@ -41,6 +41,6 @@ NSHumanReadableCopyright LSMinimumSystemVersion - 10.4 + 11.0 diff --git a/osx/makebundle.sh b/osx/makebundle.sh index 3e679f5a..66381ef7 100755 --- a/osx/makebundle.sh +++ b/osx/makebundle.sh @@ -2,6 +2,9 @@ set -eu +SCRIPT_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" +cd "$SCRIPT_DIR" + BUNDLE_DEF="zoitechat.bundle" APP_NAME="ZoiteChat.app" @@ -27,6 +30,19 @@ fi rm -rf "$APP_NAME" rm -f ./*.app.zip + +# Keep Info.plist generation deterministic by always rendering from template +# using a single, explicit version source. +VERSION_STRING="${VERSION:-$(sed -n "s/^ version: '\([^']*\)',$/\1/p" ../meson.build | head -n1)}" +if [ -z "$VERSION_STRING" ]; then + echo "error: unable to determine VERSION_STRING for Info.plist" >&2 + exit 1 +fi + +TMP_PLIST="Info.plist.tmp" +LC_ALL=C sed "s/@VERSION@/$VERSION_STRING/g" Info.plist.in > "$TMP_PLIST" +mv -f "$TMP_PLIST" Info.plist + # shellcheck disable=SC2086 $BUNDLER_CMD "$BUNDLE_DEF"