diff --git a/.gitignore b/.gitignore index 0de8f57..7e89bb7 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,9 @@ /cargo-0.14.0.tar.gz /cargo-0.14.0-vendor.tar.xz /rust-installer-4f994850808a572e2cc8d43f968893c8e942e9bf.tar.gz +/cargo-8d6378421598cd5e0effc2216a3c5a4d9fc0f493.tar.gz +/cargo-0.15.0-vendor.tar.xz +/cargo-nightly-powerpc64le-unknown-linux-gnu.tar.gz +/cargo-nightly-powerpc64-unknown-linux-gnu.tar.gz +/cargo-nightly-s390x-unknown-linux-gnu.tar.gz +/cargo-0.15.0.tar.gz diff --git a/cargo-0.14.0-release-num.patch b/cargo-0.14.0-release-num.patch deleted file mode 100644 index 9c23495..0000000 --- a/cargo-0.14.0-release-num.patch +++ /dev/null @@ -1,22 +0,0 @@ -From e035d532bf93b597216fcd11c99f2b8b6ba6eac1 Mon Sep 17 00:00:00 2001 -From: Alex Crichton -Date: Fri, 4 Nov 2016 15:44:46 -0700 -Subject: [PATCH] Update makefile to 0.14.0 - ---- - Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile.in b/Makefile.in -index 98d5e91c8053..08dc61626ee1 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -1,4 +1,4 @@ --CFG_RELEASE_NUM=0.13.0 -+CFG_RELEASE_NUM=0.14.0 - CFG_RELEASE_LABEL= - - OPENSSL_VERS=1.0.2j --- -1.8.3.1 - diff --git a/cargo.spec b/cargo.spec index 4ada517..03553c4 100644 --- a/cargo.spec +++ b/cargo.spec @@ -1,15 +1,24 @@ +# Only x86_64 and i686 are Tier 1 platforms at this time. +# https://forge.rust-lang.org/platform-support.html +#global rust_arches x86_64 i686 armv7hl aarch64 ppc64 ppc64le s390x +%global rust_arches x86_64 i686 armv7hl aarch64 + # To bootstrap from scratch, set the date from src/snapshots.txt # e.g. 0.11.0 wants 2016-03-21 -%bcond_with bootstrap -%global bootstrap_date 2016-08-20 +%global bootstrap_date 2016-11-02 # (using a newer version than required to get vendor directories and more archs) +# Only the specified arches will use bootstrap binaries. +#global bootstrap_arches %%{rust_arches} +%global bootstrap_arches ppc64 ppc64le s390x + Name: cargo -Version: 0.14.0 -Release: 2%{?dist} +Version: 0.15.0 +Release: 1%{?dist} Summary: Rust's package manager and build tool License: ASL 2.0 or MIT URL: https://crates.io/ +ExclusiveArch: %{rust_arches} Source0: https://github.com/rust-lang/%{name}/archive/%{version}/%{name}-%{version}.tar.gz @@ -17,13 +26,42 @@ Source0: https://github.com/rust-lang/%{name}/archive/%{version}/%{name}- %global rust_installer 4f994850808a572e2cc8d43f968893c8e942e9bf Source1: https://github.com/rust-lang/rust-installer/archive/%{rust_installer}/rust-installer-%{rust_installer}.tar.gz -%if %with bootstrap -%global bootstrap_dist https://static.rust-lang.org/cargo-dist -%global bootstrap_base %{bootstrap_dist}/%{bootstrap_date}/%{name}-nightly -Source10: %{bootstrap_base}-x86_64-unknown-linux-gnu.tar.gz -Source11: %{bootstrap_base}-i686-unknown-linux-gnu.tar.gz -Source12: %{bootstrap_base}-armv7-unknown-linux-gnueabihf.tar.gz -Source13: %{bootstrap_base}-aarch64-unknown-linux-gnu.tar.gz +# Get the Rust triple for any arch. +%{lua: function rust_triple(arch) + local abi = "gnu" + if arch == "armv7hl" then + arch = "armv7" + abi = "gnueabihf" + elseif arch == "ppc64" then + arch = "powerpc64" + elseif arch == "ppc64le" then + arch = "powerpc64le" + end + return arch.."-unknown-linux-"..abi +end} + +%global rust_triple %{lua: print(rust_triple(rpm.expand("%{_target_cpu}")))} + +%if %defined bootstrap_arches +# For each bootstrap arch, add an additional binary Source. +# Also define bootstrap_source just for the current target. +%{lua: do + local bootstrap_arches = {} + for arch in string.gmatch(rpm.expand("%{bootstrap_arches}"), "%S+") do + table.insert(bootstrap_arches, arch) + end + local base = rpm.expand("https://static.rust-lang.org/cargo-dist" + .."/%{bootstrap_date}/cargo-nightly") + local target_arch = rpm.expand("%{_target_cpu}") + for i, arch in ipairs(bootstrap_arches) do + i = i + 10 + print(string.format("Source%d: %s-%s.tar.gz\n", + i, base, rust_triple(arch))) + if arch == target_arch then + rpm.define("bootstrap_source "..i) + end + end +end} %endif # Use vendored crate dependencies so we can build offline. @@ -33,16 +71,6 @@ Source13: %{bootstrap_base}-aarch64-unknown-linux-gnu.tar.gz # FIXME: These should all eventually be packaged on their own! Source100: %{name}-%{version}-vendor.tar.xz -Patch1: cargo-0.14.0-release-num.patch - -# Only x86_64 and i686 are Tier 1 platforms at this time. -ExclusiveArch: x86_64 i686 armv7hl aarch64 -%ifarch armv7hl -%global rust_triple armv7-unknown-linux-gnueabihf -%else -%global rust_triple %{_target_cpu}-unknown-linux-gnu -%endif - BuildRequires: rust BuildRequires: make BuildRequires: cmake @@ -50,28 +78,22 @@ BuildRequires: gcc BuildRequires: python2 >= 2.7 BuildRequires: curl -%if %without bootstrap +%ifarch %{bootstrap_arches} +%global bootstrap_root cargo-nightly-%{rust_triple} +%global local_cargo %{_builddir}/%{bootstrap_root}/cargo/bin/cargo +%else BuildRequires: %{name} >= 0.13.0 %global local_cargo %{_bindir}/%{name} -%else -%global bootstrap_root cargo-nightly-%{rust_triple} -%global local_cargo %{_builddir}/%{name}-%{version}/%{bootstrap_root}/cargo/bin/cargo %endif # Indirect dependencies for vendored -sys crates above BuildRequires: libcurl-devel BuildRequires: libgit2-devel BuildRequires: libssh2-devel +BuildRequires: openssl-devel BuildRequires: zlib-devel BuildRequires: pkgconfig -%if 0%{?fedora} >= 26 -# https://bugzilla.redhat.com/show_bug.cgi?id=1383778 -BuildRequires: compat-openssl10-devel -%else -BuildRequires: openssl-devel -%endif - # Cargo is not much use without Rust Requires: rust @@ -81,17 +103,23 @@ and ensure that you'll always get a repeatable build. %prep -%setup -q -%patch1 -p1 -b .release-num +%ifarch %{bootstrap_arches} +%setup -q -n %{bootstrap_root} -T -b %{bootstrap_source} +test -f '%{local_cargo}' +%endif + +# vendored crates +%setup -q -n %{name}-%{version}-vendor -T -b 100 + +# cargo sources +%setup -q # rust-installer %setup -q -T -D -a 1 rmdir src/rust-installer mv rust-installer-%{rust_installer} src/rust-installer -# vendored crates -%setup -q -T -D -a 100 mkdir -p .cargo cat >.cargo/config < - 0.15.0-1 +- Update to 0.15.0. +- Rewrite bootstrap logic to target specific arches. +- Bootstrap ppc64, ppc64le, s390x. + * Sun Nov 13 2016 Josh Stone - 0.14.0-2 - Fix CFG_RELEASE_NUM diff --git a/sources b/sources index ef29596..287df1f 100644 --- a/sources +++ b/sources @@ -1,7 +1,5 @@ -d789a7785e37a1f299b24bc4b57f98ff cargo-0.14.0.tar.gz -11f4e5d2c0908e9644045ed643490a98 cargo-0.14.0-vendor.tar.xz -c7685ef02a5d8ef93f54cdfbc05db4cc cargo-nightly-aarch64-unknown-linux-gnu.tar.gz -4dc6b53822b0bbc7b8abaeda3023abb1 cargo-nightly-armv7-unknown-linux-gnueabihf.tar.gz -dfc61b5e3200b56fa8d10d89601b9461 cargo-nightly-i686-unknown-linux-gnu.tar.gz -49aee9014eadc64a5e9e386fe7981cf6 cargo-nightly-x86_64-unknown-linux-gnu.tar.gz -a222edd3ab08779f527aafe862207027 rust-installer-4f994850808a572e2cc8d43f968893c8e942e9bf.tar.gz +SHA512 (cargo-0.15.0.tar.gz) = a5917d500697ffd000204716a1802e83633d0fd1859a918d57b6add932aa7b935f4ca3cd7ac206b1565b0af29414306198500e036fbf4838f4e91920a84e7dfe +SHA512 (cargo-0.15.0-vendor.tar.xz) = 542123ec07c9059082b44b1b95c7d2dfcc32097c51353fe113fd222258cb6a2f9e83fe8b526ed9ef9960ee379c886903b43984697bf31b17353cd605557328a0 +SHA512 (cargo-nightly-powerpc64le-unknown-linux-gnu.tar.gz) = 427d118fa679b417e7725d06eb8d2cf4588f284189b653d24840ccbb442df11c782befe0bf33c852612015ac0328e651c1707c2eed8e444f149fd2b7edf1a770 +SHA512 (cargo-nightly-powerpc64-unknown-linux-gnu.tar.gz) = d581df25d2899135d8019636f2337c50b1542038d2791d3f7450054bcf2686f5bdf8f445112a0f0ba81d8690cde5d231d5adafab9e93256ccdd00fc5a2cc2cbb +SHA512 (cargo-nightly-s390x-unknown-linux-gnu.tar.gz) = 35476b178e14ea6f6cc134dcceceac715b9f17958b694bc11c7e44594d089fa449d343b8bb484de53b797ffa9650041df31cfcb2efcab39d9fabffefb843a237 diff --git a/sources-bootstrap b/sources-bootstrap new file mode 100644 index 0000000..73f7913 --- /dev/null +++ b/sources-bootstrap @@ -0,0 +1,9 @@ +SHA512 (cargo-0.15.0.tar.gz) = a5917d500697ffd000204716a1802e83633d0fd1859a918d57b6add932aa7b935f4ca3cd7ac206b1565b0af29414306198500e036fbf4838f4e91920a84e7dfe +SHA512 (cargo-0.15.0-vendor.tar.xz) = 542123ec07c9059082b44b1b95c7d2dfcc32097c51353fe113fd222258cb6a2f9e83fe8b526ed9ef9960ee379c886903b43984697bf31b17353cd605557328a0 +SHA512 (cargo-nightly-aarch64-unknown-linux-gnu.tar.gz) = 4512c1320f4ecf7b5176b9817b00caf367501f5859ff79a48458e232db2f108f103184bb5b7bb1ebbeb7f53ca80d1036b8da6777e45f703b82827d8e5d2ee258 +SHA512 (cargo-nightly-armv7-unknown-linux-gnueabihf.tar.gz) = 93f438f503490e4198866347671d587fc41b88ee6fb408487569a47fa77270e1395437806f3cc7540248b72bb5b6f94afe6d9d46ebb275ee1cfd068dd3555348 +SHA512 (cargo-nightly-i686-unknown-linux-gnu.tar.gz) = c00bb5073c422ae0f7561dab527fce0a3f1b9daaf4dce8be8cdcab264625dea6727a93a405ce895cbc3c4d4066853c292207ab377ce08350f65ca56fb9599cc7 +SHA512 (cargo-nightly-powerpc64le-unknown-linux-gnu.tar.gz) = 427d118fa679b417e7725d06eb8d2cf4588f284189b653d24840ccbb442df11c782befe0bf33c852612015ac0328e651c1707c2eed8e444f149fd2b7edf1a770 +SHA512 (cargo-nightly-powerpc64-unknown-linux-gnu.tar.gz) = d581df25d2899135d8019636f2337c50b1542038d2791d3f7450054bcf2686f5bdf8f445112a0f0ba81d8690cde5d231d5adafab9e93256ccdd00fc5a2cc2cbb +SHA512 (cargo-nightly-s390x-unknown-linux-gnu.tar.gz) = 35476b178e14ea6f6cc134dcceceac715b9f17958b694bc11c7e44594d089fa449d343b8bb484de53b797ffa9650041df31cfcb2efcab39d9fabffefb843a237 +SHA512 (cargo-nightly-x86_64-unknown-linux-gnu.tar.gz) = 7dfd83ac94cf0d1ddff15fc41e870c6fa9082e9a97527c6f99d64a1143b1af1561da3767bd7079adffa4deae1ab4749c919972bbd763f91ee66b8dc09e6f279c