From 38d7bdb3c5e713437ac1023926e0cea6592ac7e46303dc585b7d3d120ddd33e2 Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Mon, 4 May 2020 09:27:10 +0000 Subject: [PATCH] Accepting request 791945 from home:Andreas_Schwab:Factory - Avoid duplication of environment settings OBS-URL: https://build.opensuse.org/request/show/791945 OBS-URL: https://build.opensuse.org/package/show/devel:languages:rust/rust?expand=0&rev=247 --- rust.changes | 5 +++++ rust.spec | 37 +++++++++++-------------------------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/rust.changes b/rust.changes index 16e2fab..e4a02c7 100644 --- a/rust.changes +++ b/rust.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 7 08:54:37 UTC 2020 - Andreas Schwab + +- Avoid duplication of environment settings + ------------------------------------------------------------------- Tue Mar 31 12:28:18 UTC 2020 - Antonio Larrosa diff --git a/rust.spec b/rust.spec index f96cfe3..3e2f2d6 100644 --- a/rust.spec +++ b/rust.spec @@ -1,7 +1,7 @@ # # spec file for package rust # -# Copyright (c) 2020 SUSE LLC. +# Copyright (c) 2020 SUSE LLC # Copyright (c) 2019 Luke Jones, luke@ljones.dev # # All modifications and additions to the file contributed by third parties @@ -309,9 +309,9 @@ A tool for formatting Rust code according to style guidelines. %package -n clippy Summary: Lints to catch common mistakes and improve Rust code -# /usr/bin/clippy-driver is dynamically linked against internal rustc libs License: MPL-2.0 Group: Development/Languages/Rust +# /usr/bin/clippy-driver is dynamically linked against internal rustc libs Requires: %{name} = %{version} Requires: cargo = %{version} Provides: clippy = %{clippy_version} @@ -335,10 +335,10 @@ Cargo downloads dependencies of Rust projects and compiles it. %package -n cargo-doc Summary: Documentation for Cargo -# Cargo no longer builds its own documentation -# https://github.com/rust-lang/cargo/pull/4904 License: MIT OR Apache-2.0 Group: Development/Languages/Rust +# Cargo no longer builds its own documentation +# https://github.com/rust-lang/cargo/pull/4904 Requires: rust-doc = %{version} BuildArch: noarch @@ -455,12 +455,12 @@ if [ $(%{rust_root}/bin/rustc --version | sed -En 's/rustc ([0-9].[0-9][0-9].[0- sed -i -e "s|#local-rebuild = false|local-rebuild = true|" config.toml; fi -# BEGIN EXPORTS +# Create exports file # Keep all the "export VARIABLE" together here, so they can be -# cut&pasted to the %%install section below. And please keep them -# in sync! +# reread in the %%install section below. # If the environments between build and install and different, # everything will be rebuilt during installation! +cat > .env.sh <<\EOF export RUSTFLAGS="%{rustflags}" %if 0%{?sle_version} >= 120000 && 0%{?sle_version} <= 120500 export CC=gcc-7 @@ -474,30 +474,15 @@ export LIBSSH2_SYS_USE_PKG_CONFIG=1 export CPPFLAGS="%{optflags}" export DESTDIR=%{buildroot} # END EXPORTS +EOF +. ./.env.sh ./x.py build -v ./x.py doc -v %install -# BEGIN EXPORTS -# 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 RUSTFLAGS="%{rustflags}" -%if 0%{?sle_version} >= 120000 && 0%{?sle_version} <= 120500 -export CC=gcc-7 -export CXX=g++-7 -%endif -# Make cargo use system libs if not bootstrapping -%if !%{with rust_bootstrap} && 0%{?sle_version} >= 150000 -export LIBSSH2_SYS_USE_PKG_CONFIG=1 -%endif -# eliminate complain from RPMlint -export CPPFLAGS="%{optflags}" -export DESTDIR=%{buildroot} -# END EXPORTS +# Reread exports file +. ./.env.sh ./x.py install ./x.py install src