commit:     b99ef2bd0b4356c20bcfa97074d8db5771bd2b5f
Author:     Doug Goldstein <cardoe <AT> gentoo <DOT> org>
AuthorDate: Tue Nov  8 18:08:44 2016 +0000
Commit:     Doug Goldstein <cardoe <AT> gentoo <DOT> org>
CommitDate: Tue Nov  8 18:43:47 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b99ef2bd

dev-lang/rust: simplify unpack

Instead of unpacking the tarball of the stage0 compiler and then
patching the fetch script to not actually reach out to the internet, use
the built in mechanism for supplying a stage0 compiler. This improves on
d63d593dfdc5fb7dd1256663daac7b978aa892af and should make future bumps
easier. Drops the now unnecessary patch as well.

Signed-off-by: Doug Goldstein <cardoe <AT> gentoo.org>

 .../rust-1.12.0-disable-fetching-stage0.patch      | 36 ----------------------
 dev-lang/rust/rust-1.11.0.ebuild                   | 13 +++-----
 dev-lang/rust/rust-1.12.0.ebuild                   | 15 +++------
 dev-lang/rust/rust-1.12.1.ebuild                   | 15 +++------
 4 files changed, 15 insertions(+), 64 deletions(-)

diff --git a/dev-lang/rust/files/rust-1.12.0-disable-fetching-stage0.patch 
b/dev-lang/rust/files/rust-1.12.0-disable-fetching-stage0.patch
deleted file mode 100644
index 14d0b32..00000000
--- a/dev-lang/rust/files/rust-1.12.0-disable-fetching-stage0.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-From b6a4c78ef7b4bc6c32145f27e8a679d5baf36f90 Mon Sep 17 00:00:00 2001
-From: Doug Goldstein <car...@cardoe.com>
-Date: Mon, 24 Oct 2016 00:01:37 -0500
-Subject: [PATCH] disable fetching stage0 and use whats there
-
-In Gentoo and Yocto alike we do not allow build environments network
-access and as a result the package manager is responsible for fetching
-down all the files necessary. In both they are configured to fetch down
-the compiler and unpack it and place the stage0 tarball inside of the
-'dl' directory for the build system to use. Unfortunately it
-unconditionally attempts to fetch down the files and ignores what is
-already available so this avoids that behavior and just uses what's in
-the 'dl' directory.
-
-Upstream-Status: Not upstreamable
-Signed-off-by: Doug Goldstein <car...@cardoe.com>
----
- src/etc/get-stage0.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/etc/get-stage0.py b/src/etc/get-stage0.py
-index 127251c..2889c07 100644
---- a/src/etc/get-stage0.py
-+++ b/src/etc/get-stage0.py
-@@ -31,7 +31,7 @@ def main(triple):
-     filename = 'rustc-{}-{}.tar.gz'.format(channel, triple)
-     url = 'https://static.rust-lang.org/dist/{}/{}'.format(date, filename)
-     dst = dl_dir + '/' + filename
--    bootstrap.get(url, dst)
-+    #bootstrap.get(url, dst)
- 
-     stage0_dst = triple + '/stage0'
-     if os.path.exists(stage0_dst):
--- 
-2.7.3
-

diff --git a/dev-lang/rust/rust-1.11.0.ebuild b/dev-lang/rust/rust-1.11.0.ebuild
index ca00a6b..4aede58 100644
--- a/dev-lang/rust/rust-1.11.0.ebuild
+++ b/dev-lang/rust/rust-1.11.0.ebuild
@@ -55,14 +55,6 @@ PDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425"
 
 S="${WORKDIR}/${MY_P}"
 
