From 0d393fcfe26d3afcc6c10886ac35e071c90ee370 Mon Sep 17 00:00:00 2001 From: Igor Raits Date: Mon, 2 Mar 2020 13:37:35 +0100 Subject: [PATCH] Fix build Signed-off-by: Igor Raits --- ...-build.rs-Simplify-check-for-version.patch | 36 +++++++++++++++++++ rust-proc-macro-error.spec | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 0001-build.rs-Simplify-check-for-version.patch diff --git a/0001-build.rs-Simplify-check-for-version.patch b/0001-build.rs-Simplify-check-for-version.patch new file mode 100644 index 0000000..f23ec69 --- /dev/null +++ b/0001-build.rs-Simplify-check-for-version.patch @@ -0,0 +1,36 @@ +From e7626a25471d2db29e7cdee81308ee4604b41544 Mon Sep 17 00:00:00 2001 +From: Igor Raits +Date: Mon, 2 Mar 2020 12:14:11 +0100 +Subject: [PATCH] build.rs: Simplify check for version + +This also fixes build with rustc shipped by distributions. + +Fixes: https://gitlab.com/CreepySkeleton/proc-macro-error/issues/8 +Signed-off-by: Igor Raits +--- + build.rs | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/build.rs b/build.rs +index 17cf408..3c1196f 100644 +--- a/build.rs ++++ b/build.rs +@@ -1,11 +1,11 @@ + fn main() { +- let (version, channel, _) = version_check::triple().unwrap(); +- +- if !channel.is_nightly() { ++ if !version_check::is_feature_flaggable().unwrap_or(false) { + println!("cargo:rustc-cfg=use_fallback"); + } + +- if version.at_most("1.38.0") || !channel.is_stable() { ++ if version_check::is_max_version("1.38.0").unwrap_or(false) ++ || !version_check::Channel::read().unwrap().is_stable() ++ { + println!("cargo:rustc-cfg=skip_ui_tests"); + } + } +-- +2.25.1 + diff --git a/rust-proc-macro-error.spec b/rust-proc-macro-error.spec index 85f1b7e..23096c2 100644 --- a/rust-proc-macro-error.spec +++ b/rust-proc-macro-error.spec @@ -17,6 +17,8 @@ Source: %{crates_source} # Initial patched metadata # * unpin the toml dependency Patch0: proc-macro-error-fix-metadata.diff +# https://gitlab.com/CreepySkeleton/proc-macro-error/-/merge_requests/25 +Patch0001: 0001-build.rs-Simplify-check-for-version.patch ExclusiveArch: %{rust_arches} %if %{__cargo_skip_build}