From 348da692ff65cfad8de5adb41fb471380b4c6461 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Wed, 9 Oct 2024 20:39:35 +0200 Subject: [PATCH] Initial import (cbindgen 0.26 compat package) --- .gitignore | 1 + README.md | 3 -- cbindgen-fix-metadata.diff | 20 ++++++++ rust-cbindgen0.26.spec | 95 ++++++++++++++++++++++++++++++++++++++ rust2rpm.toml | 14 ++++++ sources | 1 + 6 files changed, 131 insertions(+), 3 deletions(-) create mode 100644 .gitignore delete mode 100644 README.md create mode 100644 cbindgen-fix-metadata.diff create mode 100644 rust-cbindgen0.26.spec create mode 100644 rust2rpm.toml create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dd2206a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/cbindgen-0.26.0.crate diff --git a/README.md b/README.md deleted file mode 100644 index 4cd093e..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# rust-cbindgen0.26 - -The rust-cbindgen0.26 package diff --git a/cbindgen-fix-metadata.diff b/cbindgen-fix-metadata.diff new file mode 100644 index 0000000..9123689 --- /dev/null +++ b/cbindgen-fix-metadata.diff @@ -0,0 +1,20 @@ +--- cbindgen-0.26.0/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ cbindgen-0.26.0/Cargo.toml 2024-10-09T17:58:26.638747+00:00 +@@ -50,7 +50,7 @@ + optional = true + + [dependencies.heck] +-version = "0.4" ++version = "0.5" + + [dependencies.indexmap] + version = "1" +@@ -91,7 +91,7 @@ + version = "0.5" + + [dev-dependencies.serial_test] +-version = "0.5.0" ++version = "3.1" + + [features] + default = ["clap"] diff --git a/rust-cbindgen0.26.spec b/rust-cbindgen0.26.spec new file mode 100644 index 0000000..3a2dae2 --- /dev/null +++ b/rust-cbindgen0.26.spec @@ -0,0 +1,95 @@ +# Generated by rust2rpm 26 +%bcond_without check +%global debug_package %{nil} + +# prevent executables from being installed +%global cargo_install_bin 0 + +%global crate cbindgen + +Name: rust-cbindgen0.26 +Version: 0.26.0 +Release: %autorelease +Summary: Tool for generating C bindings to Rust code + +License: MPL-2.0 +URL: https://crates.io/crates/cbindgen +Source: %{crates_source} +# Manually created patch for downstream crate metadata changes +# * bump heck dependency from 0.4 to 0.5 +# * bump serial_test dev-dependency from 0.5 to 3.1 +Patch: cbindgen-fix-metadata.diff + +BuildRequires: cargo-rpm-macros >= 26 +%if %{with check} +BuildRequires: /usr/bin/cython +BuildRequires: /usr/bin/gcc +BuildRequires: /usr/bin/g++ +%endif + +%global _description %{expand: +A tool for generating C bindings to Rust code.} + +%description %{_description} + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel %{_description} + +This package contains library source intended for building other packages which +use the "%{crate}" crate. + +%files devel +%license %{crate_instdir}/LICENSE +%doc %{crate_instdir}/README.md +%doc %{crate_instdir}/contributing.md +%doc %{crate_instdir}/docs.md +%doc %{crate_instdir}/internals.md +%{crate_instdir}/ + +%package -n %{name}+default-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+default-devel %{_description} + +This package contains library source intended for building other packages which +use the "default" feature of the "%{crate}" crate. + +%files -n %{name}+default-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+clap-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+clap-devel %{_description} + +This package contains library source intended for building other packages which +use the "clap" feature of the "%{crate}" crate. + +%files -n %{name}+clap-devel +%ghost %{crate_instdir}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/rust2rpm.toml b/rust2rpm.toml new file mode 100644 index 0000000..eed282c --- /dev/null +++ b/rust2rpm.toml @@ -0,0 +1,14 @@ +[package] +cargo-install-bin = false +cargo-toml-patch-comments = [ + "bump heck dependency from 0.4 to 0.5", + "bump serial_test dev-dependency from 0.5 to 3.1", +] + +[requires] +test = [ + "/usr/bin/cython", + "/usr/bin/gcc", + "/usr/bin/g++", +] + diff --git a/sources b/sources new file mode 100644 index 0000000..94db26b --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (cbindgen-0.26.0.crate) = 2de81f46c9c68c985241a349f13125876667d1460d3658ead8c4ee9788cd139c30dbc08bebddc172cf0bd4644f3f17c02cf66f2a3ef706c52366fdaf0f9d8059