diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f4b9491 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/gst-plugin-gtk4-0.10.10.crate diff --git a/gst-plugin-gtk4-fix-metadata-auto.diff b/gst-plugin-gtk4-fix-metadata-auto.diff new file mode 100644 index 0000000..b2eedc4 --- /dev/null +++ b/gst-plugin-gtk4-fix-metadata-auto.diff @@ -0,0 +1,38 @@ +--- gst-plugin-gtk4-0.10.10/Cargo.toml 2023-09-28T08:36:41+00:00 ++++ gst-plugin-gtk4-0.10.10/Cargo.toml 2023-09-28T08:36:52.427250+00:00 +@@ -133,35 +133,3 @@ + "gst_gl_x11", + ] + +-[target."cfg(target_os = \"macos\")".dependencies.gst_gl] +-version = "0.20" +-features = ["v1_16"] +-package = "gstreamer-gl" +- +-[target."cfg(target_os = \"macos\")".dependencies.gtk] +-version = "0.6" +-features = ["v4_6"] +-package = "gtk4" +- +-[target."cfg(target_os = \"windows\")".dependencies.gdk_win32] +-version = "0.6" +-features = ["v4_4"] +-package = "gdk4-win32" +- +-[target."cfg(target_os = \"windows\")".dependencies.gst_gl] +-version = "0.20" +-features = ["v1_20"] +-package = "gstreamer-gl" +- +-[target."cfg(target_os = \"windows\")".dependencies.gtk] +-version = "0.6" +-features = ["v4_6"] +-package = "gtk4" +- +-[target."cfg(target_os = \"windows\")".dependencies.windows-sys] +-version = "0.48" +-features = [ +- "Win32_Graphics_OpenGL", +- "Win32_Foundation", +- "Win32_Graphics_Gdi", +-] diff --git a/gst-plugin-gtk4-fix-metadata.diff b/gst-plugin-gtk4-fix-metadata.diff new file mode 100644 index 0000000..6e0d828 --- /dev/null +++ b/gst-plugin-gtk4-fix-metadata.diff @@ -0,0 +1,13 @@ +--- gst-plugin-gtk4-0.10.10/Cargo.toml 2023-09-28T08:36:41+00:00 ++++ gst-plugin-gtk4-0.10.10/Cargo.toml 2023-09-28T08:36:58.909339+00:00 +@@ -116,10 +116,6 @@ + "gst_gl", + "gst_gl_wayland", + ] +-winegl = [ +- "gdk_win32/egl", +- "gst_gl_egl", +-] + x11egl = [ + "gtk/v4_6", + "gdk_x11", diff --git a/rust-gst-plugin-gtk4.spec b/rust-gst-plugin-gtk4.spec new file mode 100644 index 0000000..f6b3901 --- /dev/null +++ b/rust-gst-plugin-gtk4.spec @@ -0,0 +1,254 @@ +# Generated by rust2rpm 24 +%bcond_without check + +%global crate gst-plugin-gtk4 + +Name: rust-gst-plugin-gtk4 +Version: 0.10.10 +Release: %autorelease +Summary: GStreamer GTK 4 Sink element and Paintable widget + +# Apache-2.0 OR MIT +# MIT +# MIT OR Apache-2.0 +# MPL-2.0 +# Unlicense OR MIT +License: (Apache-2.0 OR MIT) AND MIT AND (MIT OR Apache-2.0) AND MPL-2.0 AND (Unlicense OR MIT) +URL: https://crates.io/crates/gst-plugin-gtk4 +Source: %{crates_source} +# Automatically generated patch to strip foreign dependencies +Patch: gst-plugin-gtk4-fix-metadata-auto.diff +# Remove foreign winegl feature. Normally we'd use rust2rpm.conf to exclude +# unwanted features, but in this crate, rust2rpm errors out when parsing the +# winegl feature so we need to patch it before rust2rpm sees it to work this +# around. +Patch: gst-plugin-gtk4-fix-metadata.diff + +BuildRequires: rust-packaging >= 21 + +%global _description %{expand: +GStreamer GTK 4 Sink element and Paintable widget.} + +%description %{_description} + +%package -n gstreamer1-plugin-gtk4 +Summary: %{summary} + +%description -n gstreamer1-plugin-gtk4 %{_description} + +%files -n gstreamer1-plugin-gtk4 +%license LICENSE-MPL-2.0 +%license LICENSE.dependencies +%doc README.md +%{_libdir}/gstreamer-1.0/libgstgtk4.so + +%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-MPL-2.0 +%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}+capi-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+capi-devel %{_description} + +This package contains library source intended for building other packages which +use the "capi" feature of the "%{crate}" crate. + +%files -n %{name}+capi-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+doc-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+doc-devel %{_description} + +This package contains library source intended for building other packages which +use the "doc" feature of the "%{crate}" crate. + +%files -n %{name}+doc-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+gdk_wayland-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+gdk_wayland-devel %{_description} + +This package contains library source intended for building other packages which +use the "gdk_wayland" feature of the "%{crate}" crate. + +%files -n %{name}+gdk_wayland-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+gdk_x11-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+gdk_x11-devel %{_description} + +This package contains library source intended for building other packages which +use the "gdk_x11" feature of the "%{crate}" crate. + +%files -n %{name}+gdk_x11-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+gst_gl-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+gst_gl-devel %{_description} + +This package contains library source intended for building other packages which +use the "gst_gl" feature of the "%{crate}" crate. + +%files -n %{name}+gst_gl-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+gst_gl_egl-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+gst_gl_egl-devel %{_description} + +This package contains library source intended for building other packages which +use the "gst_gl_egl" feature of the "%{crate}" crate. + +%files -n %{name}+gst_gl_egl-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+gst_gl_wayland-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+gst_gl_wayland-devel %{_description} + +This package contains library source intended for building other packages which +use the "gst_gl_wayland" feature of the "%{crate}" crate. + +%files -n %{name}+gst_gl_wayland-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+gst_gl_x11-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+gst_gl_x11-devel %{_description} + +This package contains library source intended for building other packages which +use the "gst_gl_x11" feature of the "%{crate}" crate. + +%files -n %{name}+gst_gl_x11-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+static-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+static-devel %{_description} + +This package contains library source intended for building other packages which +use the "static" feature of the "%{crate}" crate. + +%files -n %{name}+static-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+wayland-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+wayland-devel %{_description} + +This package contains library source intended for building other packages which +use the "wayland" feature of the "%{crate}" crate. + +%files -n %{name}+wayland-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+x11egl-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+x11egl-devel %{_description} + +This package contains library source intended for building other packages which +use the "x11egl" feature of the "%{crate}" crate. + +%files -n %{name}+x11egl-devel +%ghost %{crate_instdir}/Cargo.toml + +%package -n %{name}+x11glx-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+x11glx-devel %{_description} + +This package contains library source intended for building other packages which +use the "x11glx" feature of the "%{crate}" crate. + +%files -n %{name}+x11glx-devel +%ghost %{crate_instdir}/Cargo.toml + +%prep +%autosetup -n %{crate}-%{version_no_tilde} -p1 +%cargo_prep + +%generate_buildrequires +%cargo_generate_buildrequires -a +echo 'cargo-c' + +%build +%cargo_build -a +%__cargo cbuild --release \ + --destdir=%{buildroot} \ + --prefix=%{_prefix} \ + --libdir=%{_libdir} \ + --includedir=%{_includedir} \ + --pkgconfigdir=%{_libdir}/pkgconfig +# write license summary and breakdown +%cargo_license_summary +%{cargo_license} > LICENSE.dependencies + +%install +%cargo_install -a +%__cargo cinstall --release \ + --destdir=%{buildroot} \ + --prefix=%{_prefix} \ + --libdir=%{_libdir} \ + --includedir=%{_includedir} \ + --pkgconfigdir=%{_libdir}/pkgconfig +# remove statically linked library +rm -v %{buildroot}/%{_libdir}/gstreamer-1.0/libgstgtk4.a +# remove unnecessary pkgconfig file +rm -v %{buildroot}/%{_libdir}/pkgconfig/gstgtk4.pc + +%if %{with check} +%check +%cargo_test -a +%endif + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..6bd516d --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (gst-plugin-gtk4-0.10.10.crate) = cd298473c3f139834be4f92c71a038f2f13404ce5e0c7b8b1309c92a9e5940d87e832eac0dc7ebad94b5b85544d1fb3680e0f7dbd008066b7a7c3afd58d0f4bc