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

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