Skip to content

Commit 669a055

Browse files
committed
mk: Make OS X .pkg for all arches
1 parent 4176cf4 commit 669a055

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

mk/dist.mk

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ PKG_NAME := rust
2525
PKG_DIR = $(PKG_NAME)-$(CFG_RELEASE)
2626
PKG_TAR = dist/$(PKG_DIR).tar.gz
2727

28-
ifeq ($(CFG_OSTYPE), apple-darwin)
29-
PKG_OSX = dist/$(PKG_DIR).pkg
30-
endif
31-
3228
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt
3329

3430
PKG_FILES := \
@@ -128,22 +124,27 @@ dist-win: $(PKG_EXE)
128124

129125
ifeq ($(CFG_OSTYPE), apple-darwin)
130126

131-
dist-prepare-osx: PREPARE_HOST=$(CFG_BUILD)
132-
dist-prepare-osx: PREPARE_TARGETS=$(CFG_BUILD)
133-
dist-prepare-osx: PREPARE_DEST_DIR=tmp/dist/pkgroot
134-
dist-prepare-osx: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
135-
dist-prepare-osx: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
136-
dist-prepare-osx: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
137-
dist-prepare-osx: PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
138-
dist-prepare-osx: prepare-base
139-
140-
$(PKG_OSX): Distribution.xml LICENSE.txt dist-prepare-osx
141-
@$(call E, making OS X pkg)
142-
$(Q)pkgbuild --identifier org.rust-lang.rust --root tmp/dist/pkgroot rust.pkg
143-
$(Q)productbuild --distribution Distribution.xml --resources . $(PKG_OSX)
127+
define DEF_OSX_PKG
128+
dist-prepare-osx-$(1): PREPARE_HOST=$(1)
129+
dist-prepare-osx-$(1): PREPARE_TARGETS=$(1)
130+
dist-prepare-osx-$(1): PREPARE_DEST_DIR=tmp/dist/pkgroot-$(1)
131+
dist-prepare-osx-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
132+
dist-prepare-osx-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
133+
dist-prepare-osx-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
134+
dist-prepare-osx-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
135+
dist-prepare-osx-$(1): prepare-base
136+
137+
dist/$(PKG_DIR)-$(1).pkg: $(S)src/etc/pkg/Distribution.xml LICENSE.txt dist-prepare-osx-$(1)
138+
@$$(call E, making OS X pkg)
139+
$(Q)pkgbuild --identifier org.rust-lang.rust --root tmp/dist/pkgroot-$(1) rust.pkg
140+
$(Q)productbuild --distribution $(S)src/etc/pkg/Distribution.xml --resources . dist/$(PKG_DIR)-$(1).pkg
144141
$(Q)rm -rf tmp rust.pkg
145142

146-
dist-osx: $(PKG_OSX)
143+
endef
144+
145+
$(foreach host,$(CFG_HOST),$(eval $(call DEF_OSX_PKG,$(host))))
146+
147+
dist-osx: $(foreach host,$(CFG_HOST),dist/$(PKG_DIR)-$(host).pkg)
147148

148149
endif
149150

0 commit comments

Comments
 (0)