Skip to content

Commit e665592

Browse files
authored
Merge pull request #18522 from JuliaLang/sb/no-monotremes
Update Mac packaging to work without platypus
2 parents de0833f + aeadb11 commit e665592

File tree

6 files changed

+66
-71
lines changed

6 files changed

+66
-71
lines changed

contrib/mac/app/Makefile

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,59 @@
55
JULIAHOME := $(abspath ../../..)
66
include ../../../Make.inc
77

8-
JULIA_PKGDIR:=$(shell echo $$JULIA_PKGDIR)
9-
ifeq ($(JULIA_PKGDIR),)
10-
JULIA_PKGDIR:=$(shell echo ~)/.julia
11-
endif
12-
138
# X.Y.Z or X.Y.Z-hash
14-
DMG_VERSION_SUFFIX:=$(shell [ $$(git describe --tags --exact-match 2>/dev/null) ] && echo $(JULIA_VERSION) || echo $(JULIA_VERSION)-$(JULIA_COMMIT))
9+
JULIA_VERSION_OPT_COMMIT:=$(shell [ $$(git describe --tags --exact-match 2>/dev/null) ] && echo $(JULIA_VERSION) || echo $(JULIA_VERSION)-$(JULIA_COMMIT))
1510

1611
# X.Y
17-
APP_VERSION_SUFFIX:=$(shell echo $(JULIA_VERSION) | grep -o '^[0-9]\+.[0-9]\+')
12+
JULIA_VERSION_MAJOR_MINOR:=$(shell echo $(JULIA_VERSION) | grep -o '^[0-9]\+.[0-9]\+')
13+
JULIA_VERSION_MAJOR_MINOR_PATCH:=$(shell echo $(JULIA_VERSION) | grep -o '^[0-9]\+.[0-9]\+.[0-9]\+')
1814

19-
DMG_NAME:=Julia-$(DMG_VERSION_SUFFIX).dmg
20-
APP_NAME:=Julia-$(APP_VERSION_SUFFIX).app
21-
VOL_NAME:=Julia-$(DMG_VERSION_SUFFIX)
15+
DMG_NAME:=Julia-$(JULIA_VERSION_OPT_COMMIT).dmg
16+
APP_NAME:=Julia-$(JULIA_VERSION_MAJOR_MINOR).app
17+
VOL_NAME:=Julia-$(JULIA_VERSION_OPT_COMMIT)
2218

23-
all: clean $(DMG_NAME)
19+
APP_ID:=org.julialang.launcherapp
20+
APP_COPYRIGHT:=© 2016 The Julia Project
2421

