From 874fd5390b317ab25acf5ee176c2ca8581dd0ae4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 19 Nov 2019 14:13:24 -0800 Subject: [PATCH] Update to 0.1.7 --- .gitignore | 1 + ...s-current_exe-to-find-the-target-dir.patch | 39 +++++++++++++++++++ rust-autocfg.spec | 8 +++- sources | 2 +- 4 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 0001-Use-the-test-s-current_exe-to-find-the-target-dir.patch diff --git a/.gitignore b/.gitignore index b17d514..d2c5445 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /autocfg-0.1.4.crate /autocfg-0.1.5.crate /autocfg-0.1.6.crate +/autocfg-0.1.7.crate diff --git a/0001-Use-the-test-s-current_exe-to-find-the-target-dir.patch b/0001-Use-the-test-s-current_exe-to-find-the-target-dir.patch new file mode 100644 index 0000000..6446f0c --- /dev/null +++ b/0001-Use-the-test-s-current_exe-to-find-the-target-dir.patch @@ -0,0 +1,39 @@ +From 1915a0ac72e22fef906351858478eebadf81c4cf Mon Sep 17 00:00:00 2001 +From: Josh Stone +Date: Tue, 19 Nov 2019 14:06:44 -0800 +Subject: [PATCH] Use the test's current_exe() to find the target dir + +--- + tests/rustflags.rs | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/tests/rustflags.rs b/tests/rustflags.rs +index bfa0f03ee0ef..119376c409a8 100644 +--- a/tests/rustflags.rs ++++ b/tests/rustflags.rs +@@ -1,13 +1,19 @@ + extern crate autocfg; + ++use std::env; ++ + /// Tests that autocfg uses the RUSTFLAGS environment variable when running + /// rustc. + #[test] + fn test_with_sysroot() { +- std::env::set_var("RUSTFLAGS", "-L target/debug/deps -L target/debug"); +- std::env::set_var("OUT_DIR", "target"); ++ // Use the same path as this test binary. ++ let dir = env::current_exe().unwrap().parent().unwrap().to_path_buf(); ++ env::set_var("RUSTFLAGS", &format!("-L {}", dir.display())); ++ env::set_var("OUT_DIR", &format!("{}", dir.display())); ++ + // Ensure HOST != TARGET. +- std::env::set_var("HOST", "lol"); ++ env::set_var("HOST", "lol"); ++ + let ac = autocfg::AutoCfg::new().unwrap(); + assert!(ac.probe_sysroot_crate("autocfg")); + } +-- +2.23.0 + diff --git a/rust-autocfg.spec b/rust-autocfg.spec index 56edbd5..7cf9772 100644 --- a/rust-autocfg.spec +++ b/rust-autocfg.spec @@ -5,7 +5,7 @@ %global crate autocfg Name: rust-%{crate} -Version: 0.1.6 +Version: 0.1.7 Release: 1%{?dist} Summary: Automatic cfg for Rust compiler features @@ -14,6 +14,9 @@ License: ASL 2.0 or MIT URL: https://crates.io/crates/autocfg Source: %{crates_source} +# https://github.com/cuviper/autocfg/pull/18 +Patch1: 0001-Use-the-test-s-current_exe-to-find-the-target-dir.patch + ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build} BuildArch: noarch @@ -71,6 +74,9 @@ which use "default" feature of "%{crate}" crate. %endif %changelog +* Tue Nov 19 2019 Josh Stone - 0.1.7-1 +- Update to 0.1.7 + * Sun Sep 01 20:35:52 CEST 2019 Igor Gnatenko - 0.1.6-1 - Update to 0.1.6 diff --git a/sources b/sources index 6f55ba1..e188b98 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (autocfg-0.1.6.crate) = ac7dd73b7c6b8b54c4fc98c3e75210eb59d46ab3447fca533763bfebfa87dba5e947829e3ba56a8eb3403f6d317065b7d674da883741e619f3866b12267801fe +SHA512 (autocfg-0.1.7.crate) = 667ca520f2b46140d2f3519b43e5155426a6e7a2130879860eb10b974f84465600077f53abed4c0e6bf2612471f01786bfb3531ea8773d0f50f29d48e05f7925