Initial package (close RHBZ#2328487)

- Re-generate with rust2rpm 27 for a slightly nicer spec file
epel10 imports/epel10/rust-icu_collections-1.5.0-1.el10
Benjamin A. Beasley 3 months ago
parent 7a28b6a31a
commit 26ef8a0c56

1
.gitignore vendored

@ -0,0 +1 @@
/icu_collections-1.5.0.crate

@ -0,0 +1,12 @@
diff -Naur icu_collections-1.5.0-original/src/iterator_utils.rs icu_collections-1.5.0/src/iterator_utils.rs
--- icu_collections-1.5.0-original/src/iterator_utils.rs 2006-07-23 21:21:28.000000000 -0400
+++ icu_collections-1.5.0/src/iterator_utils.rs 2024-11-23 10:54:55.081320930 -0500
@@ -59,6 +59,8 @@
}
#[cfg(test)]
+// Downstream-only: unconditionally disable these to avoid a circular dependency on the icu crate
+#[cfg(any())]
mod tests {
use core::fmt::Debug;
use icu::collections::codepointinvlist::CodePointInversionListBuilder;

@ -0,0 +1,24 @@
diff -Naur icu_collections-1.5.0-original/src/codepointinvlist/cpinvlist.rs icu_collections-1.5.0/src/codepointinvlist/cpinvlist.rs
--- icu_collections-1.5.0-original/src/codepointinvlist/cpinvlist.rs 2006-07-23 21:21:28.000000000 -0400
+++ icu_collections-1.5.0/src/codepointinvlist/cpinvlist.rs 2024-11-23 10:42:53.464004825 -0500
@@ -1034,6 +1034,8 @@
}
#[test]
+ // Downstream-only: unconditionally disable this because we lack postcard
+ #[cfg(any())]
fn test_serde_with_postcard_roundtrip() -> Result<(), postcard::Error> {
let set = CodePointInversionList::bmp();
let set_serialized: Vec<u8> = postcard::to_allocvec(&set).unwrap();
diff -Naur icu_collections-1.5.0-original/src/codepointtrie/cptrie.rs icu_collections-1.5.0/src/codepointtrie/cptrie.rs
--- icu_collections-1.5.0-original/src/codepointtrie/cptrie.rs 2006-07-23 21:21:28.000000000 -0400
+++ icu_collections-1.5.0/src/codepointtrie/cptrie.rs 2024-11-23 10:42:58.801073739 -0500
@@ -1082,6 +1082,8 @@
#[test]
#[cfg(feature = "serde")]
+ // Downstream-only: unconditionally disable this because we lack postcard
+ #[cfg(any())]
fn test_serde_with_postcard_roundtrip() -> Result<(), postcard::Error> {
let trie = crate::codepointtrie::planes::get_planes_trie();
let trie_serialized: Vec<u8> = postcard::to_allocvec(&trie).unwrap();

@ -0,0 +1,9 @@
--- icu_collections-1.5.0/Cargo.toml 1970-01-01T00:00:01+00:00
+++ icu_collections-1.5.0/Cargo.toml 2024-12-10T19:11:54.241538+00:00
@@ -124,6 +124,3 @@
"zerovec/serde",
]
std = []
-
-[target."cfg(not(target_arch = \"wasm32\"))".dev-dependencies.criterion]
-version = "0.5.0"

@ -0,0 +1,4 @@
# Feature metapackages are not supposed to have documentation!
addFilter(r"\+[-_\w]+-devel.noarch: W: no-documentation")
# Duplicate test data files are small and not worth attempting to hardlink
addFilter(r"files-duplicate .*/tests/data/")

@ -0,0 +1,142 @@
# Generated by rust2rpm 27
%bcond check 1
%global debug_package %{nil}
%global crate icu_collections
Name: rust-icu_collections
Version: 1.5.0
Release: %autorelease
Summary: Collection of API for use in ICU libraries
License: Unicode-3.0
URL: https://crates.io/crates/icu_collections
Source: %{crates_source}
# Manually created patch for downstream crate metadata changes
# * Drop benchmark-only criterion dependency
Patch: icu_collections-fix-metadata.diff
# * Downstream-only: unconditionally skip compiling tests that would require
# postcard.
Patch10: icu_collections-1.5.0-no-postcard.patch
# * Downstream-only: unconditionally skip compiling tests that would require the
# circular (path-based) dev-dependency on the icu crate.
Patch11: icu_collections-1.5.0-no-icu-dev-dependency.patch
BuildRequires: cargo-rpm-macros >= 24
BuildRequires: tomcli
%global _description %{expand:
Collection of API for use in ICU libraries.}
%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
%{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}+bench-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+bench-devel %{_description}
This package contains library source intended for building other packages which
use the "bench" feature of the "%{crate}" crate.
%files -n %{name}+bench-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+databake-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+databake-devel %{_description}
This package contains library source intended for building other packages which
use the "databake" feature of the "%{crate}" crate.
%files -n %{name}+databake-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+serde-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+serde-devel %{_description}
This package contains library source intended for building other packages which
use the "serde" feature of the "%{crate}" crate.
%files -n %{name}+serde-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+std-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+std-devel %{_description}
This package contains library source intended for building other packages which
use the "std" feature of the "%{crate}" crate.
%files -n %{name}+std-devel
%ghost %{crate_instdir}/Cargo.toml
%prep
%autosetup -n %{crate}-%{version} -p1
# Do not depend on postcard; it is needed only for one (skipped) test.
tomcli set Cargo.toml del dev-dependencies.postcard
# Avoid a dependency on the internal icu_benchmark_macros crate
rm -rv examples/
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires -f databake,serde
%build
%cargo_build -f databake,serde
%install
%cargo_install -f databake,serde
%if %{with check}
%check
# * All doc tests use icu::collections, which would require the circular
# (path-based) dev-dependency on the icu crate.
# * Tests using databake may fail due to trivial differences in the string
# representations of generated code, such as trailing commas without semantic
# significance.
%{cargo_test -f databake,serde -- --lib -- --exact %{shrink:
--skip codepointinvlist::cpinvlist::tests::databake
--skip codepointtrie::cptrie::tests::databake
}}
%{cargo_test -f databake,serde -- --tests -- --exact %{shrink:
--skip codepointinvlist::cpinvlist::tests::databake
--skip codepointtrie::cptrie::tests::databake
}}
%endif
%changelog
%autochangelog

@ -0,0 +1,68 @@
[package]
cargo-toml-patch-comments = [
# This would be a candidate for automated patching with tomcli if it were
# an unconditional dependency, but given it is
# target.'cfg(not(target_arch = \"wasm32\"))', manual patching is easier.
"Drop benchmark-only criterion dependency",
]
[[package.extra-patches]]
number = 10
file = "icu_collections-1.5.0-no-postcard.patch"
comments = [
"""\
Downstream-only: unconditionally skip compiling tests that would require \
postcard.\
"""
]
[[package.extra-patches]]
number = 11
file = "icu_collections-1.5.0-no-icu-dev-dependency.patch"
comments = [
"""\
Downstream-only: unconditionally skip compiling tests that would require \
the circular (path-based) dev-dependency on the icu crate.\
"""
]
[features]
enable = [
# Required for tests:
"databake",
"serde",
]
[tests]
comments = [
"""\
All doc tests use icu::collections, which would require the circular \
(path-based) dev-dependency on the icu crate.\
""",
"""\
Tests using databake may fail due to trivial differences in the string \
representations of generated code, such as trailing commas without semantic \
significance.\
""",
]
run = [
"lib",
"tests",
]
skip-exact = true
skip = [
"codepointinvlist::cpinvlist::tests::databake",
"codepointtrie::cptrie::tests::databake",
]
[requires]
build = [
"tomcli",
]
[scripts.prep]
pre = [
"# Do not depend on postcard; it is needed only for one (skipped) test.",
"tomcli set Cargo.toml del dev-dependencies.postcard",
"# Avoid a dependency on the internal icu_benchmark_macros crate",
"rm -rv examples/",
]

@ -0,0 +1 @@
SHA512 (icu_collections-1.5.0.crate) = 127f1c91101ba69405b10a2590579606df766166fcf1fe6aa9a74c4900296425cba5c47a391a53a01b02026af5581f068fce4a7a400179809f7ed9922b94c0db
Loading…
Cancel
Save