diff --git a/.gitignore b/.gitignore index b90a349..62a2c7b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ /libdeflate-sys-1.19.0.crate /libdeflate-sys-1.19.2.crate /libdeflate-sys-1.19.3.crate +/libdeflate-sys-1.20.0.crate diff --git a/libdeflate-sys-1.19.3-unconditional-pkg-config.patch b/libdeflate-sys-1.19.3-unconditional-pkg-config.patch deleted file mode 100644 index 1a17160..0000000 --- a/libdeflate-sys-1.19.3-unconditional-pkg-config.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -Naur libdeflate-sys-1.19.3-original/build.rs libdeflate-sys-1.19.3/build.rs ---- libdeflate-sys-1.19.3-original/build.rs 2006-07-23 21:21:28.000000000 -0400 -+++ libdeflate-sys-1.19.3/build.rs 2024-02-28 11:39:40.715923702 -0500 -@@ -5,11 +5,9 @@ - fn main() { - let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap()); - -- #[cfg(feature = "dynamic")] - if pkg_config::Config::new() - .print_system_libs(false) - .cargo_metadata(true) -- .exactly_version("1.19") - .probe("libdeflate") - .is_ok() - { diff --git a/libdeflate-sys-fix-metadata.diff b/libdeflate-sys-fix-metadata.diff index 70135e2..35289fb 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-03-10T21:27:12.731439+00:00 +--- libdeflate-sys-1.20.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ libdeflate-sys-1.20.0/Cargo.toml 2024-04-04T15:09:43.726586+00:00 @@ -40,8 +40,7 @@ [build-dependencies.pkg-config] diff --git a/rust-libdeflate-sys.spec b/rust-libdeflate-sys.spec index ad09ec5..378846a 100644 --- a/rust-libdeflate-sys.spec +++ b/rust-libdeflate-sys.spec @@ -5,7 +5,7 @@ %global crate libdeflate-sys Name: rust-libdeflate-sys -Version: 1.19.3 +Version: 1.20.0 Release: %autorelease Summary: Bindings to libdeflate for DEFLATE @@ -17,13 +17,6 @@ Source: %{crates_source} # 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 -Patch10: libdeflate-sys-1.19.3-unconditional-pkg-config.patch BuildRequires: cargo-rpm-macros >= 24 @@ -89,6 +82,17 @@ use the "freestanding" feature of the "%{crate}" crate. %autosetup -n %{crate}-%{version} -p1 # Remove the bundled copy of libdeflate. rm -rv libdeflate +# Make libdeflate detection with pkg-config unconditional. +sed -r -i 's@^([[:blank:]]*)(#\[cfg\(feature *= *"dynamic"\)\])@\1// \2@' build.rs +# Don’t require an exact version match. We would *like* the versions to stay +# aligned, but we don’t *need* to update libdeflate and +# rust-libdeflate-sys/rust-libdeflater concurrently. +sed -r -i 's@^([[:blank:]]*)(\.exactly_version\()@\1// \2@' build.rs +# The above two sed-patches effectively revert “Dynamic Linking Constraints”, +# https://github.com/adamkewley/libdeflater/pull/32. Using sed instead of a +# patch file keeps us from having to update the patch every time the version +# number changes. + %cargo_prep %generate_buildrequires diff --git a/rust2rpm.toml b/rust2rpm.toml index 87ab577..5c6f6e5 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -8,20 +8,23 @@ lib = [ [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" + "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.", ] [scripts.prep] pre = [ - "# Remove the bundled copy of libdeflate.", - "rm -rv libdeflate", + ''' +# Remove the bundled copy of libdeflate. +rm -rv libdeflate +# Make libdeflate detection with pkg-config unconditional. +sed -r -i 's@^([[:blank:]]*)(#\[cfg\(feature *= *"dynamic"\)\])@\1// \2@' build.rs +# Don’t require an exact version match. We would *like* the versions to stay +# aligned, but we don’t *need* to update libdeflate and +# rust-libdeflate-sys/rust-libdeflater concurrently. +sed -r -i 's@^([[:blank:]]*)(\.exactly_version\()@\1// \2@' build.rs +# The above two sed-patches effectively revert “Dynamic Linking Constraints”, +# https://github.com/adamkewley/libdeflater/pull/32. Using sed instead of a +# patch file keeps us from having to update the patch every time the version +# number changes. +''' ] diff --git a/sources b/sources index f4122f0..489b5ab 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libdeflate-sys-1.19.3.crate) = c1b708672f6ce85579e5dda2537fe6804e73d92053a08387b2ec09388f0697fa3230298931116f482ae4242a0bf7afda9d8f309a13222ef5dee94f56a009890e +SHA512 (libdeflate-sys-1.20.0.crate) = b56d38ae5eba51627b78260454d4b9b58a000e765f6516ee59159496a2041f543ad973b19bbb3e8db7afc0d41940783fc28ec2efd769aa37cde7ab93715f6403