From 377193c5edcae7159f4bd8e4f99b65ce4cc1415b Mon Sep 17 00:00:00 2001 From: Semyon Pisarev Date: Thu, 12 Jan 2017 13:01:29 +0300 Subject: Ignore temp files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 46831eaf..22c1fa59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ target FlameGraph + +# Temp files .idea *.iml -- cgit From 0ef98733eaed4b2ce25faf2bb9f3476938e76123 Mon Sep 17 00:00:00 2001 From: Semyon Pisarev Date: Thu, 12 Jan 2017 13:01:52 +0300 Subject: Add Makefile and .app --- Makefile | 45 +++++++++++++++++++++ assets/osx/Alacritty.app/Contents/Info.plist | 32 +++++++++++++++ .../Contents/Resources/alacritty.icns | Bin 0 -> 66619 bytes 3 files changed, 77 insertions(+) create mode 100644 Makefile create mode 100644 assets/osx/Alacritty.app/Contents/Info.plist create mode 100644 assets/osx/Alacritty.app/Contents/Resources/alacritty.icns diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..6eb4d521 --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +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_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) + +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 +$(TARGET): + @echo "Please build '$@' with 'cargo build --release'" + +app: | $(APP_NAME) ## Clone Alacritty.app template and mount binary +$(APP_NAME): $(TARGET) $(APP_TEMPLATE) + @mkdir -p $(APP_DIR) + @cp -R $(APP_TEMPLATE) $(APP_DIR) + @cp $< $(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)" + +.PHONY: app binary clean dmg + +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..acf636e8 --- /dev/null +++ b/assets/osx/Alacritty.app/Contents/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDisplayName + Alacritty + CFBundleExecutable + alacritty + + + CFBundleName + Alacritty + CFBundleIconFile + alacritty.icns + CFBundleShortVersionString + 0.1.0 + CFBundleVersion + 0.1.0 + CFBundleDevelopmentRegion + en + CFBundlePackageType + APPL + CFBundleInfoDictionaryVersion + 6.0 + NSHighResolutionCapable + + NSMainNibFile + + NSSupportsAutomaticGraphicsSwitching + + + diff --git a/assets/osx/Alacritty.app/Contents/Resources/alacritty.icns b/assets/osx/Alacritty.app/Contents/Resources/alacritty.icns new file mode 100644 index 00000000..bdbc0ca1 Binary files /dev/null and b/assets/osx/Alacritty.app/Contents/Resources/alacritty.icns differ -- cgit From 0a6ffaab5f3d87f5df280b63d2b76910e047fd80 Mon Sep 17 00:00:00 2001 From: Petter Uvesten Date: Thu, 12 Jan 2017 15:42:15 +0100 Subject: Updated Makefile to put binary in subdir --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6eb4d521..792fbb0f 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,12 @@ TARGET = alacritty APP_NAME = Alacritty.app ASSETS_DIR = assets RELEASE_DIR = target/release +BINARY_FILE = $(RELEASE_DIR)/$(TARGET) APP_TEMPLATE = $(ASSETS_DIR)/osx/$(APP_NAME) APP_DIR = $(RELEASE_DIR)/osx APP_BINARY_DIR = $(APP_DIR)/$(APP_NAME)/Contents/MacOS + DMG_NAME = Alacritty.dmg DMG_DIR = $(RELEASE_DIR)/osx @@ -26,7 +28,8 @@ app: | $(APP_NAME) ## Clone Alacritty.app template and mount binary $(APP_NAME): $(TARGET) $(APP_TEMPLATE) @mkdir -p $(APP_DIR) @cp -R $(APP_TEMPLATE) $(APP_DIR) - @cp $< $(APP_BINARY_DIR) + @mkdir $(APP_BINARY_DIR) + @cp $(BINARY_FILE) $(APP_BINARY_DIR) @echo "$@ created in $(APP_DIR)" dmg: | $(DMG_NAME) ## Pack Alacritty.app into .dmg -- cgit From dc72b1324fbd34fcb3b3bd74d479af534007bd4b Mon Sep 17 00:00:00 2001 From: Semyon Pisarev Date: Fri, 13 Jan 2017 10:25:02 +0300 Subject: Add install target --- Makefile | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 792fbb0f..b4bc91d0 100644 --- a/Makefile +++ b/Makefile @@ -3,34 +3,33 @@ TARGET = alacritty APP_NAME = Alacritty.app ASSETS_DIR = assets RELEASE_DIR = target/release -BINARY_FILE = $(RELEASE_DIR)/$(TARGET) 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 +binary: | $(TARGET) ## Build release binary with cargo $(TARGET): - @echo "Please build '$@' with 'cargo build --release'" + cargo build --release app: | $(APP_NAME) ## Clone Alacritty.app template and mount binary $(APP_NAME): $(TARGET) $(APP_TEMPLATE) @mkdir -p $(APP_DIR) @cp -R $(APP_TEMPLATE) $(APP_DIR) - @mkdir $(APP_BINARY_DIR) - @cp $(BINARY_FILE) $(APP_BINARY_DIR) - @echo "$@ created in $(APP_DIR)" + @cp $(APP_BINARY) $(APP_BINARY_DIR) + @echo "Created '$@' in '$(APP_DIR)'" dmg: | $(DMG_NAME) ## Pack Alacritty.app into .dmg $(DMG_NAME): $(APP_NAME) @@ -40,9 +39,12 @@ $(DMG_NAME): $(APP_NAME) -fs HFS+ \ -srcfolder $(APP_DIR) \ -ov -format UDZO - @echo "$@ packed in $(APP_DIR)" + @echo "Packed '$@' in '$(APP_DIR)'" + +install: $(DMG_NAME) ## Mount disk image + @open $(DMG_DIR)/$(DMG_NAME) -.PHONY: app binary clean dmg +.PHONY: app binary clean dmg install clean: ## Remove all artifacts -rm -rf $(APP_DIR) -- cgit From 2f0e31888f6d1d347fe5ffb455eb6aa2ad1569c3 Mon Sep 17 00:00:00 2001 From: Semyon Pisarev Date: Sun, 15 Jan 2017 19:46:23 +0300 Subject: Add tiny wrapper to start from '$HOME' --- Makefile | 6 +++--- assets/osx/Alacritty.app/Contents/Info.plist | 2 +- assets/osx/Alacritty.app/Contents/MacOS/launcher | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100755 assets/osx/Alacritty.app/Contents/MacOS/launcher diff --git a/Makefile b/Makefile index b4bc91d0..4f4ca807 100644 --- a/Makefile +++ b/Makefile @@ -26,9 +26,9 @@ $(TARGET): app: | $(APP_NAME) ## Clone Alacritty.app template and mount binary $(APP_NAME): $(TARGET) $(APP_TEMPLATE) - @mkdir -p $(APP_DIR) - @cp -R $(APP_TEMPLATE) $(APP_DIR) - @cp $(APP_BINARY) $(APP_BINARY_DIR) + @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 diff --git a/assets/osx/Alacritty.app/Contents/Info.plist b/assets/osx/Alacritty.app/Contents/Info.plist index acf636e8..77053db1 100644 --- a/assets/osx/Alacritty.app/Contents/Info.plist +++ b/assets/osx/Alacritty.app/Contents/Info.plist @@ -5,7 +5,7 @@ CFBundleDisplayName Alacritty CFBundleExecutable - alacritty + launcher CFBundleName diff --git a/assets/osx/Alacritty.app/Contents/MacOS/launcher b/assets/osx/Alacritty.app/Contents/MacOS/launcher new file mode 100755 index 00000000..707c3205 --- /dev/null +++ b/assets/osx/Alacritty.app/Contents/MacOS/launcher @@ -0,0 +1,6 @@ +#!/bin/bash + +BIN_DIR=$(dirname $0) + +cd "$HOME" +exec "$BIN_DIR/alacritty" "$@" -- cgit From 6f5c2552c89aeca226b95153621fa299354c374b Mon Sep 17 00:00:00 2001 From: Semyon Pisarev Date: Thu, 26 Jan 2017 16:48:21 +0300 Subject: Add LSEnvironment --- assets/osx/Alacritty.app/Contents/Info.plist | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/assets/osx/Alacritty.app/Contents/Info.plist b/assets/osx/Alacritty.app/Contents/Info.plist index 77053db1..8539bb96 100644 --- a/assets/osx/Alacritty.app/Contents/Info.plist +++ b/assets/osx/Alacritty.app/Contents/Info.plist @@ -28,5 +28,12 @@ NSSupportsAutomaticGraphicsSwitching + LSEnvironment + + HOME + $HOME + PATH + $PATH + -- cgit From e63a52d4dbaf5e53eb578d3839908ae1199adfcf Mon Sep 17 00:00:00 2001 From: Semyon Pisarev Date: Tue, 7 Feb 2017 15:50:38 +0300 Subject: Fix launcher script --- assets/osx/Alacritty.app/Contents/MacOS/launcher | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/osx/Alacritty.app/Contents/MacOS/launcher b/assets/osx/Alacritty.app/Contents/MacOS/launcher index 707c3205..0c055b61 100755 --- a/assets/osx/Alacritty.app/Contents/MacOS/launcher +++ b/assets/osx/Alacritty.app/Contents/MacOS/launcher @@ -3,4 +3,4 @@ BIN_DIR=$(dirname $0) cd "$HOME" -exec "$BIN_DIR/alacritty" "$@" +exec "$BIN_DIR/alacritty" -- cgit From 018beee8b65e2c69f0145d33dc7dc50db5aac4cf Mon Sep 17 00:00:00 2001 From: Bryce Fisher-Fleig Date: Mon, 6 Mar 2017 10:26:17 -0800 Subject: Changes recommended by @mondras --- assets/osx/Alacritty.app/Contents/MacOS/launcher | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/osx/Alacritty.app/Contents/MacOS/launcher b/assets/osx/Alacritty.app/Contents/MacOS/launcher index 0c055b61..be2ee7f8 100755 --- a/assets/osx/Alacritty.app/Contents/MacOS/launcher +++ b/assets/osx/Alacritty.app/Contents/MacOS/launcher @@ -1,6 +1,6 @@ #!/bin/bash -BIN_DIR=$(dirname $0) +BIN_DIR=$(cd "$(dirname "$0")"; pwd) cd "$HOME" exec "$BIN_DIR/alacritty" -- cgit From 86b070814388081fa76efc4ee9d7de3437445ef3 Mon Sep 17 00:00:00 2001 From: Bryce Fisher-Fleig Date: Mon, 6 Mar 2017 11:47:27 -0800 Subject: Remove LSEnvironment from info.plist This seems to have broken the app by triggering a 'LSOpenWithUrls' error. However, I suspect this is why the path is not passed into the alacritty shell properly. --- assets/osx/Alacritty.app/Contents/Info.plist | 7 ------- 1 file changed, 7 deletions(-) diff --git a/assets/osx/Alacritty.app/Contents/Info.plist b/assets/osx/Alacritty.app/Contents/Info.plist index 8539bb96..77053db1 100644 --- a/assets/osx/Alacritty.app/Contents/Info.plist +++ b/assets/osx/Alacritty.app/Contents/Info.plist @@ -28,12 +28,5 @@ NSSupportsAutomaticGraphicsSwitching - LSEnvironment - - HOME - $HOME - PATH - $PATH - -- cgit From 8445c761f01c3b9d618a4c7bf7f55c427dfc4aa8 Mon Sep 17 00:00:00 2001 From: Bryce Fisher-Fleig Date: Tue, 7 Mar 2017 09:09:43 -0800 Subject: Setup locale properly in new shell (thanks @casimir) --- assets/osx/Alacritty.app/Contents/MacOS/launcher | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/assets/osx/Alacritty.app/Contents/MacOS/launcher b/assets/osx/Alacritty.app/Contents/MacOS/launcher index be2ee7f8..d3c10724 100755 --- a/assets/osx/Alacritty.app/Contents/MacOS/launcher +++ b/assets/osx/Alacritty.app/Contents/MacOS/launcher @@ -1,6 +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" -- cgit