diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 40 | ||||
-rw-r--r-- | README.md | 8 | ||||
-rw-r--r-- | dist/MacOS/nheko.app/Contents/Info.plist | 33 | ||||
-rw-r--r-- | dist/MacOS/nheko.app/Contents/MacOS/.gitkeep | 0 | ||||
-rw-r--r-- | dist/MacOS/nheko.app/Contents/Resources/nheko.icns | bin | 0 -> 118837 bytes |
6 files changed, 63 insertions, 20 deletions
diff --git a/.gitignore b/.gitignore index ada23bf5..fd54f2b6 100644 --- a/.gitignore +++ b/.gitignore @@ -75,3 +75,5 @@ Temporary Items # Nix result +*.dmg +dist/MacOS/nheko.app/Contents/MacOS/nheko diff --git a/Makefile b/Makefile index b4af63fb..b8d9d050 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,18 @@ +APP_NAME = nheko + +MAC_DIST_DIR = dist/MacOS +APP_TEMPLATE = $(MAC_DIST_DIR)/Nheko.app + SRC := $(shell find include src -type f -type f \( -iname "*.cc" -o -iname "*.h" \)) + # Linux specific helpers debug: @cmake -DBUILD_TESTS=OFF -H. -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Debug @cmake --build build - release-debug: - @cmake -DBUILD_TESTS=OFF -H. -GNinja -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo + @cmake -DBUILD_TESTS=OFF -H. -Bbuild -DCMAKE_BUILD_TYPE=RelWithDebInfo @cmake --build build test: @@ -15,24 +20,19 @@ test: @cmake --build build @cd build && GTEST_COLOR=1 ctest --verbose -# MacOS specific helpers -mdebug: - @cmake -DBUILD_TESTS=OFF \ - -H. \ - -GNinja \ - -Bbuild \ - -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 \ - -DCMAKE_BUILD_TYPE=Debug - @cmake --build build +app: release-debug $(APP_TEMPLATE) + @cp -fp ./build/$(APP_NAME) $(APP_TEMPLATE)/Contents/MacOS + @echo "Created '$(APP_NAME).app' in '$(APP_TEMPLATE)'" -mrelease: - @cmake -DBUILD_TESTS=OFF \ - -H. \ - -GNinja \ - -Bbuild \ - -DCMAKE_PREFIX_PATH=/usr/local/opt/qt5 \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo - @cmake --build build +app-install: app + cp -rf $(APP_TEMPLATE) /Applications/Nheko.app + +dmg: app + hdiutil create $(MAC_DIST_DIR)/Nheko.dmg \ + -volname "$(APP_NAME)" \ + -fs HFS+ \ + -srcfolder $(MAC_DIST_DIR) \ + -ov -format UDZO run: @./build/nheko @@ -44,4 +44,4 @@ lint: clean: rm -rf build -.PHONY: build +.PHONY: build app dmg diff --git a/README.md b/README.md index 7395dbc9..a2b999ca 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,14 @@ make -C build The `nheko` binary will be located in the `build` directory. +##### MacOS + +You can create an app bundle with `make app`. The output will be located at +`dist/MacOS/Nheko.app` which you can be copied to `/Applications/Nheko.app`. + +You can also create a disk image with `make dmg`. The output will be located at +`dist/MacOS/Nheko.dmg` + ##### Nix Download the repo as mentioned above and run diff --git a/dist/MacOS/nheko.app/Contents/Info.plist b/dist/MacOS/nheko.app/Contents/Info.plist new file mode 100644 index 00000000..59a123b1 --- /dev/null +++ b/dist/MacOS/nheko.app/Contents/Info.plist @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" +"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> + <dict> + <key>CFBundleDisplayName</key> + <string>Nheko</string> + <key>CFBundleExecutable</key> + <string>nheko</string> + <key>CFBundleIdentifier</key> + <string>nheko</string> + <key>CFBundleName</key> + <string>Nheko</string> + <key>CFBundleIconFile</key> + <string>nheko.icns</string> + <key>CFBundleShortVersionString</key> + <string>0.1.0</string> + <key>CFBundleVersion</key> + <string>0.1.0</string> + <key>CFBundleDevelopmentRegion</key> + <string>en</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>NSHighResolutionCapable</key> + <true /> + <key>NSMainNibFile</key> + <string></string> + <key>NSSupportsAutomaticGraphicsSwitching</key> + <true /> + </dict> +</plist> diff --git a/dist/MacOS/nheko.app/Contents/MacOS/.gitkeep b/dist/MacOS/nheko.app/Contents/MacOS/.gitkeep new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/dist/MacOS/nheko.app/Contents/MacOS/.gitkeep diff --git a/dist/MacOS/nheko.app/Contents/Resources/nheko.icns b/dist/MacOS/nheko.app/Contents/Resources/nheko.icns new file mode 100644 index 00000000..ecb66b6f --- /dev/null +++ b/dist/MacOS/nheko.app/Contents/Resources/nheko.icns Binary files differ |