Skip to content

Commit c33750b

Browse files
author
Marek Mauder
committed
Deskew GUI: added macOS release build script
1 parent 0290997 commit c33750b

File tree

3 files changed

+116
-9
lines changed

3 files changed

+116
-9
lines changed

Gui/deskewgui.icns

3.46 KB
Binary file not shown.

Gui/deskewgui.lpi

+50-9
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
<VersionInfo>
1919
<UseVersionInfo Value="True"/>
2020
<MinorVersionNr Value="90"/>
21-
<StringTable CompanyName="Galfar's Lair" FileDescription="Deskew GUI" ProductName="Deskew GUI" ProductVersion=""/>
21+
<StringTable CompanyName="Galfar's Lair" FileDescription="Deskew GUI" ProductName="Deskew GUI"/>
2222
</VersionInfo>
23-
<BuildModes Count="2">
23+
<BuildModes Count="3">
2424
<Item1 Name="Debug" Default="True"/>
2525
<Item2 Name="Release">
2626
<CompilerOptions>
@@ -56,11 +56,56 @@
5656
</Win32>
5757
</Options>
5858
</Linking>
59-
<Other>
60-
<CustomOptions Value="-dDONT_LINK_FILE_FORMATS"/>
61-
</Other>
6259
</CompilerOptions>
6360
</Item2>
61+
<Item3 Name="Release-macOS">
62+
<MacroValues Count="1">
63+
<Macro1 Name="LCLWidgetType" Value="cocoa"/>
64+
</MacroValues>
65+
<CompilerOptions>
66+
<Version Value="11"/>
67+
<PathDelim Value="\"/>
68+
<Target>
69+
<Filename Value="deskewgui"/>
70+
</Target>
71+
<SearchPaths>
72+
<IncludeFiles Value="$(ProjOutDir)"/>
73+
<OtherUnitFiles Value="..\Imaging"/>
74+
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
75+
</SearchPaths>
76+
<Parsing>
77+
<SyntaxOptions>
78+
<SyntaxMode Value="Delphi"/>
79+
</SyntaxOptions>
80+
</Parsing>
81+
<CodeGeneration>
82+
<SmartLinkUnit Value="True"/>
83+
<TargetCPU Value="x86_64"/>
84+
<TargetOS Value="darwin"/>
85+
<Optimizations>
86+
<OptimizationLevel Value="3"/>
87+
</Optimizations>
88+
</CodeGeneration>
89+
<Linking>
90+
<Debugging>
91+
<GenerateDebugInfo Value="False"/>
92+
</Debugging>
93+
<LinkSmart Value="True"/>
94+
<Options>
95+
<Win32>
96+
<GraphicApplication Value="True"/>
97+
</Win32>
98+
</Options>
99+
</Linking>
100+
</CompilerOptions>
101+
</Item3>
102+
<SharedMatrixOptions Count="5">
103+
<Item1 ID="734952752827" Modes="Release-macOS" Type="IDEMacro" MacroName="LCLWidgetType" Value="cocoa"/>
104+
<Item2 ID="088075076274" Modes="Release-macOS"/>
105+
<Item3 ID="382385632331" Modes="Release-macOS" Value="-WM10.9"/>
106+
<Item4 ID="590039250505" Modes="Debug" Value="-dDEBUG"/>
107+
<Item5 ID="453512566522" Modes="Debug,Release,Release-macOS" Value="-dDONT_LINK_FILE_FORMATS"/>
108+
</SharedMatrixOptions>
64109
</BuildModes>
65110
<PublishOptions>
66111
<Version Value="2"/>
@@ -175,10 +220,6 @@
175220
</Win32>
176221
</Options>
177222
</Linking>
178-
<Other>
179-
<CustomOptions Value="-dDONT_LINK_FILE_FORMATS
180-
-dDEBUG"/>
181-
</Other>
182223
</CompilerOptions>
183224
<Debugging>
184225
<Exceptions Count="3">

Scripts/build_gui_release_macos.sh

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
RELEASE_DIR=../_internal/MacRelease
2+
CONTENT_DIR=$RELEASE_DIR/DeskewGui.app/Contents
3+
4+
mkdir -p $RELEASE_DIR
5+
rm -rf $RELEASE_DIR/*
6+
7+
# build executable
8+
lazbuild --build-mode=Release-macOS --no-write-project ../Gui/deskewgui.lpi
9+
10+
# build app bundle
11+
mkdir -p $CONTENT_DIR/MacOS
12+
mkdir $CONTENT_DIR/Resources
13+
14+
cp ../Gui/deskewgui $CONTENT_DIR/MacOS/
15+
chmod 755 $CONTENT_DIR/MacOS/deskewgui
16+
17+
cp ../Gui/deskewgui.icns $CONTENT_DIR/Resources/
18+
chmod 644 $CONTENT_DIR/Resources/deskewgui.icns
19+
20+
echo "APPL????" > $CONTENT_DIR/PkgInfo
21+
22+
cat <<EOT >> $CONTENT_DIR/Info.plist
23+
<?xml version="1.0" encoding="UTF-8"?>
24+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
25+
<plist version="1.0">
26+
<dict>
27+
<key>CFBundleDevelopmentRegion</key>
28+
<string>English</string>
29+
<key>CFBundleExecutable</key>
30+
<string>deskewgui</string>
31+
<key>CFBundleDisplayName</key>
32+
<string>Deskew GUI</string>
33+
<key>CFBundleName</key>
34+
<string>Deskew GUI</string>
35+
<key>CFBundleIdentifier</key>
36+
<string>net.galfarslair.deskewgui</string>
37+
<key>CFBundleIconFile</key>
38+
<string>deskewgui</string>
39+
<key>CFBundleInfoDictionaryVersion</key>
40+
<string>6.0</string>
41+
<key>CFBundlePackageType</key>
42+
<string>APPL</string>
43+
<key>CFBundleSignature</key>
44+
<string>desk</string>
45+
<key>CSResourcesFileMapped</key>
46+
<true/>
47+
<key>NSHumanReadableCopyright</key>
48+
<string>©2018, Marek Mauder</string>
49+
<key>NSHighResolutionCapable</key>
50+
<true/>
51+
</dict>
52+
</plist>
53+
EOT
54+
55+
# update version from Lazarus project file
56+
MAJOR_VER=$(grep 'MajorVersionNr' ../Gui/deskewgui.lpi | grep -oE '[0-9]+')
57+
MAJOR_VER=${MAJOR_VER:-0} # if major=0 it's not included in project file
58+
MINOR_VER=$(grep 'MinorVersionNr' ../Gui/deskewgui.lpi | grep -oE '[0-9]+')
59+
60+
plutil -insert CFBundleShortVersionString -string $MAJOR_VER.$MINOR_VER $CONTENT_DIR/Info.plist
61+
plutil -insert CFBundleVersion -string $MAJOR_VER.$MINOR_VER $CONTENT_DIR/Info.plist
62+
63+
# create DMG from folder
64+
DMG_NAME=DeskewGui-$MAJOR_VER.$MINOR_VER.dmg
65+
66+
hdiutil create -srcfolder $RELEASE_DIR -volname DeskewGui -format UDZO -ov $RELEASE_DIR/$DMG_NAME

0 commit comments

Comments
 (0)