diff --git a/macos/Grim.app/Contents/Info.plist b/macos/Grim.app/Contents/Info.plist
index 669d7aa..f2c5b12 100644
--- a/macos/Grim.app/Contents/Info.plist
+++ b/macos/Grim.app/Contents/Info.plist
@@ -1,77 +1,65 @@
-
+
-
- CFBundleDevelopmentRegion
- en
-
- CFBundleDisplayName
- Grim
-
- CFBundleExecutable
- grim
-
- CFBundleIconFile
- AppIcon
-
- CFBundleIconName
- AppIcon
-
- CFBundleIdentifier
- mw.gri.macos
-
- CFBundleInfoDictionaryVersion
- 6.0
-
- CFBundleName
- Grim
-
- CFBundlePackageType
- APPL
-
- CFBundleShortVersionString
- 0.1.0
-
- CFBundleSupportedPlatforms
-
- MacOSX
-
-
- CFBundleVersion
- 1
-
- CFBundleDocumentTypes
-
-
- CFBundleTypeName
- Apple SimpleText document
- CFBundleTypeRole
- Viewer
- LSItemContentTypes
-
- com.apple.traditional-mac-plain-text
-
- NSDocumentClass
- Document
-
-
- CFBundleTypeName
- Unknown document
- CFBundleTypeRole
- Viewer
- LSItemContentTypes
-
- public.data
-
- NSDocumentClass
- Document
-
-
-
- LSApplicationCategoryType
- public.app-category.finance
-
- NSHumanReadableCopyright
- 2024
-
-
\ No newline at end of file
+
+ CFBundleDevelopmentRegion
+ en
+ CFBundleDisplayName
+ Grim
+ CFBundleExecutable
+ grim
+ CFBundleIconFile
+ AppIcon
+ CFBundleIconName
+ AppIcon
+ CFBundleIdentifier
+ mw.gri.macos
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ Grim
+ CFBundlePackageType
+ APPL
+ CFBundleShortVersionString
+ 0.2.2
+ CFBundleSupportedPlatforms
+
+ MacOSX
+
+ CFBundleVersion
+ 1
+ NSCameraUsageDescription
+ Grim needs an access to your camera to scan QR code.
+ CFBundleDocumentTypes
+
+
+ CFBundleTypeName
+ Apple SimpleText document
+ CFBundleTypeRole
+ Viewer
+ LSItemContentTypes
+
+ com.apple.traditional-mac-plain-text
+
+ NSDocumentClass
+ Document
+
+
+ CFBundleTypeName
+ Unknown document
+ CFBundleTypeRole
+ Viewer
+ LSItemContentTypes
+
+ public.data
+
+ NSDocumentClass
+ Document
+
+
+ LSApplicationCategoryType
+ public.app-category.finance
+ NSHumanReadableCopyright
+ 2024
+
+
diff --git a/macos/Grim.app/Contents/MacOS/.gitignore b/macos/Grim.app/Contents/MacOS/.gitignore
index b722e9e..075ed11 100644
--- a/macos/Grim.app/Contents/MacOS/.gitignore
+++ b/macos/Grim.app/Contents/MacOS/.gitignore
@@ -1 +1,2 @@
-!.gitignore
\ No newline at end of file
+!.gitignore
+grim
\ No newline at end of file
diff --git a/macos/build_release.sh b/macos/build_release.sh
index 5f50d35..ff8618b 100755
--- a/macos/build_release.sh
+++ b/macos/build_release.sh
@@ -1,11 +1,11 @@
#!/bin/bash
set -e
-case $2 in
+case $1 in
x86_64|arm|universal)
;;
*)
- echo "Usage: release_macos.sh [version] [platform]\n - platform: 'x86_64', 'arm', 'universal'" >&2
+ echo "Usage: release_macos.sh [platform] [version]\n - platform: 'x86_64', 'arm', 'universal'" >&2
exit 1
esac
@@ -24,17 +24,28 @@ cd ${BASEDIR}
cd ..
# Setup platform
-rustup target add x86_64-apple-darwin
-rustup target add aarch64-apple-darwin
+[[ $1 == "x86_64" ]] && arch+=(x86_64-apple-darwin)
+[[ $1 == "arm" ]] && arch+=(aarch64-apple-darwin)
-[[ $2 == "x86_64" ]] && arch+=(x86_64-apple-darwin)
-[[ $2 == "arm" ]] && arch+=(aarch64-apple-darwin)
-[[ $2 == "universal" ]]; arch+=(universal2-apple-darwin)
+if [[ "$OSTYPE" != "darwin"* ]]; then
+ # Start release build on non-MacOS with zig linker, requires zig 0.12.1
+ rustup target add x86_64-apple-darwin
+ rustup target add aarch64-apple-darwin
+ [[ $1 == "universal" ]]; arch+=(universal2-apple-darwin)
+ cargo install cargo-zigbuild
+ cargo zigbuild --release --target ${arch}
+else
+ rustup target add ${arch}
+ if [[ $1 == "universal" ]]; then
+ cargo build --release --target x86_64-apple-darwin
+ cargo build --release --target aarch64-apple-darwin
+ lipo -create -output target/grim target/aarch64-apple-darwin/release/grim target/x86_64-apple-darwin/release/grim
+ else
+ cargo build --release --target ${arch}
+ fi
+fi
-# Start release build with zig linker, requires zig 0.12.1
-cargo install cargo-zigbuild
-cargo zigbuild --release --target ${arch}
-rm -rf .intentionally-empty-file.o
+rm -f .intentionally-empty-file.o
yes | cp -rf target/${arch}/release/grim macos/Grim.app/Contents/MacOS
@@ -43,8 +54,7 @@ yes | cp -rf target/${arch}/release/grim macos/Grim.app/Contents/MacOS
#rcodesign sign --pem-file cert.pem macos/Grim.app
# Create release package
-FILE_NAME=grim-v$1-macos-$2.zip
-rm -rf target/${arch}/release/${FILE_NAME}
+FILE_NAME=grim-v$2-macos-$1.zip
cd macos
zip -r ${FILE_NAME} Grim.app
mv ${FILE_NAME} ../target/${arch}/release