Skip to content

Commit

Permalink
macos packaging files
Browse files Browse the repository at this point in the history
  • Loading branch information
thantthet committed Mar 4, 2019
1 parent ae4adfd commit b190392
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,6 @@ windows/KeyMagic2/Release
windows/KeyMagic2/MagicAssit/Release
windows/KeyMagic2/KeyMagic2/Debug
windows/KeyMagic2/Debug
OSX/package
windows/inno/KeyMagic2
OSX/package/KeyMagic.app
*.pkg
3 changes: 2 additions & 1 deletion OSX/package/DeletePreviousVersions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/sh

rm -rf "$HOME/Library/Input Methods/KeyMagic.app"
#sudo rm -rf "/Library/Input Methods/KeyMagic.app"

exit 0
43 changes: 43 additions & 0 deletions OSX/package/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
IDENTITY_APP = "Developer ID Application: H T KHIN ZAW (YQ4W4QMX9D)"
IDENTITY_INSTALLER = "Developer ID Installer: H T KHIN ZAW (YQ4W4QMX9D)"
ROOT_DIR = "/tmp/KeyMagic.dst"

all: clean copy
pkgbuild \
--root $(ROOT_DIR) \
--component-plist components.plist \
--identifier org.keymagic.pkg.app \
--version 1.5.2 \
app.pkg

pkgbuild --root ./resource/others \
--identifier org.keymagic.resources \
--scripts ./resource/scripts \
resources.pkg

productbuild \
--distribution distribution.plist \
--resources ./ \
--package-path . \
--sign $(IDENTITY_INSTALLER) \
installer.pkg

cp: copy #components plist
pkgbuild --analyze --root $(ROOT_DIR) app.plist

dp: #distribution plist
productbuild --synthesize \
--package app.pkg \
--package resources.pkg \
distribution.plist

signapp:
codesign --sign $(IDENTITY_APP) KeyMagic.app

clean:
rm -rf $(ROOT_DIR)

copy:
mkdir -p $(ROOT_DIR)
cp -r ./KeyMagic.app $(ROOT_DIR)/
/usr/bin/xattr -rc $(ROOT_DIR)
18 changes: 18 additions & 0 deletions OSX/package/components.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>BundleHasStrictIdentifier</key>
<true/>
<key>BundleIsRelocatable</key>
<false/>
<key>BundleIsVersionChecked</key>
<true/>
<key>BundleOverwriteAction</key>
<string>upgrade</string>
<key>RootRelativeBundlePath</key>
<string>KeyMagic.app</string>
</dict>
</array>
</plist>
32 changes: 32 additions & 0 deletions OSX/package/distribution.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<installer-gui-script minSpecVersion="1">
<readme file="readme.txt" mime-type="text/plain"></readme>
<license file="gpl-2.0.txt" mime-type="text/plain"></license>
<conclusion file="summary.txt" mime-type="text/plain"></conclusion>

<domains enable_anywhere="false" enable_currentUserHome="true" enable_localSystem="true"></domains>

<pkg-ref id="org.keymagic.pkg.app"/>
<pkg-ref id="org.keymagic.resources"/>
<options customize="never" require-scripts="false"/>
<choices-outline>
<line choice="default">
<line choice="org.keymagic.pkg.app"/>
<line choice="org.keymagic.resources"/>
</line>
</choices-outline>
<choice id="default"/>
<choice id="org.keymagic.pkg.app" visible="false">
<pkg-ref id="org.keymagic.pkg.app"/>
</choice>
<pkg-ref id="org.keymagic.pkg.app" version="1.5.2" onConclusion="RequireLogout">app.pkg</pkg-ref>
<pkg-ref id="org.keymagic.pkg.app">
<must-close>
<app id="org.keymagic.inputmethod.KeyMagic"/>
</must-close>
</pkg-ref>
<choice id="org.keymagic.resources" visible="false">
<pkg-ref id="org.keymagic.resources"/>
</choice>
<pkg-ref id="org.keymagic.resources" version="0" onConclusion="none">resources.pkg</pkg-ref>
</installer-gui-script>
9 changes: 9 additions & 0 deletions OSX/package/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
What's new in Version 1.5.2 -
1. Minor fixes

Included Keyboard Layouts -
1. Myanmar3std
2. Zawgyi
3. ZGUni
4. Yunghkio SHAN
5. PaOh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
cd `dirname $0`
mkdir -p "others/tmp/"
rm "others/tmp/kbLayouts.zip"
cd ./../../LayoutScripts/
zip ./../OSX/package/others/tmp/kbLayouts "Zawgyi L.km2" "Zawgyi L - Unicode.km2" "mm3std.km2" "PaOh.km2" "Yunghkio SHAN.km2"
10 changes: 10 additions & 0 deletions OSX/package/resource/scripts/postinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
cd "/tmp"
mkdir "$HOME/.keymagic"
mv "kbLayouts.zip" "$HOME/.keymagic/"
cd "$HOME/.keymagic/"
unzip -o "kbLayouts.zip"
rm "kbLayouts.zip"
rm "/tmp/kbLayouts.zip"

exit 0
6 changes: 6 additions & 0 deletions OSX/package/summary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Logout လုပ်ပြီးလျှင် -

System Preferences -> Language & Text -> Input Sources မှ KeyMagic ကို အမှန်ခြစ်ပါ။


COMMAND+SPACE (သို့) CONTROL+SPACE ကိုနှိပ်ပြီး MenuBar တွင် KeyMagic Icon ပေါ်လာလျှင် အသုံးပြုလို့ရပါပြီ။

0 comments on commit b190392

Please sign in to comment.