Backport MR #26 to fix UI files in GTK4 (#2060868)

This commit is contained in:
Adam Williamson 2022-03-18 16:27:22 -07:00
parent dd1103e6a0
commit 0afac135ea
3 changed files with 2814 additions and 2 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
From 40b591aaa0fcbc2bf37f89909477d59a102a5fa4 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Fri, 18 Mar 2022 15:56:12 -0700
Subject: [PATCH] meson: build separate UI sources for GTK3 and GTK4 libraries
We can't just do one or the other, each build of the library
needs the correct respective UI resources.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
src/meson.build | 2 +-
src/ui/meson.build | 18 ++++++++++--------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/meson.build b/src/meson.build
index 6e1a15e4..efe3fb03 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -103,7 +103,7 @@ libnma_dep = declare_dependency(
if enable_libnma_gtk4
libnma_gtk4 = shared_library(
'nma-gtk4',
- sources: gir_sources + ui_sources,
+ sources: gir_sources + ui_sources4,
version: libversion,
include_directories: incs,
dependencies: [ deps, gtk4_dep ],
diff --git a/src/ui/meson.build b/src/ui/meson.build
index 2f8eec99..60dbaeef 100644
--- a/src/ui/meson.build
+++ b/src/ui/meson.build
@@ -1,11 +1,13 @@
-if enable_libnma_gtk4
- ui_dir = 'gtk4'
-else
- ui_dir = 'gtk3'
-endif
-
ui_sources = gnome.compile_resources(
'nma-resources',
- join_paths(ui_dir, 'nma.gresource.xml'),
- source_dir: ui_dir
+ join_paths('gtk3', 'nma.gresource.xml'),
+ source_dir: 'gtk3'
)
+
+if enable_libnma_gtk4
+ ui_sources4 = gnome.compile_resources(
+ 'nma-resources4',
+ join_paths('gtk4', 'nma.gresource.xml'),
+ source_dir: 'gtk4'
+ )
+endif
--
2.35.1

View File

@ -7,7 +7,7 @@
%global rpm_version 1.8.34
%global real_version 1.8.34
%global release_version 1
%global release_version 2
%global real_version_major %(printf '%s' '%{real_version}' | sed -n 's/^\\([1-9][0-9]*\\.[1-9][0-9]*\\)\\.[1-9][0-9]*$/\\1/p')
@ -20,13 +20,22 @@
Name: libnma
Summary: NetworkManager GUI library
Version: %{rpm_version}
Release: %{release_version}%{?dist}.1
Release: %{release_version}%{?dist}
# The entire source code is GPLv2+ except some files in shared/ which are LGPLv2+
License: GPLv2+ and LGPLv2+
URL: https://gitlab.gnome.org/GNOME/libnma/
Source0: https://download.gnome.org/sources/libnma/%{real_version_major}/%{name}-%{real_version}.tar.xz
Patch1: 0001-nm-applet-no-notifications.patch
# Include working UI resources for GTK4 so UI elements in GNOME
# Control Center provided by this package work
# https://bugzilla.redhat.com/show_bug.cgi?id=2060868
# https://gitlab.gnome.org/GNOME/libnma/-/merge_requests/26
# Rebased and squashed
Patch2: 0001-Ship-and-compile-both-GTK3-and-GTK4-UI-files.patch
# Fixup to build GTK3 and GTK4 ui sources separately for each lib
# https://gitlab.gnome.org/GNOME/libnma/-/merge_requests/26#note_1411364
Patch3: 0001-meson-build-separate-UI-sources-for-GTK3-and-GTK4-li.patch
Requires: mobile-broadband-provider-info >= %{mbp_version}
@ -149,6 +158,9 @@ files to be used for integrating GUI tools with NetworkManager.
%changelog
* Fri Mar 18 2022 Adam Williamson <awilliam@redhat.com> - 1.8.34-2
- Backport MR #26 to fix UI files in GTK4 (#2060868)
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.34-1.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild