From a69cd5a8f7c41e782dff47c96fcbdf5aab2851f0 Mon Sep 17 00:00:00 2001 From: Davide Cavalca Date: Mon, 6 Dec 2021 09:06:29 -0800 Subject: [PATCH] Initial import; Fixes: RHBZ#1982509 --- .gitignore | 1 + combine-drop-tokio-03.patch | 46 +++++++ combine-fix-metadata.diff | 41 ++++++ rust-combine.spec | 246 ++++++++++++++++++++++++++++++++++++ sources | 1 + 5 files changed, 335 insertions(+) create mode 100644 .gitignore create mode 100644 combine-drop-tokio-03.patch create mode 100644 combine-fix-metadata.diff create mode 100644 rust-combine.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cef06a3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/combine-4.6.0.crate diff --git a/combine-drop-tokio-03.patch b/combine-drop-tokio-03.patch new file mode 100644 index 0000000..cacd4b3 --- /dev/null +++ b/combine-drop-tokio-03.patch @@ -0,0 +1,46 @@ +diff -Naur a/tests/support/mod.rs b/tests/support/mod.rs +--- a/tests/support/mod.rs 1969-12-31 16:00:00.000000000 -0800 ++++ b/tests/support/mod.rs 2021-07-14 21:47:18.502065660 -0700 +@@ -61,42 +61,6 @@ + } + } + +-impl tokio_03_dep::io::AsyncRead for PartialAsyncRead +-where +- R: tokio_03_dep::io::AsyncRead + Unpin, +-{ +- fn poll_read( +- mut self: Pin<&mut Self>, +- cx: &mut task::Context<'_>, +- buf: &mut tokio_03_dep::io::ReadBuf<'_>, +- ) -> Poll> { +- match self.ops.next() { +- Some(PartialOp::Limited(n)) => { +- let len = std::cmp::min(n, buf.remaining()); +- buf.initialize_unfilled(); +- let mut sub_buf = buf.take(len); +- ready!(Pin::new(&mut self.inner).poll_read(cx, &mut sub_buf))?; +- let filled = sub_buf.filled().len(); +- buf.advance(filled); +- Poll::Ready(Ok(())) +- } +- Some(PartialOp::Err(err)) => { +- if err == io::ErrorKind::WouldBlock { +- cx.waker().wake_by_ref(); +- Poll::Pending +- } else { +- Err(io::Error::new( +- err, +- "error during read, generated by partial-io", +- )) +- .into() +- } +- } +- Some(PartialOp::Unlimited) | None => Pin::new(&mut self.inner).poll_read(cx, buf), +- } +- } +-} +- + impl tokio_dep::io::AsyncRead for PartialAsyncRead + where + R: tokio_dep::io::AsyncRead + Unpin, diff --git a/combine-fix-metadata.diff b/combine-fix-metadata.diff new file mode 100644 index 0000000..7db5717 --- /dev/null +++ b/combine-fix-metadata.diff @@ -0,0 +1,41 @@ +--- combine-4.6.0/Cargo.toml 1970-01-01T00:00:00+00:00 ++++ combine-4.6.0/Cargo.toml 2021-07-15T04:42:50.866403+00:00 +@@ -106,12 +106,6 @@ + default-features = false + package = "tokio" + +-[dependencies.tokio-03-dep] +-version = "0.3" +-optional = true +-default-features = false +-package = "tokio" +- + [dependencies.tokio-dep] + version = "1" + optional = true +@@ -139,7 +133,7 @@ + version = "1.0" + + [dev-dependencies.partial-io] +-version = "0.3" ++version = "0.5" + features = ["tokio", "quickcheck"] + + [dev-dependencies.quick-error] +@@ -151,11 +145,6 @@ + [dev-dependencies.tokio-02-dep] + version = "0.2" + features = ["fs", "io-driver", "io-util", "macros"] +-package = "tokio" +- +-[dev-dependencies.tokio-03-dep] +-version = "0.3" +-features = ["fs", "macros", "rt-multi-thread"] + package = "tokio" + + [dev-dependencies.tokio-dep] +@@ -175,4 +164,3 @@ + std = ["memchr/use_std", "bytes"] + tokio = ["tokio-dep", "futures-util-03", "pin-project-lite"] + tokio-02 = ["pin-project", "std", "tokio-02-dep", "futures-util-03", "pin-project-lite", "bytes_05"] +-tokio-03 = ["pin-project", "std", "tokio-03-dep", "futures-util-03", "pin-project-lite"] diff --git a/rust-combine.spec b/rust-combine.spec new file mode 100644 index 0000000..75b7c2d --- /dev/null +++ b/rust-combine.spec @@ -0,0 +1,246 @@ +# Generated by rust2rpm 18 +%bcond_without check +%global debug_package %{nil} + +%global crate combine + +Name: rust-%{crate} +Version: 4.6.0 +Release: %autorelease +Summary: Fast parser combinators on arbitrary streams with zero-copy support + +# Upstream license specification: MIT +License: MIT +URL: https://crates.io/crates/combine +Source: %{crates_source} +# Bump partial-io to 0.5, drop tokio-03 feature and its dependencies +Patch0: combine-fix-metadata.diff +# Drop logic for tokio-03 in a test +Patch1: combine-drop-tokio-03.patch + +ExclusiveArch: %{rust_arches} +%if %{__cargo_skip_build} +BuildArch: noarch +%endif + +BuildRequires: rust-packaging + +%global _description %{expand: +Fast parser combinators on arbitrary streams with zero-copy support.} + +%description %{_description} + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel %{_description} + +This package contains library source intended for building other packages +which use "%{crate}" crate. + +%files devel +%license LICENSE +%doc examples README.md CHANGELOG.md examples/readme.rs benches/http-requests.txt +%{cargo_registry}/%{crate}-%{version_no_tilde}/ + +%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 "default" feature of "%{crate}" crate. + +%files -n %{name}+default-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+bytes-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+bytes-devel %{_description} + +This package contains library source intended for building other packages +which use "bytes" feature of "%{crate}" crate. + +%files -n %{name}+bytes-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+bytes_05-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+bytes_05-devel %{_description} + +This package contains library source intended for building other packages +which use "bytes_05" feature of "%{crate}" crate. + +%files -n %{name}+bytes_05-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+futures-03-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+futures-03-devel %{_description} + +This package contains library source intended for building other packages +which use "futures-03" feature of "%{crate}" crate. + +%files -n %{name}+futures-03-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+futures-io-03-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+futures-io-03-devel %{_description} + +This package contains library source intended for building other packages +which use "futures-io-03" feature of "%{crate}" crate. + +%files -n %{name}+futures-io-03-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+futures-util-03-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+futures-util-03-devel %{_description} + +This package contains library source intended for building other packages +which use "futures-util-03" feature of "%{crate}" crate. + +%files -n %{name}+futures-util-03-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+mp4-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+mp4-devel %{_description} + +This package contains library source intended for building other packages +which use "mp4" feature of "%{crate}" crate. + +%files -n %{name}+mp4-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+pin-project-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+pin-project-devel %{_description} + +This package contains library source intended for building other packages +which use "pin-project" feature of "%{crate}" crate. + +%files -n %{name}+pin-project-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+pin-project-lite-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+pin-project-lite-devel %{_description} + +This package contains library source intended for building other packages +which use "pin-project-lite" feature of "%{crate}" crate. + +%files -n %{name}+pin-project-lite-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+regex-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+regex-devel %{_description} + +This package contains library source intended for building other packages +which use "regex" feature of "%{crate}" crate. + +%files -n %{name}+regex-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/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 "std" feature of "%{crate}" crate. + +%files -n %{name}+std-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+tokio-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+tokio-devel %{_description} + +This package contains library source intended for building other packages +which use "tokio" feature of "%{crate}" crate. + +%files -n %{name}+tokio-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+tokio-02-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+tokio-02-devel %{_description} + +This package contains library source intended for building other packages +which use "tokio-02" feature of "%{crate}" crate. + +%files -n %{name}+tokio-02-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+tokio-02-dep-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+tokio-02-dep-devel %{_description} + +This package contains library source intended for building other packages +which use "tokio-02-dep" feature of "%{crate}" crate. + +%files -n %{name}+tokio-02-dep-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml + +%package -n %{name}+tokio-dep-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+tokio-dep-devel %{_description} + +This package contains library source intended for building other packages +which use "tokio-dep" feature of "%{crate}" crate. + +%files -n %{name}+tokio-dep-devel +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/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 +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..706bd28 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (combine-4.6.0.crate) = 1cece5ceb47e35bc0afa10a199f600d01326fb3594b6fac81ab3abbdaa3977db148b47a38daf9fdc7abb1bb9873c40ba38a4e1760285b589677d24c079b17983