diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..839ccbc --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/phf_shared-0.7.21.crate diff --git a/0001-Remove-unicase-support.patch b/0001-Remove-unicase-support.patch new file mode 100644 index 0000000..b6246c8 --- /dev/null +++ b/0001-Remove-unicase-support.patch @@ -0,0 +1,47 @@ +From 6c30f50f02209070090849e9f0d996353280361b Mon Sep 17 00:00:00 2001 +From: Steven Fackler +Date: Sat, 13 Jan 2018 15:41:15 -0800 +Subject: [PATCH] Remove unicase support + +It's out of date, and was only added for Servo which no longer uses it. + +Closes #113 +Closes #109 +Closes #114 +--- + phf_shared/src/lib.rs | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/phf_shared/src/lib.rs b/phf_shared/src/lib.rs +index 7656c69..43074fd 100644 +--- a/phf_shared/src/lib.rs ++++ b/phf_shared/src/lib.rs +@@ -6,9 +6,6 @@ extern crate std as core; + + extern crate siphasher; + +-#[cfg(feature = "unicase")] +-extern crate unicase; +- + use core::hash::{Hasher, Hash}; + use siphasher::sip::SipHasher13; + +@@ -110,15 +107,6 @@ impl PhfHash for [u8] { + } + } + +-#[cfg(feature = "unicase")] +-impl PhfHash for unicase::UniCase +-where unicase::UniCase: Hash { +- #[inline] +- fn phf_hash(&self, state: &mut H) { +- self.hash(state) +- } +-} +- + macro_rules! sip_impl( + (le $t:ty) => ( + impl PhfHash for $t { +-- +2.16.1 + diff --git a/phf_shared-0.7.21-fix-metadata.diff b/phf_shared-0.7.21-fix-metadata.diff new file mode 100644 index 0000000..5ebaa52 --- /dev/null +++ b/phf_shared-0.7.21-fix-metadata.diff @@ -0,0 +1,7 @@ +--- phf_shared-0.7.21/Cargo.toml 2017-01-19T09:16:46+01:00 ++++ phf_shared-0.7.21/Cargo.toml 2018-01-24T14:32:56.215941+01:00 +@@ -17,4 +17,3 @@ + + [dependencies] + siphasher = "0.2" +-unicase = { version = "1.4", optional = true } diff --git a/rust-phf_shared.spec b/rust-phf_shared.spec new file mode 100644 index 0000000..8ef74aa --- /dev/null +++ b/rust-phf_shared.spec @@ -0,0 +1,63 @@ +# Generated by rust2rpm +%bcond_without check +%global debug_package %{nil} + +%global crate phf_shared + +Name: rust-%{crate} +Version: 0.7.21 +Release: 1%{?dist} +Summary: Support code shared by PHF libraries + +# https://github.com/sfackler/rust-phf/pull/118 +License: MIT +URL: https://crates.io/crates/phf_shared +Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate +# Initial patched metadata +# * Remove unihash dependency, https://github.com/sfackler/rust-phf/pull/117 +Patch0: phf_shared-0.7.21-fix-metadata.diff +# Really remove unihash +Patch1: 0001-Remove-unicase-support.patch + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging +# [dependencies] +BuildRequires: (crate(siphasher) >= 0.2.0 with crate(siphasher) < 0.3.0) + +%description +%{summary}. + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel +Support code shared by PHF libraries. + +This package contains library source intended for building other packages +which use %{crate} from crates.io. + +%prep +%autosetup -n %{crate}-%{version} -N +%patch0 -p1 +%patch1 -p2 +%cargo_prep + +%build +%cargo_build + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif + +%files devel +%{cargo_registry}/%{crate}-%{version}/ + +%changelog +* Wed Jan 24 2018 Igor Gnatenko - 0.7.21-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..ac2c237 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (phf_shared-0.7.21.crate) = ac92bbbeaedcbd02d3e62a9c7d0c6f22abeeffc5c7527c764b3e9138a2821dca667a1d3f29178e812b6d81ac50d5e6562b929650a0ee66fbb8d1c15366ead279