-src_unpack() {
-       unpack "rustc-${PV}-src.tar.gz" || die
-       mkdir "${MY_P}/dl" || die
-       local stagename="RUST_STAGE0_${ARCH}"
-       local stage0="${!stagename}"
-       cp "${DISTDIR}/${stage0}.tar.gz" "${MY_P}/dl/" || die "cp stage0"
-}
-
 src_prepare() {
        find mk -name '*.mk' -exec \
                 sed -i -e "s/-Werror / /g" {} \; || die
@@ -73,6 +65,9 @@ src_prepare() {
 src_configure() {
        export CFG_DISABLE_LDCONFIG="notempty"
 
+       local stagename="RUST_STAGE0_${ARCH}"
+       local stage0="${!stagename}"
+
        "${ECONF_SOURCE:-.}"/configure \
                --prefix="${EPREFIX}/usr" \
                --libdir="${EPREFIX}/usr/$(get_libdir)/${P}" \
@@ -83,6 +78,8 @@ src_configure() {
                --default-ar=$(tc-getBUILD_AR) \
                --python=${EPYTHON} \
                --disable-rpath \
+               --enable-local-rust \
+               --local-rust-root="${WORKDIR}/${stage0}/rustc" \
                $(use_enable clang) \
                $(use_enable debug) \
                $(use_enable debug llvm-assertions) \

diff --git a/dev-lang/rust/rust-1.12.0.ebuild b/dev-lang/rust/rust-1.12.0.ebuild
index e608fbd..4aede58 100644
--- a/dev-lang/rust/rust-1.12.0.ebuild
+++ b/dev-lang/rust/rust-1.12.0.ebuild
@@ -55,16 +55,6 @@ PDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425"
 
 S="${WORKDIR}/${MY_P}"
 
-PATCHES=("${FILESDIR}/rust-1.12.0-disable-fetching-stage0.patch")
-
-src_unpack() {
-       unpack "rustc-${PV}-src.tar.gz" || die
-       mkdir "${MY_P}/dl" || die
-       local stagename="RUST_STAGE0_${ARCH}"
-       local stage0="${!stagename}"
-       cp "${DISTDIR}/${stage0}.tar.gz" "${MY_P}/dl/" || die "cp stage0"
-}
-
 src_prepare() {
        find mk -name '*.mk' -exec \
                 sed -i -e "s/-Werror / /g" {} \; || die
@@ -75,6 +65,9 @@ src_prepare() {
 src_configure() {
        export CFG_DISABLE_LDCONFIG="notempty"
 
+       local stagename="RUST_STAGE0_${ARCH}"
+       local stage0="${!stagename}"
+
        "${ECONF_SOURCE:-.}"/configure \
                --prefix="${EPREFIX}/usr" \
                --libdir="${EPREFIX}/usr/$(get_libdir)/${P}" \
@@ -85,6 +78,8 @@ src_configure() {
                --default-ar=$(tc-getBUILD_AR) \
                --python=${EPYTHON} \
                --disable-rpath \
+               --enable-local-rust \
+               --local-rust-root="${WORKDIR}/${stage0}/rustc" \
                $(use_enable clang) \
                $(use_enable debug) \
                $(use_enable debug llvm-assertions) \

diff --git a/dev-lang/rust/rust-1.12.1.ebuild b/dev-lang/rust/rust-1.12.1.ebuild
index 90e0e4f..d3c58dd 100644
--- a/dev-lang/rust/rust-1.12.1.ebuild
+++ b/dev-lang/rust/rust-1.12.1.ebuild
@@ -57,16 +57,6 @@ PDEPEND=">=app-eselect/eselect-rust-0.3_pre20150425
 
 S="${WORKDIR}/${MY_P}"
 
-PATCHES=("${FILESDIR}/rust-1.12.0-disable-fetching-stage0.patch")
-
-src_unpack() {
-       unpack "rustc-${PV}-src.tar.gz" || die
-       mkdir "${MY_P}/dl" || die
-       local stagename="RUST_STAGE0_${ARCH}"
-       local stage0="${!stagename}"
-       cp "${DISTDIR}/${stage0}.tar.gz" "${MY_P}/dl/" || die "cp stage0"
-}
-
 src_prepare() {
        find mk -name '*.mk' -exec \
                 sed -i -e "s/-Werror / /g" {} \; || die
@@ -77,6 +67,9 @@ src_prepare() {
 src_configure() {
        export CFG_DISABLE_LDCONFIG="notempty"
 
+       local stagename="RUST_STAGE0_${ARCH}"
+       local stage0="${!stagename}"
+
        "${ECONF_SOURCE:-.}"/configure \
                --prefix="${EPREFIX}/usr" \
                --libdir="${EPREFIX}/usr/$(get_libdir)/${P}" \
@@ -87,6 +80,8 @@ src_configure() {
                --default-ar=$(tc-getBUILD_AR) \
                --python=${EPYTHON} \
                --disable-rpath \
+               --enable-local-rust \
+               --local-rust-root="${WORKDIR}/${stage0}/rustc" \
                $(use_enable clang) \
                $(use_enable debug) \
                $(use_enable debug llvm-assertions) \

Reply via email to