25-
$(DMG_NAME): dmg/$(APP_NAME)
26-
-cp -f julia.icns dmg/.VolumeIcon.icns
27-
-ln -fs /Applications ./dmg/Applications
28-
-chmod 755 ./dmg/$(APP_NAME)/Contents/MacOS/Julia
29-
@echo "We're going to chown the .app file to root:admin now, which requires sudo. You may be asked for your password:"
30-
sudo chown -R root:admin ./dmg/$(APP_NAME)
31-
sudo hdiutil create $(DMG_NAME) -size 500m -ov -volname "$(VOL_NAME)" -imagekey zlib-level=9 -srcfolder dmg
32-
33-
dmg/$(APP_NAME): julia.icns
34-
make -C ../../.. binary-dist
35-
tar zxf ../../../julia-*.tar.gz
36-
mv julia-* julia
37-
-mkdir -p ./julia/libexec ./julia/share
38-
rm -f julia/lib/*.{a,la}
39-
-mkdir dmg
40-
platypus -a Julia -p /bin/bash -V $(JULIA_VERSION) -R -u "The Julia Project" -i julia.icns -Q julia.icns -o "None" -I org.julialang.julia -x -f julia script ./dmg/$(APP_NAME)
41-
-codesign -s "AFB379C0B4CBD9DB9A762797FC2AB5460A2B0DBE" --deep ./dmg/$(APP_NAME)
4222

23+
all: clean $(DMG_NAME)
24+
25+
$(DMG_NAME): dmg/$(APP_NAME) dmg/.VolumeIcon.icns dmg/Applications
26+
hdiutil create $@ -size 500m -ov -volname "$(VOL_NAME)" -imagekey zlib-level=9 -srcfolder dmg
27+
28+
dmg/.VolumeIcon.icns: julia.icns
29+
-mkdir -p dmg
30+
cp -f julia.icns $@
31+
32+
dmg/Applications:
33+
-mkdir -p dmg
34+
ln -fs /Applications $@
35+
36+
dmg/$(APP_NAME): startup.applescript julia.icns
37+
-mkdir -p dmg
38+
osacompile -o $@ startup.applescript
39+
rm $@/Contents/Resources/applet.icns
40+
cp julia.icns $@/Contents/Resources/
41+
plutil -replace CFBundleDevelopmentRegion -string "en" $@/Contents/Info.plist
42+
plutil -insert CFBundleDisplayName -string "Julia" $@/Contents/Info.plist
43+
plutil -replace CFBundleIconFile -string "julia.icns" $@/Contents/Info.plist
44+
plutil -insert CFBundleIdentifier -string "$(APP_ID)" $@/Contents/Info.plist
45+
plutil -replace CFBundleName -string "Julia" $@/Contents/Info.plist
46+
plutil -insert CFBundleShortVersionString -string "$(JULIA_VERSION_MAJOR_MINOR_PATCH)" $@/Contents/Info.plist
47+
plutil -insert CFBundleVersion -string "$(JULIA_VERSION_OPT_COMMIT)" $@/Contents/Info.plist
48+
plutil -insert NSHumanReadableCopyright -string "$(APP_COPYRIGHT)" $@/Contents/Info.plist
49+
-mkdir -p $@/Contents/Resources/julia
50+
make -C $(JULIAHOME) binary-dist
51+
tar zxf $(JULIAHOME)/julia-*.tar.gz -C $@/Contents/Resources/julia --strip-components 1
52+
-codesign -s "AFB379C0B4CBD9DB9A762797FC2AB5460A2B0DBE" --deep $@
53+
54+
ROOTFILES := $(shell ls -ld dmg/*.app *.dmg 2> /dev/null | awk '{print $$3}')
4355
clean:
56+
ifneq ($(filter root,$(ROOTFILES)),)
4457
@echo "We have to use sudo here to clean out folders owned by root. You may be asked for your password"
45-
sudo rm -fr julia dmg *.dmg
58+
sudo rm -rf dmg *.dmg
59+
else
60+
rm -rf dmg *.dmg
61+
endif
4662

4763
.PHONY: clean all

contrib/mac/app/README

Lines changed: 0 additions & 7 deletions
This file was deleted.

contrib/mac/app/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Julia OS X packaging
2+
====================
3+
4+
This builds the Julia OS X application bundle (.app folder), and stores it in a disk image
5+
(.dmg file).
6+
7+
The application bundle is actually just a bundled applet which opens Terminal.app and
8+
executes the julia binary (which opens the REPL). All the Julia binary files and their
9+
dependencies are bundled inside this.
10+
11+
Run `make` to build.
12+
13+
Other files in this directory
14+
15+
* `startup.applescript` is the script which is compiled to the applet.
16+
* `julia.icns` is the Julia icon file.

contrib/mac/app/run-install-name-tool-change.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

contrib/mac/app/script

Lines changed: 0 additions & 9 deletions
This file was deleted.

contrib/mac/app/startup.applescript

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set RootPath to POSIX path of (path to me)
2+
tell application id "com.apple.terminal"
3+
do script ("exec '" & RootPath & "Contents/Resources/julia/bin/julia'")
4+
activate
5+
end tell

0 commit comments

Comments
 (0)