about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--mk/dist.mk34
-rw-r--r--src/etc/pkg/Distribution.xml22
2 files changed, 55 insertions, 1 deletions
diff --git a/mk/dist.mk b/mk/dist.mk
index 1a4d7a27843..0eb0365a599 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 00000000000..9c2e5d65884
--- /dev/null
+++ b/src/etc/pkg/Distribution.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<installer-gui-script minSpecVersion="2">
+    <title>Rust</title>
+    <license file="LICENSE.txt" mime-type="text/plain"/>
+    <pkg-ref id="org.rust-lang.rust"/>
+    <options customize="never" require-scripts="false" hostArchitectures="i386,x86_64"/>
+    <volume-check>
+        <allowed-os-versions>
+            <os-version min="10.7"/>
+        </allowed-os-versions>
+    </volume-check>
+    <choices-outline>
+        <line choice="default">
+            <line choice="org.rust-lang.rust"/>
+        </line>
+    </choices-outline>
+    <choice id="default"/>
+    <choice id="org.rust-lang.rust" visible="false">
+        <pkg-ref id="org.rust-lang.rust"/>
+    </choice>
+    <pkg-ref id="org.rust-lang.rust" version="0" onConclusion="none">rust.pkg</pkg-ref>
+</installer-gui-script>