[packages/loupe] - added x32 patch, disable debugsource packages

qboosh qboosh at pld-linux.org
Sun Sep 17 10:42:37 CEST 2023


commit 8662f47c96fca179bf7b5d399968712cf88dfa4d
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Sep 17 09:33:12 2023 +0200

    - added x32 patch, disable debugsource packages

 loupe-x32.patch | 19 +++++++++++++++++++
 loupe.spec      | 16 +++++++++++++++-
 2 files changed, 34 insertions(+), 1 deletion(-)
---
diff --git a/loupe.spec b/loupe.spec
index 4ed5937..fccd4c1 100644
--- a/loupe.spec
+++ b/loupe.spec
@@ -8,6 +8,7 @@ License:	GPL v3+
 Group:		X11/Applications/Graphics
 Source0:	https://download.gnome.org/sources/loupe/44/%{name}-%{version}.tar.xz
 # Source0-md5:	06d933b55f4f0ab0dd7b397f3162320e
+Patch0:		%{name}-x32.patch
 URL:		https://gitlab.gnome.org/GNOME/loupe
 BuildRequires:	cargo
 BuildRequires:	gtk4-devel >= 4.11.2
@@ -17,7 +18,7 @@ BuildRequires:	libheif-devel >= 1.14.2
 BuildRequires:	libgweather4-devel >= 4.0.0
 BuildRequires:	meson >= 0.59.0
 BuildRequires:	ninja >= 1.5
-BuildRequires:	rpmbuild(macros) >= 1.736
+BuildRequires:	rpmbuild(macros) >= 2.004
 BuildRequires:	rust
 BuildRequires:	tar >= 1:1.22
 BuildRequires:	xz
@@ -30,8 +31,12 @@ Requires:	lcms2 >= 2.12.0
 Requires:	libadwaita >= 1.4
 Requires:	libheif >= 1.14.2
 Requires:	libgweather4 >= 4.0.0
+ExclusiveArch:	%{rust_arches}
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+# debugsource packages don't support rust (or require adding some flags to rust/cargo)
+%define		_debugsource_packages	0
+
 %description
 Loupe is an image viewer application written with GTK 4, Libadwaita
 and Rust.
@@ -42,8 +47,14 @@ oraz języka Rust.
 
 %prep
 %setup -q
+%ifarch x32
+%patch0 -p1
+%endif
 
 %build
+%ifarch x32
+export PKG_CONFIG_ALLOW_CROSS=1
+%endif
 %meson build
 
 %ninja_build -C build
@@ -51,6 +62,9 @@ oraz języka Rust.
 %install
 rm -rf $RPM_BUILD_ROOT
 
+%ifarch x32
+export PKG_CONFIG_ALLOW_CROSS=1
+%endif
 %ninja_install -C build
 
 %find_lang %{name}
diff --git a/loupe-x32.patch b/loupe-x32.patch
new file mode 100644
index 0000000..dc75803
--- /dev/null
+++ b/loupe-x32.patch
@@ -0,0 +1,19 @@
+--- loupe-44.3/src/meson.build.orig	2023-05-11 20:23:53.000000000 +0200
++++ loupe-44.3/src/meson.build	2023-09-16 21:26:51.040057525 +0200
+@@ -16,6 +16,7 @@ run_command(
+ )
+ 
+ cargo_options = [ '--manifest-path', source_root / 'Cargo.toml' ]
++cargo_options += [ '--target', 'x86_64-unknown-linux-gnux32' ]
+ cargo_options += [ '--target-dir', build_root / 'src' ]
+ 
+ if get_option('profile') == 'development'
+@@ -52,7 +53,7 @@ copy_binary = custom_target(
+   output: meson.project_name(),
+   command: [
+     'cp',
+-    'src' / rust_target / meson.project_name(),
++    'src' / 'x86_64-unknown-linux-gnux32' / rust_target / meson.project_name(),
+     '@OUTPUT@',
+   ],
+ )
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/loupe.git/commitdiff/8662f47c96fca179bf7b5d399968712cf88dfa4d



More information about the pld-cvs-commit mailing list