SHA256
1
0
forked from pool/rust

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

- Large cleanup of both the spec and config.toml to correct many
  build issues for the new version
- Add rust-1.21.0-44203-exclude-compiler-rt-test.patch
- Add rust-1.21.0-44066-ppc64-struct-abi.patch
- Add rust-1.21.0-44440-s390x-global-align.patch
- Remove add-soname.patch

OBS-URL: https://build.opensuse.org/request/show/535104
OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=132
This commit is contained in:
Luke Jones
2017-10-19 05:50:12 +00:00
committed by Git OBS Bridge
parent 19b4091847
commit 45595d2fc4
8 changed files with 875 additions and 86 deletions

View File

@@ -61,9 +61,10 @@ 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
Patch1: rust-1.21.0-44203-exclude-compiler-rt-test.patch
Patch2: rust-1.21.0-44066-ppc64-struct-abi.patch
Patch3: rust-1.21.0-44440-s390x-global-align.patch
BuildRequires: ccache
BuildRequires: chrpath
BuildRequires: cmake >= 3.4.3
BuildRequires: curl
BuildRequires: gcc-c++
@@ -75,7 +76,6 @@ Recommends: cargo
Recommends: %{name}-doc
Recommends: %{name}-std
Provides: rust = %{version}
Conflicts: otherproviders(rust)
Conflicts: rustc-bootstrap
@@ -179,18 +179,16 @@ as RLS or racer.
%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}-%{rust_triple}/cargo/bin/cargo
%endif
%setup -q -n rustc-%{version}-src
%patch1 -p1
%patch2 -p1
%patch3 -p1
sed -e 's:<cargo-bin>:%{cargo_bin}:g' \
-e 's:<rust-triple>:%{rust_triple}:g' \
-e 's:<prefix>:%{_prefix}:g' \
-e 's:<bindir>:%{_prefix}/bin:g' \
-e 's:<libdir>:%{common_libdir}:g' \
-e 's:<mandir>:%{_mandir}:g' \
-e 's:<docdir>:%{_docdir}/%{name}:g' \
@@ -202,41 +200,43 @@ export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint
./x.py doc --config config.toml
%install
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}%{common_libdir}:g' \
-e 's:<mandir>:%{buildroot}%{_mandir}:g' \
-e 's:<docdir>:%{buildroot}%{_docdir}/%{name}:g' \
%{SOURCE1} > config.toml
./x.py install
./x.py install src
DESTDIR=%{buildroot} ./x.py install
DESTDIR=%{buildroot} ./x.py install src
# Fix any rpaths if needed
chrpath -d %{buildroot}%{_prefix}/lib/lib*.so
chrpath -d %{buildroot}%{common_libdir}/lib*.so
# Remove executable permission from HTML documentation
# to prevent RPMLINT errors.
chmod -R -x+X %{buildroot}%{_docdir}/%{name}/html
# Remove lockfile to avoid errors.
rm %{buildroot}%{_docdir}/%{name}/html/.lock
# Sanitize the HTML documentation
find %{buildroot}%{_docdir}/%{name}/html -empty -delete
find %{buildroot}%{_docdir}/%{name}/html -type f -exec chmod -x '{}' '+'
# Remove surplus files
rm %{buildroot}%{rustlibdir}/components
rm %{buildroot}%{rustlibdir}/manifest-rust*
rm %{buildroot}%{rustlibdir}/install.log
rm %{buildroot}%{rustlibdir}/uninstall.sh
rm %{buildroot}%{rustlibdir}/rust-installer-version
# Remove lockfile to avoid errors.
rm %{buildroot}%{_docdir}/%{name}/html/.lock
rm %{buildroot}%{common_libdir}/debug/.build-id
# The remaining shared libraries should be executable for debuginfo extraction.
find %{buildroot}/%{_prefix}/lib/ -type f -name '*.so' -exec chmod -v +x '{}' '+'
# Remove installer artifacts (manifests, uninstall scripts, etc.)
find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -exec rm -v '{}' '+'
# The shared libraries should be executable for debuginfo extraction.
find %{buildroot}%{rustlibdir} -maxdepth 1 -type f -name '*.so' -exec chmod -v +x '{}' '+'
# extract bundled licenses for packaging - From fedora spec
cp src/rt/hoedown/LICENSE src/rt/hoedown/LICENSE-hoedown
sed -e '/*\//q' src/libbacktrace/backtrace.h \
>src/libbacktrace/LICENSE-libbacktrace
sed -e '/*\//q' src/libbacktrace/backtrace.h > src/libbacktrace/LICENSE-libbacktrace
# Remvove the license files from _docdir: make install put duplicates there
rm %{buildroot}%{_defaultdocdir}/%{name}/{COPYRIGHT,LICENSE-APACHE,LICENSE-MIT}
# Remove the license files from _docdir: make install put duplicates there
rm %{buildroot}%{_docdir}/%{name}/{README.md,COPYRIGHT,LICENSE-APACHE,LICENSE-MIT}
%if 0%{?suse_version}
%fdupes %{buildroot}%{_prefix}