diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2905a83 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/bitflags-1.3.2.crate diff --git a/44c7063.patch b/44c7063.patch new file mode 100644 index 0000000..be60d82 --- /dev/null +++ b/44c7063.patch @@ -0,0 +1,23 @@ +From 44c7063fe4c40ffed0d7e5d0dbae4a32ed91022b Mon Sep 17 00:00:00 2001 +From: Arturo Castro +Date: Tue, 19 Apr 2022 12:36:35 +0200 +Subject: [PATCH] serde::Serialize -> serde_derive::Serialize + +serde:: doesn't work on tests on CI +--- + src/lib.rs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/lib.rs b/src/lib.rs +index 46542b05..a5cbf53f 100644 +--- a/src/lib.rs ++++ b/src/lib.rs +@@ -1812,7 +1812,7 @@ mod tests { + } + + bitflags! { +- #[derive(serde::Serialize, serde::Deserialize)] ++ #[derive(serde_derive::Serialize, serde_derive::Deserialize)] + struct SerdeFlags: u32 { + const A = 1; + const B = 2; diff --git a/README.md b/README.md deleted file mode 100644 index 08e2582..0000000 --- a/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# rust-bitflags1 - -The rust-bitflags1 package diff --git a/bitflags-fix-metadata.diff b/bitflags-fix-metadata.diff new file mode 100644 index 0000000..ffc6f68 --- /dev/null +++ b/bitflags-fix-metadata.diff @@ -0,0 +1,22 @@ +--- bitflags-1.3.2/Cargo.toml 1970-01-01T00:00:00+00:00 ++++ bitflags-1.3.2/Cargo.toml 2023-07-05T17:35:22.158498+00:00 +@@ -26,14 +26,6 @@ + repository = "https://github.com/bitflags/bitflags" + [package.metadata.docs.rs] + features = ["example_generated"] +-[dependencies.compiler_builtins] +-version = "0.1.2" +-optional = true +- +-[dependencies.core] +-version = "1.0.0" +-optional = true +-package = "rustc-std-workspace-core" + [dev-dependencies.rustversion] + version = "1.0" + +@@ -55,4 +47,3 @@ + [features] + default = [] + example_generated = [] +-rustc-dep-of-std = ["core", "compiler_builtins"] diff --git a/rust-bitflags1.spec b/rust-bitflags1.spec new file mode 100644 index 0000000..fbf420d --- /dev/null +++ b/rust-bitflags1.spec @@ -0,0 +1,90 @@ +# Generated by rust2rpm 24 +%bcond_without check +%global debug_package %{nil} + +%global crate bitflags + +Name: rust-bitflags1 +Version: 1.3.2 +Release: %autorelease +Summary: Macro to generate structures which behave like bitflags + +# Upstream license specification: MIT/Apache-2.0 +License: MIT OR Apache-2.0 +URL: https://crates.io/crates/bitflags +Source: %{crates_source} +# Manually created patch for downstream crate metadata changes +# * drop dependencies on compiler internals +Patch: bitflags-fix-metadata.diff +# * upstream patch to fix building tests with trybuild >= 1.0.57 +Patch: https://github.com/bitflags/bitflags/commit/44c7063.patch + +BuildRequires: rust-packaging >= 21 + +%global _description %{expand: +A macro to generate structures which behave like bitflags.} + +%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-APACHE +%license %{crate_instdir}/LICENSE-MIT +%doc %{crate_instdir}/CHANGELOG.md +%doc %{crate_instdir}/CODE_OF_CONDUCT.md +%doc %{crate_instdir}/README.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}+example_generated-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+example_generated-devel %{_description} + +This package contains library source intended for building other packages which +use the "example_generated" feature of the "%{crate}" crate. + +%files -n %{name}+example_generated-devel +%ghost %{crate_instdir}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +# * skip trybuild tests that are broken due to cosmetic string differences +%cargo_test -- -- --skip fail +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..eb14e89 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (bitflags-1.3.2.crate) = 3c698f757b5cc62f815f9a1cce365c3d2dd88e4db71f331dff8bba86c2865f755b81cb4c9bfc59bd86b7643b0943f9e09a7c4f8ad75eb2ab0e714803d0129f62