Skip to content

Commit

Permalink
Add dmg icon and background for mac osx
Browse files Browse the repository at this point in the history
  • Loading branch information
rogchap committed Aug 30, 2020
1 parent fb3fa28 commit 3fedbc7
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 17 deletions.
45 changes: 32 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,27 @@ mod:
clean-moc:
find ./internal -name 'moc*' -delete

define make_icns
mkdir _temp.iconset
sips -z 16 16 $(1) --out _temp.iconset/icon_16x16.png
sips -z 32 32 $(1) --out _temp.iconset/[email protected]
sips -z 32 32 $(1) --out _temp.iconset/icon_32x32.png
sips -z 64 64 $(1) --out _temp.iconset/[email protected]
sips -z 128 128 $(1) --out _temp.iconset/icon_128x128.png
sips -z 256 256 $(1) --out _temp.iconset/[email protected]
sips -z 256 256 $(1) --out _temp.iconset/icon_256x256.png
sips -z 512 512 $(1) --out _temp.iconset/[email protected]
sips -z 512 512 $(1) --out _temp.iconset/icon_512x512.png
sips -z 1024 1024 $(1) --out _temp.iconset/[email protected]
iconutil -c icns -o $(2) _temp.iconset
rm -rf _temp.iconset
endef

.PHONY: darwin-icon
IN[email protected]
OUT=darwin/wombat.iconset
darwin-icon:
mkdir -p $(OUT)
sips -z 16 16 $(IN) --out $(OUT)/icon_16x16.png
sips -z 32 32 $(IN) --out $(OUT)/[email protected]
sips -z 32 32 $(IN) --out $(OUT)/icon_32x32.png
sips -z 64 64 $(IN) --out $(OUT)/[email protected]
sips -z 128 128 $(IN) --out $(OUT)/icon_128x128.png
sips -z 256 256 $(IN) --out $(OUT)/[email protected]
sips -z 256 256 $(IN) --out $(OUT)/icon_256x256.png
sips -z 512 512 $(IN) --out $(OUT)/[email protected]
sips -z 512 512 $(IN) --out $(OUT)/icon_512x512.png
sips -z 1024 1024 $(IN) --out $(OUT)/[email protected]
iconutil -c icns -o darwin/Contents/Resources/Wombat.icns $(OUT)
# rm -rf $(OUT)
$(call make_icns, [email protected], darwin/Content/Resources/Wombat.icns)

.PHONY: win-icon
IN[email protected]
Expand All @@ -50,4 +54,19 @@ win-icon:
rm -rf $(OUT)
rsrc -ico windows/icon.ico -o icon.syso -arch=amd64

dmg-icon:
$(call make_icns, assets/darwin/dmg_icon.png, assets/darwin/dmg_icon.icns)

dmg:
-rm Wombat.dmg
create-dmg \
--volname "Wombat" \
--volicon "assets/darwin/dmg_icon.icns" \
--background "assets/darwin/dmg_bg.png" \
--window-size 512 360 \
--icon-size 100 \
--icon "Wombat.app" 100 185 \
--hide-extension "Wombat.app" \
--app-drop-link 388 185 \
"Wombat.dmg" \
"deploy/darwin"
Binary file added assets/darwin/dmg_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/darwin/dmg_icon.icns
Binary file not shown.
Binary file added assets/darwin/dmg_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions darwin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>CFBundleExecutable</key>
<string>Wombat</string>
<key>CFBundleGetInfoString</key>
<string>Created by Rogchap</string>
<string>Created by Roger Chapman (rogchap)</string>
<key>CFBundleIconFile</key>
<string>Wombat.icns</string>
<key>CFBundleIdentifier</key>
Expand All @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1.0-alpha.1</string>
<string>0.1.0-beta</string>
<key>LSMinimumSystemVersion</key>
<string>10.11</string>
<key>NSPrincipalClass</key>
Expand Down
4 changes: 2 additions & 2 deletions internal/app/startup.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
// The following variables are set via LDFlags at build time
var (
appname = "Wombat"
semver = "0.1.0-alpha.3"
isDebug = true
semver = "0.1.0-beta"
isDebug = false
)

// Startup is the main startup of the application
Expand Down

0 comments on commit 3fedbc7

Please sign in to comment.