diff options
author | Joe Wilm <jwilm@users.noreply.github.com> | 2017-03-08 07:47:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-08 07:47:25 -0800 |
commit | 3c6b32014c223cbcd128844bf91e40a08745c149 (patch) | |
tree | f2c4d53af014393484170889bf4cd8451261f508 | |
parent | ad56e3b7615370ab156cd9a5f7876f67b07c80fc (diff) | |
parent | 8445c761f01c3b9d618a4c7bf7f55c427dfc4aa8 (diff) | |
download | r-alacritty-3c6b32014c223cbcd128844bf91e40a08745c149.tar.gz r-alacritty-3c6b32014c223cbcd128844bf91e40a08745c149.tar.bz2 r-alacritty-3c6b32014c223cbcd128844bf91e40a08745c149.zip |
Merge pull request #462 from brycefisher/cema-mac-app-tweaks
OSX: Add app packing tooling - tweaks and polish
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 50 | ||||
-rw-r--r-- | assets/osx/Alacritty.app/Contents/Info.plist | 32 | ||||
-rwxr-xr-x | assets/osx/Alacritty.app/Contents/MacOS/launcher | 15 | ||||
-rw-r--r-- | assets/osx/Alacritty.app/Contents/Resources/alacritty.icns | bin | 0 -> 66619 bytes |
5 files changed, 99 insertions, 0 deletions
@@ -1,5 +1,7 @@ target FlameGraph + +# Temp files .idea *.iml diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..4f4ca807 --- /dev/null +++ b/Makefile @@ -0,0 +1,50 @@ +TARGET = alacritty + +APP_NAME = Alacritty.app +ASSETS_DIR = assets +RELEASE_DIR = target/release +APP_TEMPLATE = $(ASSETS_DIR)/osx/$(APP_NAME) +APP_DIR = $(RELEASE_DIR)/osx +APP_BINARY = $(RELEASE_DIR)/$(TARGET) +APP_BINARY_DIR = $(APP_DIR)/$(APP_NAME)/Contents/MacOS + +DMG_NAME = Alacritty.dmg +DMG_DIR = $(RELEASE_DIR)/osx + +vpath $(TARGET) $(RELEASE_DIR) +vpath $(APP_NAME) $(APP_DIR) +vpath $(DMG_NAME) $(APP_DIR) + +all: help + +help: ## Prints help for targets with comments + @grep -E '^[a-zA-Z._-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + +binary: | $(TARGET) ## Build release binary with cargo +$(TARGET): + cargo build --release + +app: | $(APP_NAME) ## Clone Alacritty.app template and mount binary +$(APP_NAME): $(TARGET) $(APP_TEMPLATE) + @mkdir -p $(APP_BINARY_DIR) + @cp -fRp $(APP_TEMPLATE) $(APP_DIR) + @cp -fp $(APP_BINARY) $(APP_BINARY_DIR) + @echo "Created '$@' in '$(APP_DIR)'" + +dmg: | $(DMG_NAME) ## Pack Alacritty.app into .dmg +$(DMG_NAME): $(APP_NAME) + @echo "Packing disk image..." + @hdiutil create $(DMG_DIR)/$(DMG_NAME) \ + -volname "Alacritty" \ + -fs HFS+ \ + -srcfolder $(APP_DIR) \ + -ov -format UDZO + @echo "Packed '$@' in '$(APP_DIR)'" + +install: $(DMG_NAME) ## Mount disk image + @open $(DMG_DIR)/$(DMG_NAME) + +.PHONY: app binary clean dmg install + +clean: ## Remove all artifacts + -rm -rf $(APP_DIR) diff --git a/assets/osx/Alacritty.app/Contents/Info.plist b/assets/osx/Alacritty.app/Contents/Info.plist new file mode 100644 index 00000000..77053db1 --- /dev/null +++ b/assets/osx/Alacritty.app/Contents/Info.plist @@ -0,0 +1,32 @@ +<?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>Alacritty</string> + <key>CFBundleExecutable</key> + <string>launcher</string> + <!-- <key>CFBundleIdentifier</key> --> + <!-- <string>alacritty</string> --> + <key>CFBundleName</key> + <string>Alacritty</string> + <key>CFBundleIconFile</key> + <string>alacritty.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/assets/osx/Alacritty.app/Contents/MacOS/launcher b/assets/osx/Alacritty.app/Contents/MacOS/launcher new file mode 100755 index 00000000..d3c10724 --- /dev/null +++ b/assets/osx/Alacritty.app/Contents/MacOS/launcher @@ -0,0 +1,15 @@ +#!/bin/bash + +# Dynamically discover canonical path to alacritty binary +BIN_DIR=$(cd "$(dirname "$0")"; pwd) + +# Query OS for locale and setup alacritty shell to conform +ALACRITTY_LOCALE="$(osascript -e "return user locale of (get system info)")" +export LANG="${ALACRITTY_LOCALE}.UTF-8" +export LC_CTYPE="${ALACRITTY_LOCALE}.UTF-8" + +# Start alacritty in user's home directory +cd "$HOME" + +# Engage +exec "$BIN_DIR/alacritty" diff --git a/assets/osx/Alacritty.app/Contents/Resources/alacritty.icns b/assets/osx/Alacritty.app/Contents/Resources/alacritty.icns Binary files differnew file mode 100644 index 00000000..bdbc0ca1 --- /dev/null +++ b/assets/osx/Alacritty.app/Contents/Resources/alacritty.icns |