From 646a29142a9cf2f67dd6ecc54f0ba5e48a495503 Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sat, 11 Oct 2025 00:09:31 +0800 Subject: [PATCH] fix build with recent pango --- ...port-compile-when-using-Pango-1.56.2.patch | 33 +++++++++++++++++++ fwupd.spec | 17 ++++++---- 2 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 backport-compile-when-using-Pango-1.56.2.patch diff --git a/backport-compile-when-using-Pango-1.56.2.patch b/backport-compile-when-using-Pango-1.56.2.patch new file mode 100644 index 0000000..42c7a39 --- /dev/null +++ b/backport-compile-when-using-Pango-1.56.2.patch @@ -0,0 +1,33 @@ +From d0d3eff666d2a6d9c09346ea050eed1c78271f0a Mon Sep 17 00:00:00 2001 +From: Richard Hughes +Date: Fri, 14 Mar 2025 19:13:42 +0000 +Subject: [PATCH] trivial: Fix compile when using Pango >= 1.56.2 + +Fixes https://github.com/fwupd/fwupd/issues/8587 +--- + plugins/uefi-capsule/make-images.py | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/plugins/uefi-capsule/make-images.py b/plugins/uefi-capsule/make-images.py +index d4c2242de5f0..a8641d61282a 100755 +--- a/plugins/uefi-capsule/make-images.py ++++ b/plugins/uefi-capsule/make-images.py +@@ -141,8 +141,16 @@ def main(args) -> int: + items = Pango.itemize(pctx, label_translated, 0, length, attrs, None) + if not items: + continue +- gs = Pango.GlyphString() +- Pango.shape(label_translated, length, items[0].analysis, gs) ++ try: ++ # urgh, https://gitlab.gnome.org/GNOME/pango/-/merge_requests/829 ++ # -- if we depend on Pango >= 1.56.2 we can drop the fallback ++ # ++ # ...or if we depend on python3-gobject >= 3.51.0 we can use the nicer: ++ # len(inspect.signature(Pango.shape).parameters) ++ gs = Pango.shape(label_translated, length, items[0].analysis) ++ except TypeError: ++ gs = Pango.GlyphString() ++ Pango.shape(label_translated, length, items[0].analysis, gs) + del img, cctx, pctx, layout + + def find_size(fs, f, data): diff --git a/fwupd.spec b/fwupd.spec index b661181..adc939a 100644 --- a/fwupd.spec +++ b/fwupd.spec @@ -43,7 +43,7 @@ Name: fwupd Version: 1.9.4 -Release: 3 +Release: 4 License: LGPL-2.1-or-later Summary: Make updating firmware on Linux automatic, safe and reliable URL: https://github.com/fwupd/fwupd @@ -69,6 +69,7 @@ Patch0: fwupd-efi.patch Patch1: riscv64.patch Patch2: fwupd-add-loongarch64-spoort.patch Patch3: skip-fu-self-test-for-loongarch64.patch +Patch4: backport-compile-when-using-Pango-1.56.2.patch BuildRequires: libcbor libcbor-devel BuildRequires: efi-srpm-macros @@ -178,6 +179,7 @@ Man pages and other related documents for fwupd. %prep %setup -q -n %{name}-%{version} %patch -P 0 -p1 +%patch -P 4 -p1 mkdir -p subprojects/fwupd-efi tar xfs %{SOURCE2} -C subprojects/fwupd-efi --strip-components=1 @@ -189,8 +191,8 @@ cp %{SOURCE14} subprojects/fwupd-efi/efi/lds %endif %ifarch loongarch64 -%patch2 -p1 -%patch3 -p1 +%patch -P2 -p1 +%patch -P3 -p1 cp %{SOURCE15} subprojects/fwupd-efi/efi/crt0 cp %{SOURCE16} subprojects/fwupd-efi/efi/lds %endif @@ -321,8 +323,6 @@ for b in $(ls %{buildroot}/usr/bin/ ); do chrpath -d %{buildroot}/usr/bin/$b ;d mkdir -p %{buildroot}/etc/ld.so.conf.d echo "%{_libdir}/%{name}-%{version}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf echo "%{_libdir}/%{name}-%{version}" > %{buildroot}/etc/ld.so.conf.d/%{name}-devel-%{_arch}.conf -echo "/usr/share/doc/fwupd/libfwupdplugin/" >> %{buildroot}/etc/ld.so.conf.d/%{name}-devel-%{_arch}.conf -echo "/usr/share/doc/fwupd/libfwupd/" >> %{buildroot}/etc/ld.so.conf.d/%{name}-devel-%{_arch}.conf %post /sbin/ldconfig @@ -475,8 +475,7 @@ done %dir %{_sysconfdir}/fwupd/remotes.d %config(noreplace)%{_sysconfdir}/fwupd/remotes.d/fwupd-tests.conf %endif -%config(noreplace) /etc/ld.so.conf.d/%{name}-devel-%{_arch}.conf - +/etc/ld.so.conf.d/%{name}-devel-%{_arch}.conf %files help %{_mandir}/man1/* @@ -484,6 +483,10 @@ done %{_mandir}/man8/* %changelog +* Sat Oct 11 2025 Funda Wang - 1.9.4-4 +- fix build with recent pango +- drop uselss ld.conf for documentation files + * Wed Aug 13 2025 Qin Fandong - 1.9.4-3 - Remove build requires protobuf-c* and disable plugin logitech-bulkcontroller which to upgrade the firmware on Logitech Video Collaboration products. -- Gitee