Accepting request 678326 from home:luke_nukem:branches:devel:languages:rust
Better way to use exported vars OBS-URL: https://build.opensuse.org/request/show/678326 OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=181
This commit is contained in:
parent
b363312045
commit
555d2841ad
55
rust.spec
55
rust.spec
@ -2,7 +2,7 @@
|
|||||||
# spec file for package rust
|
# spec file for package rust
|
||||||
#
|
#
|
||||||
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||||
# Copyright (c) 2018 Luke Jones, jones_ld@protonmail.com
|
# Copyright (c) 2019 Luke Jones, jones_ld@protonmail.com
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -52,9 +52,6 @@
|
|||||||
%global common_libdir %{_prefix}/lib
|
%global common_libdir %{_prefix}/lib
|
||||||
%global rustlibdir %{common_libdir}/rustlib
|
%global rustlibdir %{common_libdir}/rustlib
|
||||||
|
|
||||||
# Use hardening ldflags.
|
|
||||||
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
|
|
||||||
|
|
||||||
# We occasionally need to bootstrap builds due to breakage etc. Rust only guarantees
|
# We occasionally need to bootstrap builds due to breakage etc. Rust only guarantees
|
||||||
# v-1 will build v
|
# v-1 will build v
|
||||||
%bcond_with rust_bootstrap
|
%bcond_with rust_bootstrap
|
||||||
@ -73,6 +70,18 @@
|
|||||||
%else
|
%else
|
||||||
%define debug_info --enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines
|
%define debug_info --enable-debuginfo --disable-debuginfo-only-std --enable-debuginfo-tools --disable-debuginfo-lines
|
||||||
%endif
|
%endif
|
||||||
|
# Use hardening ldflags.
|
||||||
|
%global rustflags -Clink-arg=-Wl,-z,relro,-z,now
|
||||||
|
# Cargo use system libs
|
||||||
|
%global cargo_git LIBGIT2_SYS_USE_PKG_CONFIG=1
|
||||||
|
%global cargo_ssh LIBSSH2_SYS_USE_PKG_CONFIG=1
|
||||||
|
# eliminate complain from RPMlint
|
||||||
|
%global nocomplain CPPFLAGS="%{optflags}"
|
||||||
|
|
||||||
|
# Must be exported before running x.py in both build and install
|
||||||
|
# If the environments between build and install and different,
|
||||||
|
# everything will be rebuilt during installation!
|
||||||
|
%global build_env_vars RUSTFLAGS="%{rustflags}" %{cargo_git} %{cargo_ssh} %{nocomplain}
|
||||||
|
|
||||||
Name: rust
|
Name: rust
|
||||||
Version: 1.32.0
|
Version: 1.32.0
|
||||||
@ -363,19 +372,6 @@ sed -i '1s|^|#!/bin/bash\n|' src/liblibc/ci/emscripten-entry.sh
|
|||||||
sed -i '1s|^|#!/bin/bash\n|' src/stdsimd/ci/run-docker.sh
|
sed -i '1s|^|#!/bin/bash\n|' src/stdsimd/ci/run-docker.sh
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# Keep all the "export VARIABLE" together here, so they can be
|
|
||||||
# cut&pasted to the %install section below. And please keep them in
|
|
||||||
# sync! If the environments between build and install and different,
|
|
||||||
# everything will be rebuilt during installation!
|
|
||||||
|
|
||||||
# This should eventually migrate to distro policy
|
|
||||||
# Enable optimization, debuginfo, and link hardening.
|
|
||||||
export RUSTFLAGS="%{rustflags}"
|
|
||||||
# Cargo use system libs
|
|
||||||
export LIBGIT2_SYS_USE_PKG_CONFIG=1
|
|
||||||
export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
|
||||||
export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint
|
|
||||||
|
|
||||||
%configure \
|
%configure \
|
||||||
--disable-option-checking \
|
--disable-option-checking \
|
||||||
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
|
--build=%{rust_triple} --host=%{rust_triple} --target=%{rust_triple} \
|
||||||
@ -401,25 +397,26 @@ export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint
|
|||||||
sed -i -e "s|#codegen-units = 1|codegen-units = 2|" config.toml
|
sed -i -e "s|#codegen-units = 1|codegen-units = 2|" config.toml
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# Keep all the "export VARIABLE" together here, so they can be
|
||||||
|
# cut&pasted to the %install section below. And please keep them
|
||||||
|
# in sync!
|
||||||
|
# If the environments between build and install and different,
|
||||||
|
# everything will be rebuilt during installation!
|
||||||
|
export %{build_env_vars}
|
||||||
|
|
||||||
./x.py build -v
|
./x.py build -v
|
||||||
./x.py doc -v
|
./x.py doc -v
|
||||||
|
|
||||||
%install
|
%install
|
||||||
# Keep all the "export VARIABLE" together here, so they can be
|
# Keep all the "export VARIABLE" together here, so they can be
|
||||||
# cut&pasted to the %install section below. And please keep them in
|
# cut&pasted to the %build section above. And please keep them
|
||||||
# sync! If the environments between build and install and different,
|
# in sync!
|
||||||
|
# If the environments between build and install and different,
|
||||||
# everything will be rebuilt during installation!
|
# everything will be rebuilt during installation!
|
||||||
|
export %{build_env_vars}
|
||||||
|
|
||||||
# This should eventually migrate to distro policy
|
DESTDIR=%{buildroot} ./x.py install
|
||||||
# Enable optimization, debuginfo, and link hardening.
|
DESTDIR=%{buildroot} ./x.py install src
|
||||||
export RUSTFLAGS="%{rustflags}"
|
|
||||||
# Cargo use system libs
|
|
||||||
export LIBGIT2_SYS_USE_PKG_CONFIG=1
|
|
||||||
export LIBSSH2_SYS_USE_PKG_CONFIG=1
|
|
||||||
export CPPFLAGS="%{optflags}" # eliminate complain from RPMlint
|
|
||||||
|
|
||||||
DESTDIR=%{buildroot} python3 ./x.py install
|
|
||||||
DESTDIR=%{buildroot} python3 ./x.py install src
|
|
||||||
|
|
||||||
# Remove executable permission from HTML documentation
|
# Remove executable permission from HTML documentation
|
||||||
# to prevent RPMLINT errors.
|
# to prevent RPMLINT errors.
|
||||||
|
Loading…
Reference in New Issue
Block a user