From e444a079d19d7389fb3ca08c190217384f3aff59 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Wed, 28 Aug 2024 01:01:54 +0200 Subject: [PATCH] Remove superfluous dev-dependencies --- ...st-block-that-adds-superfluous-dev-d.patch | 26 +++++++++++++++++++ proc-macro2-fix-metadata.diff | 24 +++++++++++++++++ rust-proc-macro2.spec | 4 +++ rust2rpm.toml | 3 +++ 4 files changed, 57 insertions(+) create mode 100644 0001-ignore-one-doctest-block-that-adds-superfluous-dev-d.patch create mode 100644 proc-macro2-fix-metadata.diff diff --git a/0001-ignore-one-doctest-block-that-adds-superfluous-dev-d.patch b/0001-ignore-one-doctest-block-that-adds-superfluous-dev-d.patch new file mode 100644 index 0000000..07c7c74 --- /dev/null +++ b/0001-ignore-one-doctest-block-that-adds-superfluous-dev-d.patch @@ -0,0 +1,26 @@ +From 421d96764e5ac1396ee220aa83c41ad5e6e444ba Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 28 Aug 2024 00:59:51 +0200 +Subject: [PATCH] ignore one doctest block that adds superfluous + dev-dependencies + +--- + src/extra.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/extra.rs b/src/extra.rs +index 522a90e..7ec8495 100644 +--- a/src/extra.rs ++++ b/src/extra.rs +@@ -27,7 +27,7 @@ use core::fmt::{self, Debug}; + /// workload that involves parsing it all would overflow a 32-bit source + /// location unless spans are being invalidated. + /// +-/// ``` ++/// ```ignore + /// use flate2::read::GzDecoder; + /// use std::ffi::OsStr; + /// use std::io::{BufReader, Read}; +-- +2.46.0 + diff --git a/proc-macro2-fix-metadata.diff b/proc-macro2-fix-metadata.diff new file mode 100644 index 0000000..6b844fe --- /dev/null +++ b/proc-macro2-fix-metadata.diff @@ -0,0 +1,24 @@ +--- proc-macro2-1.0.86/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ proc-macro2-1.0.86/Cargo.toml 2024-08-27T22:59:20.381205+00:00 +@@ -81,21 +81,12 @@ + [dependencies.unicode-ident] + version = "1.0" + +-[dev-dependencies.flate2] +-version = "1.0" +- + [dev-dependencies.quote] + version = "1.0" + default-features = false + +-[dev-dependencies.rayon] +-version = "1.0" +- + [dev-dependencies.rustversion] + version = "1" +- +-[dev-dependencies.tar] +-version = "0.4" + + [features] + default = ["proc-macro"] diff --git a/rust-proc-macro2.spec b/rust-proc-macro2.spec index 485d4a0..db10534 100644 --- a/rust-proc-macro2.spec +++ b/rust-proc-macro2.spec @@ -12,6 +12,10 @@ Summary: Substitute implementation of the Rust compiler's proc_macro API License: MIT OR Apache-2.0 URL: https://crates.io/crates/proc-macro2 Source: %{crates_source} +# Manually created patch for downstream crate metadata changes +# * remove superfluous dev-dependencies that are only present for a noop doctest +Patch: proc-macro2-fix-metadata.diff +Patch: 0001-ignore-one-doctest-block-that-adds-superfluous-dev-d.patch BuildRequires: cargo-rpm-macros >= 24 diff --git a/rust2rpm.toml b/rust2rpm.toml index ac72677..32661ea 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,5 +1,8 @@ [package] summary = "Substitute implementation of the Rust compiler's proc_macro API" +cargo-toml-patch-comments = [ + "remove superfluous dev-dependencies that are only present for a noop doctest", +] [features] hide = ["nightly"]