From e6f25adbb6ab644127b7b64f92a699362a5d1be6 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Sun, 10 Mar 2024 17:28:19 -0400 Subject: [PATCH] Use rust2rpm 26 features to reduce the amount of manual packaging work --- libdeflate-sys-fix-metadata.diff | 2 +- rust-libdeflate-sys.spec | 24 +++++++++++------------- rust2rpm.toml | 20 ++++++++++++++++++++ 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/libdeflate-sys-fix-metadata.diff b/libdeflate-sys-fix-metadata.diff index d2e7a95..70135e2 100644 --- a/libdeflate-sys-fix-metadata.diff +++ b/libdeflate-sys-fix-metadata.diff @@ -1,5 +1,5 @@ --- libdeflate-sys-1.19.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ libdeflate-sys-1.19.3/Cargo.toml 2024-02-28T16:35:41.917707+00:00 ++++ libdeflate-sys-1.19.3/Cargo.toml 2024-03-10T21:27:12.731439+00:00 @@ -40,8 +40,7 @@ [build-dependencies.pkg-config] diff --git a/rust-libdeflate-sys.spec b/rust-libdeflate-sys.spec index 7abab7e..ad09ec5 100644 --- a/rust-libdeflate-sys.spec +++ b/rust-libdeflate-sys.spec @@ -1,4 +1,4 @@ -# Generated by rust2rpm 25 +# Generated by rust2rpm 26 %bcond_without check %global debug_package %{nil} @@ -13,19 +13,17 @@ License: Apache-2.0 URL: https://crates.io/crates/libdeflate-sys Source: %{crates_source} # Manually created patch for downstream crate metadata changes -# - Make the dependency on crate(pkg-config) non-optional instead of -# associating it with the “dynamic” feature, since we patch the crate to -# always link dynamically with the system libdeflate, regardless of the -# selected features. +# * Make the dependency on crate(pkg-config) non-optional instead of associating +# it with the “dynamic” feature, since we patch the crate to always link +# dynamically with the system libdeflate, regardless of the selected features. Patch: libdeflate-sys-fix-metadata.diff -# Downstream-only: always link dynamically with the system libdeflate, -# regardless of the selected features, and do not pin an exact version of -# libdeflate. -# -# Together with libdeflate-sys-fix-metadata.diff, this effectively reverts: -# Dynamic Linking Constraints -# https://github.com/adamkewley/libdeflater/pull/32 -Patch: libdeflate-sys-1.19.3-unconditional-pkg-config.patch +# # * Downstream-only: always link dynamically with the system libdeflate, +# # regardless of the selected features, and do not pin an exact version of +# # libdeflate. Together with libdeflate-sys-fix-metadata.diff, this effectively +# # reverts: +# # * Dynamic Linking Constraints +# # * https://github.com/adamkewley/libdeflater/pull/32 +Patch10: libdeflate-sys-1.19.3-unconditional-pkg-config.patch BuildRequires: cargo-rpm-macros >= 24 diff --git a/rust2rpm.toml b/rust2rpm.toml index 2cfcf02..87ab577 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -5,3 +5,23 @@ build = [ lib = [ "pkgconfig(libdeflate)" ] + +[package] +cargo-toml-patch-comments = [ + "Make the dependency on crate(pkg-config) non-optional instead of associating it with the “dynamic” feature, since we patch the crate to always link dynamically with the system libdeflate, regardless of the selected features.", +] + +[[package.extra-patches]] +number = 10 +file = "libdeflate-sys-1.19.3-unconditional-pkg-config.patch" +comments = [ + "Downstream-only: always link dynamically with the system libdeflate, regardless of the selected features, and do not pin an exact version of libdeflate. Together with libdeflate-sys-fix-metadata.diff, this effectively reverts:", + "Dynamic Linking Constraints", + "https://github.com/adamkewley/libdeflater/pull/32" +] + +[scripts.prep] +pre = [ + "# Remove the bundled copy of libdeflate.", + "rm -rv libdeflate", +]