From e226ffb8ab4d8bb9a5d388dcb6d0e3c27871827e Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Mon, 30 Sep 2024 12:37:33 +0200 Subject: [PATCH] Drop dependency on time ^0.1 which is only required for building examples --- git2-fix-metadata.diff | 12 ++++++++++++ rust-git2.spec | 11 ++++++++--- rust2rpm.toml | 11 +++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 git2-fix-metadata.diff diff --git a/git2-fix-metadata.diff b/git2-fix-metadata.diff new file mode 100644 index 0000000..776aa19 --- /dev/null +++ b/git2-fix-metadata.diff @@ -0,0 +1,12 @@ +--- git2-0.18.3/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ git2-0.18.3/Cargo.toml 2024-09-30T10:34:46.623498+00:00 +@@ -51,9 +51,6 @@ + [dev-dependencies.tempfile] + version = "3.1.0" + +-[dev-dependencies.time] +-version = "0.1.39" +- + [features] + default = [ + "ssh", diff --git a/rust-git2.spec b/rust-git2.spec index 3d2e3db..3225168 100644 --- a/rust-git2.spec +++ b/rust-git2.spec @@ -12,8 +12,14 @@ Summary: Bindings to libgit2 for interoperating with git repositories License: MIT OR Apache-2.0 URL: https://crates.io/crates/git2 Source: %{crates_source} +# Manually created patch for downstream crate metadata changes +# * drop dependency on time ^0.1 which is only required for building examples +Patch: git2-fix-metadata.diff BuildRequires: cargo-rpm-macros >= 24 +%if %{with check} +BuildRequires: /usr/bin/git +%endif %global _description %{expand: Bindings to libgit2 for interoperating with git repositories. This @@ -138,12 +144,11 @@ use the "vendored-libgit2" feature of the "%{crate}" crate. %prep %autosetup -n %{crate}-%{version} -p1 %cargo_prep +# drop examples that pull in time ^0.1 +rm -rv examples/ %generate_buildrequires %cargo_generate_buildrequires -%if %{with check} -echo '/usr/bin/git' -%endif %build %cargo_build diff --git a/rust2rpm.toml b/rust2rpm.toml index dd9a9c8..fabb120 100644 --- a/rust2rpm.toml +++ b/rust2rpm.toml @@ -1,3 +1,8 @@ +[package] +cargo-toml-patch-comments = [ + "drop dependency on time ^0.1 which is only required for building examples", +] + [features] hide = [ "vendored-openssl", @@ -9,3 +14,9 @@ test = [ "/usr/bin/git", ] +[scripts] +prep.post = [ + "# drop examples that pull in time ^0.1", + "rm -rv examples/", +] +