From 8772faf0b6e4b83f8e3691724b3912bc6029d9c1 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Tue, 1 Oct 2024 21:11:49 +0200 Subject: [PATCH] Drop unused example programs and drop example-specific dependencies --- rust-y4m.spec | 11 ++++++++--- rust2rpm.toml | 11 +++++++++++ y4m-fix-metadata.diff | 9 +++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 rust2rpm.toml create mode 100644 y4m-fix-metadata.diff diff --git a/rust-y4m.spec b/rust-y4m.spec index 3b37465..8afb991 100644 --- a/rust-y4m.spec +++ b/rust-y4m.spec @@ -1,4 +1,4 @@ -# Generated by rust2rpm 24 +# Generated by rust2rpm 26 %bcond_without check %global debug_package %{nil} @@ -12,8 +12,11 @@ Summary: YUV4MPEG2 (.y4m) Encoder/Decoder License: MIT URL: https://crates.io/crates/y4m Source: %{crates_source} +# Manually created patch for downstream crate metadata changes +# * drop outdated, example-only resize dev-dependency +Patch: y4m-fix-metadata.diff -BuildRequires: rust-packaging >= 21 +BuildRequires: cargo-rpm-macros >= 24 %global _description %{expand: YUV4MPEG2 (.y4m) Encoder/Decoder.} @@ -47,8 +50,10 @@ use the "default" feature of the "%{crate}" crate. %ghost %{crate_instdir}/Cargo.toml %prep -%autosetup -n %{crate}-%{version_no_tilde} -p1 +%autosetup -n %{crate}-%{version} -p1 %cargo_prep +# drop unused example programs +rm -rv examples/ %generate_buildrequires %cargo_generate_buildrequires diff --git a/rust2rpm.toml b/rust2rpm.toml new file mode 100644 index 0000000..f2e5c95 --- /dev/null +++ b/rust2rpm.toml @@ -0,0 +1,11 @@ +[package] +cargo-toml-patch-comments = [ + "drop outdated, example-only resize dev-dependency", +] + +[scripts] +prep.post = [ + "# drop unused example programs", + "rm -rv examples/", +] + diff --git a/y4m-fix-metadata.diff b/y4m-fix-metadata.diff new file mode 100644 index 0000000..976a401 --- /dev/null +++ b/y4m-fix-metadata.diff @@ -0,0 +1,9 @@ +--- y4m-0.8.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ y4m-0.8.0/Cargo.toml 2024-10-01T19:09:44.116367+00:00 +@@ -26,6 +26,3 @@ + ] + license = "MIT" + repository = "https://github.com/image-rs/y4m.git" +- +-[dev-dependencies.resize] +-version = "0.4"