The package rpms/rust-pipewire.git has added or updated architecture specific content in
its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/rust-pipewire.git/commit/?id=e518...
https://src.fedoraproject.org/cgit/rpms/rust-pipewire.git/commit/?id=4b30...
https://src.fedoraproject.org/cgit/rpms/rust-pipewire.git/commit/?id=ae20....
Change:
-%ifarch %{arm} %{ix86}
+%ifarch %{ix86} x86_64
+%ifarch %{arm} %{ix86}
Thanks.
Full change:
============
commit e51821d41698b1f5c426eaf27c5057f460e972f8
Author: Michel Alexandre Salim <salimma(a)fedoraproject.org>
Date: Mon Jan 31 17:45:38 2022 -0800
Rework patches
Signed-off-by: Michel Alexandre Salim <salimma(a)fedoraproject.org>
diff --git a/pipewire-0.4.1-cast-on-32bit.patch b/pipewire-0.4.1-cast-on-32bit.patch
index ff5f19f..c48133d 100644
--- a/pipewire-0.4.1-cast-on-32bit.patch
+++ b/pipewire-0.4.1-cast-on-32bit.patch
@@ -1,12 +1,38 @@
diff -ruN pipewire-0.4.1/src/loop_.rs pipewire-0.4.1-cast-on-32bit/src/loop_.rs
--- pipewire-0.4.1/src/loop_.rs 1973-11-29 13:33:09.000000000 -0800
-+++ pipewire-0.4.1-cast-on-32bit/src/loop_.rs 2022-01-31 16:03:11.772091123 -0800
-@@ -411,7 +411,7 @@
++++ pipewire-0.4.1-cast-on-32bit/src/loop_.rs 2022-01-31 18:10:51.007062309 -0800
+@@ -408,12 +408,34 @@
+ /// # Panics
+ /// The provided durations seconds must fit in an i64. Otherwise, this function will
panic.
+ pub fn update_timer(&self, value: Option<Duration>, interval:
Option<Duration>) -> SpaResult {
++ #[cfg(target_pointer_width = "64")]
fn duration_to_timespec(duration: Duration) -> spa_sys::timespec {
spa_sys::timespec {
tv_sec: duration.as_secs().try_into().expect("Duration too
long"),
-- tv_nsec: duration.subsec_nanos().into(),
-+ tv_nsec: (duration.subsec_nanos() as i32).into(),
+ tv_nsec: duration.subsec_nanos().into(),
}
}
++ // fix for this error on 32-bit architectures
++ // error[E0277]: the trait bound `i32: From<u32>` is not satisfied
++ // --> src/loop_.rs:414:50
++ // |
++ // 414 | tv_nsec: duration.subsec_nanos().into(),
++ // | ^^^^ the trait
`From<u32>` is not implemented for `i32`
++ // |
++ // = help: the following implementations were found:
++ // <i32 as From<NonZeroI32>>
++ // <i32 as From<bool>>
++ // <i32 as From<i16>>
++ // <i32 as From<i8>>
++ // and 3 others
++ // = note: required because of the requirements on the impl of
`Into<i32>` for `u32`
++ #[cfg(target_pointer_width = "32")]
++ fn duration_to_timespec(duration: Duration) -> spa_sys::timespec {
++ spa_sys::timespec {
++ tv_sec: duration.as_secs().try_into().expect("Duration too
long"),
++ tv_nsec: (duration.subsec_nanos() as i32).into(),
++ }
++ }
+ let value = duration_to_timespec(value.unwrap_or_default());
+ let interval = duration_to_timespec(interval.unwrap_or_default());
diff --git a/pipewire-0.4.1-gate-x86-tests.patch b/pipewire-0.4.1-gate-x86-tests.patch
new file mode 100644
index 0000000..106d5d7
--- /dev/null
+++ b/pipewire-0.4.1-gate-x86-tests.patch
@@ -0,0 +1,23 @@
+diff -ruN pipewire-0.4.1/src/properties.rs
pipewire-0.4.1-gate-x86-tests/src/properties.rs
+--- pipewire-0.4.1/src/properties.rs 1973-11-29 13:33:09.000000000 -0800
++++ pipewire-0.4.1-gate-x86-tests/src/properties.rs 2022-01-31 17:34:53.086613397 -0800
+@@ -262,6 +262,19 @@
+ assert_eq!(Some("V1"), props2.get("K1"));
+ }
+
++ // fails outside x86* arches with:
++ // error[E0308]: mismatched types
++ // --> src/properties.rs:270:24
++ // |
++ // 270 | let dict = static_dict! { "K0" => "V0"
};
++ // | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found
`i8`
++ // |
++ // = note: expected raw pointer `*const u8`
++ // found raw pointer `*const i8`
++ // = note: this error originates in the macro `static_dict` (in Nightly builds,
run with -Z macro-backtrace for more info)
++ //
++ // For more information about this error, try `rustc --explain E0308`.
++ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
+ #[test]
+ fn from_dict() {
+ use spa::static_dict;
diff --git a/rust-pipewire.spec b/rust-pipewire.spec
index 33b8314..57bb737 100644
--- a/rust-pipewire.spec
+++ b/rust-pipewire.spec
@@ -1,12 +1,5 @@
# Generated by rust2rpm 20
-%ifarch %{ix86} x86_64
%bcond_without check
-%else
-# armv7hl, aarch64, ppc64le, s390:
-# the test using static_dict! is failing with E0308
-# expected *const u8, got *const i8
-%bcond_without check
-%endif
%global debug_package %{nil}
%global crate pipewire
@@ -20,20 +13,11 @@ Summary: Rust bindings for PipeWire
License: MIT
URL:
https://crates.io/crates/pipewire
Source: %{crates_source}
-# error[E0277]: the trait bound `i32: From<u32>` is not satisfied
-# --> src/loop_.rs:414:50
-# |
-# 414 | tv_nsec: duration.subsec_nanos().into(),
-# | ^^^^ the trait `From<u32>`
is not implemented for `i32`
-# |
-# = help: the following implementations were found:
-# <i32 as From<NonZeroI32>>
-# <i32 as From<bool>>
-# <i32 as From<i16>>
-# <i32 as From<i8>>
-# and 3 others
-# = note: required because of the requirements on the impl of `Into<i32>` for
`u32`
+# duration.subsec_nanos() is u32 on 32-bit, needs casting
Patch0: %{crate}-0.4.1-cast-on-32bit.patch
+# the test using static_dict! is failing with E0308
+# expected *const u8, got *const i8
+Patch1: %{crate}-0.4.1-gate-x86-tests.patch
ExclusiveArch: %{rust_arches}
@@ -70,10 +54,7 @@ use the "default" feature of the "%{crate}" crate.
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
%prep
-%setup -n %{crate}-%{version_no_tilde} -q
-%ifarch %{arm} %{ix86}
-%patch0 -p1
-%endif
+%autosetup -n %{crate}-%{version_no_tilde} -p1
%cargo_prep
%generate_buildrequires
commit 4b30edc116f7e33a7a16b9ba2e6e61dc7f6663b6
Author: Michel Alexandre Salim <salimma(a)fedoraproject.org>
Date: Mon Jan 31 16:40:06 2022 -0800
Flip the test gating
Signed-off-by: Michel Alexandre Salim <salimma(a)fedoraproject.org>
diff --git a/rust-pipewire.spec b/rust-pipewire.spec
index 30c7d3c..33b8314 100644
--- a/rust-pipewire.spec
+++ b/rust-pipewire.spec
@@ -1,5 +1,5 @@
# Generated by rust2rpm 20
-%ifnarch %{ix86} x86_64
+%ifarch %{ix86} x86_64
%bcond_without check
%else
# armv7hl, aarch64, ppc64le, s390:
commit ae205384fcfaa9784b761e25c043c78561dc7199
Author: Michel Alexandre Salim <salimma(a)fedoraproject.org>
Date: Mon Jan 31 14:42:59 2022 -0800
Initial Fedora package
Signed-off-by: Michel Alexandre Salim <salimma(a)fedoraproject.org>
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b685cee
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/pipewire-0.4.1.crate
diff --git a/pipewire-0.4.1-cast-on-32bit.patch b/pipewire-0.4.1-cast-on-32bit.patch
new file mode 100644
index 0000000..ff5f19f
--- /dev/null
+++ b/pipewire-0.4.1-cast-on-32bit.patch
@@ -0,0 +1,12 @@
+diff -ruN pipewire-0.4.1/src/loop_.rs pipewire-0.4.1-cast-on-32bit/src/loop_.rs
+--- pipewire-0.4.1/src/loop_.rs 1973-11-29 13:33:09.000000000 -0800
++++ pipewire-0.4.1-cast-on-32bit/src/loop_.rs 2022-01-31 16:03:11.772091123 -0800
+@@ -411,7 +411,7 @@
+ fn duration_to_timespec(duration: Duration) -> spa_sys::timespec {
+ spa_sys::timespec {
+ tv_sec: duration.as_secs().try_into().expect("Duration too
long"),
+- tv_nsec: duration.subsec_nanos().into(),
++ tv_nsec: (duration.subsec_nanos() as i32).into(),
+ }
+ }
+
diff --git a/rust-pipewire.spec b/rust-pipewire.spec
new file mode 100644
index 0000000..30c7d3c
--- /dev/null
+++ b/rust-pipewire.spec
@@ -0,0 +1,94 @@
+# Generated by rust2rpm 20
+%ifnarch %{ix86} x86_64
+%bcond_without check
+%else
+# armv7hl, aarch64, ppc64le, s390:
+# the test using static_dict! is failing with E0308
+# expected *const u8, got *const i8
+%bcond_without check
+%endif
+%global debug_package %{nil}
+
+%global crate pipewire
+
+Name: rust-%{crate}
+Version: 0.4.1
+Release: %autorelease
+Summary: Rust bindings for PipeWire
+
+# Upstream license specification: MIT
+License: MIT
+URL:
https://crates.io/crates/pipewire
+Source: %{crates_source}
+# error[E0277]: the trait bound `i32: From<u32>` is not satisfied
+# --> src/loop_.rs:414:50
+# |
+# 414 | tv_nsec: duration.subsec_nanos().into(),
+# | ^^^^ the trait `From<u32>`
is not implemented for `i32`
+# |
+# = help: the following implementations were found:
+# <i32 as From<NonZeroI32>>
+# <i32 as From<bool>>
+# <i32 as From<i16>>
+# <i32 as From<i8>>
+# and 3 others
+# = note: required because of the requirements on the impl of `Into<i32>` for
`u32`
+Patch0: %{crate}-0.4.1-cast-on-32bit.patch
+
+ExclusiveArch: %{rust_arches}
+
+BuildRequires: rust-packaging
+
+%global _description %{expand:
+Rust bindings for PipeWire.}
+
+%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
+%doc README.md
+%{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 the "default" feature of the "%{crate}" crate.
+
+%files -n %{name}+default-devel
+%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
+
+%prep
+%setup -n %{crate}-%{version_no_tilde} -q
+%ifarch %{arm} %{ix86}
+%patch0 -p1
+%endif
+%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..9da7f1f
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (pipewire-0.4.1.crate) =
68b7d7932effd327411901b7348a64a6be8fe0cb0b4586b62c5c6397afc7d3a8f4975a8df2b2084b9e1a81ea621269aeba18982275cf09142e86fb5318f96c0e