From 958118bfa6842a0dc45bbb458e25596f9339d394 Mon Sep 17 00:00:00 2001 From: Brian Leibig Date: Tue, 25 Feb 2014 08:47:58 -0800 Subject: [PATCH 1/2] Add new target 'make dist-osx' to create a .pkg installer for OS X --- mk/dist.mk | 34 +++++++++++++++++++++++++++++++++- src/etc/pkg/Distribution.xml | 22 ++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/etc/pkg/Distribution.xml diff --git a/mk/dist.mk b/mk/dist.mk index 1a4d7a278437f..0eb0365a59976 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -12,6 +12,10 @@ PKG_ICO = $(S)src/etc/pkg/rust-logo.ico PKG_EXE = $(PKG_DIR)-install.exe endif +ifeq ($(CFG_OSTYPE), apple-darwin) +PKG_OSX = $(PKG_DIR).pkg +endif + PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt PKG_FILES := \ @@ -41,10 +45,10 @@ PKG_FILES := \ UNROOTED_PKG_FILES := $(patsubst $(S)%,./%,$(PKG_FILES)) -ifdef CFG_ISCC LICENSE.txt: $(S)COPYRIGHT $(S)LICENSE-APACHE $(S)LICENSE-MIT cat $^ > $@ +ifdef CFG_ISCC %.iss: $(S)src/etc/pkg/%.iss cp $< $@ @@ -124,3 +128,31 @@ distcheck: $(PKG_TAR) @echo ----------------------------------------------- endif + +ifeq ($(CFG_OSTYPE), apple-darwin) + +dist-prepare-osx: PREPARE_HOST=$(CFG_BUILD) +dist-prepare-osx: PREPARE_TARGETS=$(CFG_BUILD) +dist-prepare-osx: PREPARE_DEST_DIR=pkgroot +dist-prepare-osx: PREPARE_STAGE=2 +dist-prepare-osx: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) +dist-prepare-osx: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) +dist-prepare-osx: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD) +dist-prepare-osx: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD) +dist-prepare-osx: prepare-base + +$(PKG_OSX): Distribution.xml LICENSE.txt dist-prepare-osx + @$(call E, making OS X pkg) + $(Q)pkgbuild --identifier org.rust-lang.rust --root pkgroot rust.pkg + $(Q)productbuild --distribution Distribution.xml --resources . $(PKG_OSX) + $(Q)rm -rf pkgroot rust.pkg + +dist-osx: $(PKG_OSX) + +distcheck-osx: $(PKG_OSX) + @echo + @echo ----------------------------------------------- + @echo $(PKG_OSX) ready for distribution + @echo ----------------------------------------------- + +endif diff --git a/src/etc/pkg/Distribution.xml b/src/etc/pkg/Distribution.xml new file mode 100644 index 0000000000000..9c2e5d6588433 --- /dev/null +++ b/src/etc/pkg/Distribution.xml @@ -0,0 +1,22 @@ + + + Rust + + + + + + + + + + + + + + + + + + rust.pkg + From 5338a53d58272af500d33ab760c2d13b18bfb8e0 Mon Sep 17 00:00:00 2001 From: Brian Leibig Date: Wed, 26 Feb 2014 08:59:58 -0800 Subject: [PATCH 2/2] Make OS X installer build from /tmp/dist/pkgroot, and have it be part of the 'make dist' target --- mk/dist.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mk/dist.mk b/mk/dist.mk index 0eb0365a59976..17afeaae37732 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -107,7 +107,7 @@ distcheck: dist else -dist: $(PKG_TAR) +dist: $(PKG_TAR) $(PKG_OSX) distcheck: $(PKG_TAR) $(Q)rm -Rf dist @@ -133,7 +133,7 @@ ifeq ($(CFG_OSTYPE), apple-darwin) dist-prepare-osx: PREPARE_HOST=$(CFG_BUILD) dist-prepare-osx: PREPARE_TARGETS=$(CFG_BUILD) -dist-prepare-osx: PREPARE_DEST_DIR=pkgroot +dist-prepare-osx: PREPARE_DEST_DIR=tmp/dist/pkgroot dist-prepare-osx: PREPARE_STAGE=2 dist-prepare-osx: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD) dist-prepare-osx: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD) @@ -143,9 +143,9 @@ dist-prepare-osx: prepare-base $(PKG_OSX): Distribution.xml LICENSE.txt dist-prepare-osx @$(call E, making OS X pkg) - $(Q)pkgbuild --identifier org.rust-lang.rust --root pkgroot rust.pkg + $(Q)pkgbuild --identifier org.rust-lang.rust --root tmp/dist/pkgroot rust.pkg $(Q)productbuild --distribution Distribution.xml --resources . $(PKG_OSX) - $(Q)rm -rf pkgroot rust.pkg + $(Q)rm -rf tmp rust.pkg dist-osx: $(PKG_OSX)