# Generated by rust2rpm 28 %bcond check 1 %global debug_package %{nil} %global crate icu_datetime Name: rust-icu_datetime Version: 2.1.1 Release: %autorelease Summary: Human-readable formatting of dates, times, and time zones in hundreds of locales License: Unicode-3.0 URL: https://crates.io/crates/icu_datetime Source: %{crates_source} # Manually created patch for downstream crate metadata changes # * Restore most dev-dependencies that were stripped during publication, # omitting some that are used only for disabled doctests. See # https://github.com/unicode-org/icu4x/issues/7196 for the rather abstruse # reasons why this is necessary. We use tomcli to restore dev-dependencies on # component crates that are versioned the same as ICU4X overall so that we can # copy the correct version bounds from the regular dependencies. Patch: icu_datetime-fix-metadata.diff # * https://github.com/unicode-org/icu4x/pull/7750/changes/61d47e18495ecda840d2dfbadbd32fd5e6091e34 # * Part of: “In component crates, limit use of the icu crate to doctests,” # https://github.com/unicode-org/icu4x/pull/7750. # * Backported to icu@2.1.0 tag (ICU4X 2.1.1) Patch10: 0001-In-icu_datetime-limit-use-of-the-icu-crate-to-doctes.patch # * Downstream-only: omit a test that would require icu_provider_blob Patch11: 0002-Downstream-only-omit-a-test-that-would-require-icu_p.patch BuildRequires: cargo-rpm-macros >= 24 BuildRequires: tomcli %global _description %{expand: Human-readable formatting of dates, times, and time zones in hundreds of locales.} %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}+compiled_data-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+compiled_data-devel %{_description} This package contains library source intended for building other packages which use the "compiled_data" feature of the "%{crate}" crate. %files -n %{name}+compiled_data-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+datagen-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+datagen-devel %{_description} This package contains library source intended for building other packages which use the "datagen" feature of the "%{crate}" crate. %files -n %{name}+datagen-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+experimental-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+experimental-devel %{_description} This package contains library source intended for building other packages which use the "experimental" feature of the "%{crate}" crate. %files -n %{name}+experimental-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+ixdtf-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+ixdtf-devel %{_description} This package contains library source intended for building other packages which use the "ixdtf" feature of the "%{crate}" crate. %files -n %{name}+ixdtf-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+logging-devel Summary: %{summary} BuildArch: noarch %description -n %{name}+logging-devel %{_description} This package contains library source intended for building other packages which use the "logging" feature of the "%{crate}" crate. %files -n %{name}+logging-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 %prep %autosetup -n %{crate}-%{version} -p1 # Restore icu_calendar dev-dependency, which is path-based and was therefore # removed by Cargo.toml normalization. We script this rather than using a patch # because the version bound should be based on the ICU4X version, and we don’t # want to constantly update the patch. tomcli set Cargo.toml str dev-dependencies.icu_calendar.version '~%{version}' tomcli set Cargo.toml list dev-dependencies.icu_calendar.features \ ixdtf unstable # Similarly, restore the icu_time dev-dependency. tomcli set Cargo.toml str dev-dependencies.icu_time.version '~%{version}' tomcli set Cargo.toml list dev-dependencies.icu_time.features ixdtf alloc %cargo_prep %generate_buildrequires %cargo_generate_buildrequires -a %build %cargo_build -a %install %cargo_install -a %if %{with check} %check # * Very many doctests have circular dependencies on the top-level icu crate, # enough that it would be very tedious to patch them all out. %cargo_test -a -- --lib %cargo_test -a -- --test datetime %cargo_test -a -- --test hijri_iran %cargo_test -a -- --test pattern_serialization %cargo_test -a -- --test resolved_components %cargo_test -a -- --test simple_test %cargo_test -a -- --test skeleton_serialization %endif %changelog %autochangelog