Skip to content

Commit 02d186a

Browse files
committed
auto merge of #13185 : alexcrichton/rust/osx-pkg, r=brson
This performs a few touch-ups to the OSX installer: * A rust logo is shown during installation * The installation happens to /usr/local by default (instead of /) * A new welcome screen is shown that's slightly more relevant
2 parents 8610e4a + bec333c commit 02d186a

File tree

5 files changed

+35
-3
lines changed

5 files changed

+35
-3
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.h rust
66
*.rs rust
77
src/etc/pkg/rust-logo.ico binary
8+
src/etc/pkg/rust-logo.png binary
89
src/rt/msvc/* -whitespace
910
src/rt/vg/* -whitespace
1011
src/rt/jemalloc/**/* -whitespace

mk/dist.mk

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,27 @@ dist-prepare-osx-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
160160
dist-prepare-osx-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
161161
dist-prepare-osx-$(1): prepare-base-osx-$(1)
162162

163-
dist/$(PKG_NAME)-$(1).pkg: $(S)src/etc/pkg/Distribution.xml LICENSE.txt dist-prepare-osx-$(1)
163+
dist/$(PKG_NAME)-$(1).pkg: $(S)src/etc/pkg/Distribution.xml LICENSE.txt \
164+
dist-prepare-osx-$(1) \
165+
tmp/dist/pkgres-$(1)/LICENSE.txt \
166+
tmp/dist/pkgres-$(1)/welcome.rtf \
167+
tmp/dist/pkgres-$(1)/rust-logo.png
164168
@$$(call E, making OS X pkg)
165169
$(Q)pkgbuild --identifier org.rust-lang.rust --root tmp/dist/pkgroot-$(1) rust.pkg
166-
$(Q)productbuild --distribution $(S)src/etc/pkg/Distribution.xml --resources . dist/$(PKG_NAME)-$(1).pkg
170+
$(Q)productbuild --distribution $(S)src/etc/pkg/Distribution.xml \
171+
--resources tmp/dist/pkgres-$(1) dist/$(PKG_NAME)-$(1).pkg
167172
$(Q)rm -rf tmp rust.pkg
168173

174+
tmp/dist/pkgres-$(1)/LICENSE.txt: $(S)/LICENSE.txt
175+
@$$(call E,pkg resource LICENSE.txt)
176+
$(Q)mkdir -p $$(@D)
177+
$(Q)cp $$< $$@
178+
179+
tmp/dist/pkgres-$(1)/%: $(S)src/etc/pkg/%
180+
@$$(call E,pkg resource $$*)
181+
$(Q)mkdir -p $$(@D)
182+
$(Q)cp -r $$< $$@
183+
169184
endef
170185

171186
$(foreach host,$(CFG_HOST),$(eval $(call DEF_OSX_PKG,$(host))))

src/etc/pkg/Distribution.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@
1414
<line choice="org.rust-lang.rust"/>
1515
</line>
1616
</choices-outline>
17-
<choice id="default"/>
17+
<choice id="default"
18+
customLocation="usr/local"/>
1819
<choice id="org.rust-lang.rust" visible="false">
1920
<pkg-ref id="org.rust-lang.rust"/>
2021
</choice>
2122
<pkg-ref id="org.rust-lang.rust" version="0" onConclusion="none">rust.pkg</pkg-ref>
23+
<welcome file="welcome.rtf" mime-type="text/enriched"/>
24+
<background file="rust-logo.png" mime-type="image/png"
25+
alignment="bottomleft"/>
2226
</installer-gui-script>

src/etc/pkg/rust-logo.png

5.71 KB
Loading

src/etc/pkg/welcome.rtf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf190
2+
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
3+
{\colortbl;\red255\green255\blue255;}
4+
\margl1440\margr1440\vieww10800\viewh6300\viewkind0
5+
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural
6+
7+
\f0\fs28 \cf0 \
8+
\
9+
You will be guided through the steps necessary to\
10+
install this software.\
11+
\
12+
This will install Rust to /usr/local}

0 commit comments

Comments
 (0)