From 329e7e1d9c1ba13b19043785e3db0599ab26fd6f Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Thu, 15 Sep 2016 14:52:56 +0100 Subject: [PATCH 1/5] Update Mac packaging to work without platypus --- contrib/mac/app/Makefile | 46 +++++++++++-------- contrib/mac/app/README | 7 --- contrib/mac/app/README.md | 11 +++++ .../mac/app/run-install-name-tool-change.sh | 26 ----------- contrib/mac/app/script | 9 ---- contrib/mac/app/startup.applescript | 5 ++ 6 files changed, 43 insertions(+), 61 deletions(-) delete mode 100644 contrib/mac/app/README create mode 100644 contrib/mac/app/README.md delete mode 100755 contrib/mac/app/run-install-name-tool-change.sh delete mode 100755 contrib/mac/app/script create mode 100644 contrib/mac/app/startup.applescript diff --git a/contrib/mac/app/Makefile b/contrib/mac/app/Makefile index 52adebdaa873d..2f71fd787e118 100644 --- a/contrib/mac/app/Makefile +++ b/contrib/mac/app/Makefile @@ -11,37 +11,45 @@ ifeq ($(JULIA_PKGDIR),) endif # X.Y.Z or X.Y.Z-hash -DMG_VERSION_SUFFIX:=$(shell [ $$(git describe --tags --exact-match 2>/dev/null) ] && echo $(JULIA_VERSION) || echo $(JULIA_VERSION)-$(JULIA_COMMIT)) +JULIA_VERSION_OPT_COMMIT:=$(shell [ $$(git describe --tags --exact-match 2>/dev/null) ] && echo $(JULIA_VERSION) || echo $(JULIA_VERSION)-$(JULIA_COMMIT)) # X.Y -APP_VERSION_SUFFIX:=$(shell echo $(JULIA_VERSION) | grep -o '^[0-9]\+.[0-9]\+') +JULIA_VERSION_MAJOR_MINOR:=$(shell echo $(JULIA_VERSION) | grep -o '^[0-9]\+.[0-9]\+') -DMG_NAME:=Julia-$(DMG_VERSION_SUFFIX).dmg -APP_NAME:=Julia-$(APP_VERSION_SUFFIX).app -VOL_NAME:=Julia-$(DMG_VERSION_SUFFIX) +DMG_NAME:=Julia-$(JULIA_VERSION_OPT_COMMIT).dmg +APP_NAME:=Julia-$(JULIA_VERSION_MAJOR_MINOR).app +VOL_NAME:=Julia-$(JULIA_VERSION_OPT_COMMIT) all: clean $(DMG_NAME) $(DMG_NAME): dmg/$(APP_NAME) -cp -f julia.icns dmg/.VolumeIcon.icns -ln -fs /Applications ./dmg/Applications - -chmod 755 ./dmg/$(APP_NAME)/Contents/MacOS/Julia + -chmod 755 $&1>/dev/null < Date: Thu, 15 Sep 2016 15:06:08 +0100 Subject: [PATCH 2/5] include fix for #14427 --- contrib/mac/app/startup.applescript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/mac/app/startup.applescript b/contrib/mac/app/startup.applescript index 1c5eca615be2d..f02830a3902dc 100644 --- a/contrib/mac/app/startup.applescript +++ b/contrib/mac/app/startup.applescript @@ -1,5 +1,5 @@ set RootPath to POSIX path of (path to me) -tell application "Terminal" +tell application id "com.apple.terminal" do script ("exec '" & RootPath & "Contents/Resources/julia/bin/julia'") activate end tell From 399710ea7dab478ffe85e3e898e8b6a85e45740e Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Thu, 15 Sep 2016 15:32:46 +0100 Subject: [PATCH 3/5] expand README --- contrib/mac/app/README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/contrib/mac/app/README.md b/contrib/mac/app/README.md index 85d3c266e2bb4..501754312ab9e 100644 --- a/contrib/mac/app/README.md +++ b/contrib/mac/app/README.md @@ -1,11 +1,16 @@ Julia OS X packaging ==================== -This builds the Julia OS X application bundle (.app folder), and stores it in a disk image (.dmg file). +This builds the Julia OS X application bundle (.app folder), and stores it in a disk image +(.dmg file). -Run `make` to build these files. +The application bundle is actually just a bundled applet which opens Terminal.app and +executes the julia binary (which opens the REPL). All the Julia binary files and their +dependencies are bundled inside this. + +Run `make` to build. Other files in this directory -* `startup.applescript` is compiled to an applet which launches Julia in Terminal.app. +* `startup.applescript` is the script which is compiled to the applet. * `julia.icns` is the Julia icon file. From 55fa673954403caf5de14e8e5e026f6ad4377054 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 16 Sep 2016 10:40:22 +0100 Subject: [PATCH 4/5] remove use of sudo from OS X app makefile --- contrib/mac/app/Makefile | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/contrib/mac/app/Makefile b/contrib/mac/app/Makefile index 2f71fd787e118..a0edaab26a110 100644 --- a/contrib/mac/app/Makefile +++ b/contrib/mac/app/Makefile @@ -5,16 +5,12 @@ JULIAHOME := $(abspath ../../..) include ../../../Make.inc -JULIA_PKGDIR:=$(shell echo $$JULIA_PKGDIR) -ifeq ($(JULIA_PKGDIR),) - JULIA_PKGDIR:=$(shell echo ~)/.julia -endif - # X.Y.Z or X.Y.Z-hash JULIA_VERSION_OPT_COMMIT:=$(shell [ $$(git describe --tags --exact-match 2>/dev/null) ] && echo $(JULIA_VERSION) || echo $(JULIA_VERSION)-$(JULIA_COMMIT)) # X.Y JULIA_VERSION_MAJOR_MINOR:=$(shell echo $(JULIA_VERSION) | grep -o '^[0-9]\+.[0-9]\+') +JULIA_VERSION_MAJOR_MINOR_PATCH:=$(shell echo $(JULIA_VERSION) | grep -o '^[0-9]\+.[0-9]\+.[0-9]\+') DMG_NAME:=Julia-$(JULIA_VERSION_OPT_COMMIT).dmg APP_NAME:=Julia-$(JULIA_VERSION_MAJOR_MINOR).app @@ -22,14 +18,16 @@ VOL_NAME:=Julia-$(JULIA_VERSION_OPT_COMMIT) all: clean $(DMG_NAME) -$(DMG_NAME): dmg/$(APP_NAME) - -cp -f julia.icns dmg/.VolumeIcon.icns - -ln -fs /Applications ./dmg/Applications - -chmod 755 $ /dev/null | awk '{print $$3}') clean: +ifneq ($(filter root,$(ROOTFILES)),) @echo "We have to use sudo here to clean out folders owned by root. You may be asked for your password" - sudo rm -fr dmg *.dmg + sudo rm -rf dmg *.dmg +else + rm -rf dmg *.dmg +endif .PHONY: clean all From aeadb11ecf37b993dea87986b5df61478dfda763 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Fri, 16 Sep 2016 12:10:14 +0100 Subject: [PATCH 5/5] add recommended Info.plist keys --- contrib/mac/app/Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/contrib/mac/app/Makefile b/contrib/mac/app/Makefile index a0edaab26a110..dffb5a7f5efa9 100644 --- a/contrib/mac/app/Makefile +++ b/contrib/mac/app/Makefile @@ -16,6 +16,10 @@ DMG_NAME:=Julia-$(JULIA_VERSION_OPT_COMMIT).dmg APP_NAME:=Julia-$(JULIA_VERSION_MAJOR_MINOR).app VOL_NAME:=Julia-$(JULIA_VERSION_OPT_COMMIT) +APP_ID:=org.julialang.launcherapp +APP_COPYRIGHT:=© 2016 The Julia Project + + all: clean $(DMG_NAME) $(DMG_NAME): dmg/$(APP_NAME) dmg/.VolumeIcon.icns dmg/Applications @@ -34,18 +38,19 @@ dmg/$(APP_NAME): startup.applescript julia.icns osacompile -o $@ startup.applescript rm $@/Contents/Resources/applet.icns cp julia.icns $@/Contents/Resources/ - plutil -replace CFBundleName -string "Julia" $@/Contents/Info.plist - plutil -replace CFBundleIconFile -string "julia.icns" $@/Contents/Info.plist - plutil -insert CFBundleVersion -string "$(JULIA_VERSION_OPT_COMMIT)" $@/Contents/Info.plist + plutil -replace CFBundleDevelopmentRegion -string "en" $@/Contents/Info.plist + plutil -insert CFBundleDisplayName -string "Julia" $@/Contents/Info.plist + plutil -replace CFBundleIconFile -string "julia.icns" $@/Contents/Info.plist + plutil -insert CFBundleIdentifier -string "$(APP_ID)" $@/Contents/Info.plist + plutil -replace CFBundleName -string "Julia" $@/Contents/Info.plist plutil -insert CFBundleShortVersionString -string "$(JULIA_VERSION_MAJOR_MINOR_PATCH)" $@/Contents/Info.plist - plutil -insert CFBundleIdentifier -string "org.julialang.julia" $@/Contents/Info.plist - plutil -insert NSHumanReadableCopyright -string "© 2016 The Julia Project" $@/Contents/Info.plist + plutil -insert CFBundleVersion -string "$(JULIA_VERSION_OPT_COMMIT)" $@/Contents/Info.plist + plutil -insert NSHumanReadableCopyright -string "$(APP_COPYRIGHT)" $@/Contents/Info.plist -mkdir -p $@/Contents/Resources/julia make -C $(JULIAHOME) binary-dist tar zxf $(JULIAHOME)/julia-*.tar.gz -C $@/Contents/Resources/julia --strip-components 1 -codesign -s "AFB379C0B4CBD9DB9A762797FC2AB5460A2B0DBE" --deep $@ - ROOTFILES := $(shell ls -ld dmg/*.app *.dmg 2> /dev/null | awk '{print $$3}') clean: ifneq ($(filter root,$(ROOTFILES)),)