Blame SOURCES/0002-Build-against-gtk3-instead-of-gtk2.patch

f5c53a
From ad4ecfd29c29f6895aaf02092e6574299a2b5aa9 Mon Sep 17 00:00:00 2001
f5c53a
From: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
f5c53a
Date: Fri, 10 Jul 2020 03:12:51 +0200
f5c53a
Subject: [PATCH 02/18] Build against gtk3 instead of gtk2
f5c53a
MIME-Version: 1.0
f5c53a
Content-Type: text/plain; charset=UTF-8
f5c53a
Content-Transfer-Encoding: 8bit
f5c53a
f5c53a
Since gtk2 is on life support, it makes sense to build the gui code with
f5c53a
gtk3 nowadays.
f5c53a
f5c53a
I went for 3.24 because that’s the version I have available on my
f5c53a
system, but it is probable that previous versions would also work, I
f5c53a
don’t know.
f5c53a
f5c53a
[lijiang added the following comment]
f5c53a
Note: Because rhel8 uses the cmake, update the CMakeLists instead of
f5c53a
Makefile.
f5c53a
f5c53a
In addition, currently, rhel8 only supports the gtk-3.22 instead of
f5c53a
gtk-3.24, so downgrade to gtk-3.22, otherwise the build will fail.
f5c53a
---
f5c53a
 README.md              | 2 +-
f5c53a
 lshw.spec.in           | 4 ++--
f5c53a
 src/gui/CMakeLists.txt | 6 +++---
f5c53a
 src/gui/gtk-lshw.ui    | 2 +-
f5c53a
 4 files changed, 7 insertions(+), 7 deletions(-)
f5c53a
f5c53a
diff --git a/README.md b/README.md
f5c53a
index 294888c71ff0..cf50e5151228 100644
f5c53a
--- a/README.md
f5c53a
+++ b/README.md
f5c53a
@@ -18,7 +18,7 @@ Installation
f5c53a
    - cmake, GNU make or Ninja
f5c53a
    - an ANSI (or close enough to ANSI compliance) C++ compiler (tested with g++ 2.95.4 and 3.x)
f5c53a
    - for the (optional) GTK+ graphical user interface, you will need a
f5c53a
-	complete GTK+ development environment (gtk2-devel on RedHat/Fedora derivatives) 
f5c53a
+	complete GTK+ development environment (gtk3-devel on RedHat/Fedora derivatives) 
f5c53a
    - for optional SQLite feature install SQLite
f5c53a
    - for optional zlib feature install zlib and gzip
f5c53a
 
f5c53a
diff --git a/lshw.spec.in b/lshw.spec.in
f5c53a
index 3fe23c2ef360..78018211e1af 100644
f5c53a
--- a/lshw.spec.in
f5c53a
+++ b/lshw.spec.in
f5c53a
@@ -31,8 +31,8 @@ http://lshw.ezix.org/
f5c53a
 Summary: HardWare LiSter (GUI version)
f5c53a
 Group: Applications/System
f5c53a
 Requires: %{name} >= %{version}
f5c53a
-Requires: gtk2 >= 2.4
f5c53a
-BuildRequires: gtk2-devel >= 2.4
f5c53a
+Requires: gtk3 >= 3.22
f5c53a
+BuildRequires: gtk3-devel >= 3.22
f5c53a
 
f5c53a
 %description gui
f5c53a
 lshw (Hardware Lister) is a small tool to provide detailed informaton on
f5c53a
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
f5c53a
index 34890535a070..34c9e4383c3e 100644
f5c53a
--- a/src/gui/CMakeLists.txt
f5c53a
+++ b/src/gui/CMakeLists.txt
f5c53a
@@ -4,17 +4,17 @@ if(NOT GUI OR STATIC)
f5c53a
 endif()
f5c53a
 
f5c53a
 find_package(PkgConfig)
f5c53a
-pkg_check_modules(GTK2 REQUIRED gtk+-2.0 gmodule-2.0)
f5c53a
+pkg_check_modules(GTK3 REQUIRED gtk+-3.0 gmodule-2.0)
f5c53a
 
f5c53a
 file(GLOB GTK_SOURCES "*.c*")
f5c53a
 
f5c53a
 include_directories("${PROJECT_BINARY_DIR}")
f5c53a
 include_directories("${PROJECT_SOURCE_DIR}/src/core")
f5c53a
 
f5c53a
-include_directories("${GTK2_INCLUDE_DIRS}")
f5c53a
+include_directories("${GTK3_INCLUDE_DIRS}")
f5c53a
 
f5c53a
 add_executable(gtk-lshw ${GTK_SOURCES})
f5c53a
-target_link_libraries(gtk-lshw ${SQLITE3_LIBRARIES} ${Z_LIBRARIES} ${GTK2_LIBRARIES} core resolv)
f5c53a
+target_link_libraries(gtk-lshw ${SQLITE3_LIBRARIES} ${Z_LIBRARIES} ${GTK3_LIBRARIES} core resolv)
f5c53a
 install(TARGETS gtk-lshw DESTINATION sbin)
f5c53a
 
f5c53a
 if(POLICYKIT)
f5c53a
diff --git a/src/gui/gtk-lshw.ui b/src/gui/gtk-lshw.ui
f5c53a
index 73fc08a58d1e..25ab1ad03349 100644
f5c53a
--- a/src/gui/gtk-lshw.ui
f5c53a
+++ b/src/gui/gtk-lshw.ui
f5c53a
@@ -1,6 +1,6 @@
f5c53a
 
f5c53a
 <interface>
f5c53a
-  <requires lib="gtk+" version="2.22"/>
f5c53a
+  <requires lib="gtk+" version="3.22"/>
f5c53a
   <object class="GtkDialog" id="aboutlshw">
f5c53a
     <property name="can_focus">False</property>
f5c53a
     <property name="title" translatable="yes">About</property>
f5c53a
-- 
f5c53a
2.17.1
f5c53a