-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deskew GUI: added macOS release build script
- Loading branch information
Marek Mauder
committed
Dec 3, 2018
1 parent
0290997
commit c33750b
Showing
3 changed files
with
116 additions
and
9 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
RELEASE_DIR=../_internal/MacRelease | ||
CONTENT_DIR=$RELEASE_DIR/DeskewGui.app/Contents | ||
|
||
mkdir -p $RELEASE_DIR | ||
rm -rf $RELEASE_DIR/* | ||
|
||
# build executable | ||
lazbuild --build-mode=Release-macOS --no-write-project ../Gui/deskewgui.lpi | ||
|
||
# build app bundle | ||
mkdir -p $CONTENT_DIR/MacOS | ||
mkdir $CONTENT_DIR/Resources | ||
|
||
cp ../Gui/deskewgui $CONTENT_DIR/MacOS/ | ||
chmod 755 $CONTENT_DIR/MacOS/deskewgui | ||
|
||
cp ../Gui/deskewgui.icns $CONTENT_DIR/Resources/ | ||
chmod 644 $CONTENT_DIR/Resources/deskewgui.icns | ||
|
||
echo "APPL????" > $CONTENT_DIR/PkgInfo | ||
|
||
cat <<EOT >> $CONTENT_DIR/Info.plist | ||
<?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"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>English</string> | ||
<key>CFBundleExecutable</key> | ||
<string>deskewgui</string> | ||
<key>CFBundleDisplayName</key> | ||
<string>Deskew GUI</string> | ||
<key>CFBundleName</key> | ||
<string>Deskew GUI</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>net.galfarslair.deskewgui</string> | ||
<key>CFBundleIconFile</key> | ||
<string>deskewgui</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleSignature</key> | ||
<string>desk</string> | ||
<key>CSResourcesFileMapped</key> | ||
<true/> | ||
<key>NSHumanReadableCopyright</key> | ||
<string>©2018, Marek Mauder</string> | ||
<key>NSHighResolutionCapable</key> | ||
<true/> | ||
</dict> | ||
</plist> | ||
EOT | ||
|
||
# update version from Lazarus project file | ||
MAJOR_VER=$(grep 'MajorVersionNr' ../Gui/deskewgui.lpi | grep -oE '[0-9]+') | ||
MAJOR_VER=${MAJOR_VER:-0} # if major=0 it's not included in project file | ||
MINOR_VER=$(grep 'MinorVersionNr' ../Gui/deskewgui.lpi | grep -oE '[0-9]+') | ||
|
||
plutil -insert CFBundleShortVersionString -string $MAJOR_VER.$MINOR_VER $CONTENT_DIR/Info.plist | ||
plutil -insert CFBundleVersion -string $MAJOR_VER.$MINOR_VER $CONTENT_DIR/Info.plist | ||
|
||
# create DMG from folder | ||
DMG_NAME=DeskewGui-$MAJOR_VER.$MINOR_VER.dmg | ||
|
||
hdiutil create -srcfolder $RELEASE_DIR -volname DeskewGui -format UDZO -ov $RELEASE_DIR/$DMG_NAME |