Accepting request 492185 from home:luke_nukem:branches:devel:languages:rust

Attempt to fix build loop rust<->cargo by including cargo binaries for each arch

OBS-URL: https://build.opensuse.org/request/show/492185
OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=105
This commit is contained in:
Luke Jones 2017-04-30 06:28:06 +00:00 committed by Git OBS Bridge
parent 8e933b8761
commit d9ef151cf5
10 changed files with 75 additions and 13 deletions

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4ed71b6d89359db8fba738039f8ba201542240c7396d9599fc3d51f49727ca36
size 4039839

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:91abd44766a5169f5391c607b64fb47aca822ecfa953559a36d041b01ae3aeaa
size 4578488

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fbc5a0614345dfb2b41e133bd821257906a839753a9aa4c4590cc9d658164e58
size 4940463

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:15e79c1e1a9b7e620fe3d88d3b2e5429c8a95b025b2b03a5de4a1d71956fe648
size 4674070

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a5586f28298f88614023534d290525e45e31633450672b33197a92ac36459994
size 4563666

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8de0b700e766e574e855d5f90fc4da37a4939caf71b2c28bd30cf70a8750b20c
size 4197244

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3601e95c968850230b137b849ff08a507e50d77ab584c779143a100f1843d8dd
size 4996337

View File

@ -20,7 +20,7 @@ build = "<rust-triple>"
host = ["<rust-triple>"]
target = ["<rust-triple>"]
cargo = "/usr/bin/cargo"
cargo = "<cargo-bin>"
rustc = "/usr/bin/rustc"
docs = true

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Apr 30 04:48:19 UTC 2017 - luke.nukem.jones@gmail.com
- Add the cargo binaries for each arch, used for building rust only
these are not shipped, and don't factor in to the final product.
-------------------------------------------------------------------
Fri Apr 28 01:24:18 UTC 2017 - luke.nukem.jones@gmail.com

View File

@ -18,8 +18,7 @@
%global prev_rust 1.16.0
%global prev_cargo 0.17.0
%global curr_cargo 0.18.0
%global cargo_version 0.18.0
%global abi gnu
%ifarch s390x
%global _arch s390x
@ -28,6 +27,9 @@
%global _arch armv7
%global abi gnueabihf
%endif
%ifarch aarch64
%global _arch aarch64
%endif
%ifarch ppc64
%global _arch powerpc64
%endif
@ -52,6 +54,13 @@ Group: Development/Languages/Other
Url: http://www.rust-lang.org
Source0: %{dl_url}/rustc-%{version}-src.tar.gz
Source1: config.toml
Source100: cargo-%{cargo_version}-x86_64-unknown-linux-gnu.tar.gz
Source101: cargo-%{cargo_version}-i686-unknown-linux-gnu.tar.gz
Source102: cargo-%{cargo_version}-aarch64-unknown-linux-gnu.tar.gz
Source103: cargo-%{cargo_version}-armv7-unknown-linux-gnueabihf.tar.gz
Source104: cargo-%{cargo_version}-powerpc64-unknown-linux-gnu.tar.gz
Source105: cargo-%{cargo_version}-powerpc64le-unknown-linux-gnu.tar.gz
Source106: cargo-%{cargo_version}-s390x-unknown-linux-gnu.tar.gz
# PATCH-FIX-OPENSUSE: Set DT_SONAME when building dylibs
Patch1: add-soname.patch
BuildRequires: ccache
@ -83,17 +92,11 @@ BuildRequires: fdupes
# There are no successful builds for less than TW or Leap 42.2, so bootstrap
# until such time that there is.
%if %{with rust_bootstrap} || (0%{?suse_version} < 1330 && 0%{?sle_version} <= 120100)
BuildRequires: cargo-bootstrap == %{prev_cargo}
BuildRequires: rust-std-bootstrap == %{prev_rust}
BuildRequires: rustc-bootstrap == %{prev_rust}
%else
# Building with either current of previous version depending on which is available
BuildRequires: cargo <= %{curr_cargo}
BuildRequires: cargo >= %{prev_cargo}
BuildRequires: rust <= %{version}
BuildRequires: rust >= %{prev_rust}
BuildRequires: rust-std <= %{version}
BuildRequires: rust-std >= %{prev_rust}
BuildRequires: rust == %{prev_rust}
BuildRequires: rust-std == %{prev_rust}
%endif
%description
@ -143,9 +146,40 @@ This subpackage provides pretty printers and a wrapper script for
invoking gdb on rust binaries.
%prep
%ifarch x86_64
%setup -q -T -b 100 -n cargo-%{cargo_version}-%{_arch}-unknown-linux-%{abi}
%endif
%ifarch %ix86
%setup -q -T -b 101 -n cargo-%{cargo_version}-i686-unknown-linux-%{abi}
%endif
%ifarch aarch64
%setup -q -T -b 102 -n cargo-%{cargo_version}-%{_arch}-unknown-linux-%{abi}
%endif
%ifarch armv7hl
%setup -q -T -b 103 -n cargo-%{cargo_version}-%{_arch}-unknown-linux-%{abi}
%endif
%ifarch ppc64
%setup -q -T -b 104 -n cargo-%{cargo_version}-%{_arch}-unknown-linux-%{abi}
%endif
%ifarch ppc64le
%setup -q -T -b 105 -n cargo-%{cargo_version}-%{_arch}-unknown-linux-%{abi}
%endif
%ifarch s390x
%setup -q -T -b 106 -n cargo-%{cargo_version}z-%{_arch}-unknown-linux-%{abi}
%endif
# The cargo binary is only used to build rust and is not shipped
# Using i686 for i586 seems to be okay for now but may cause issues in future
%ifarch %ix86
%global cargo_bin %{_builddir}/cargo-%{cargo_version}-i686-unknown-linux-%{abi}/cargo/bin/cargo
%else
%global cargo_bin %{_builddir}/cargo-%{cargo_version}-%{_arch}-unknown-linux-%{abi}/cargo/bin/cargo
%endif
%setup -q -n rustc-%{version}-src
%patch1 -p1
sed -e 's:<rust-triple>:%{rust_triple}:g' \
sed -e 's:<cargo-bin>:%{cargo_bin}:g' \
-e 's:<rust-triple>:%{rust_triple}:g' \
-e 's:<prefix>:%{_prefix}:g' \
-e 's:<libdir>:%{_prefix}/lib:g' \
-e 's:<mandir>:%{_mandir}:g' \
@ -158,7 +192,8 @@ export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint
./x.py doc -v
%install
sed -e 's:<rust-triple>:%{rust_triple}:g' \
sed -e 's:<cargo-bin>:%{cargo_bin}:g' \
-e 's:<rust-triple>:%{rust_triple}:g' \
-e 's:<prefix>:%{buildroot}%{_prefix}:g' \
-e 's:<libdir>:%{buildroot}%{_prefix}/lib:g' \
-e 's:<mandir>:%{buildroot}%{_mandir}:g' \