remove more gtk2

This commit is contained in:
2026-02-22 16:08:00 -07:00
parent be7b5e62be
commit 149863fdca
6 changed files with 29 additions and 9 deletions

View File

@@ -42,6 +42,7 @@ config_h.set('USE_OPENSSL', libssl_dep.found())
config_h.set('USE_LIBCANBERRA', libcanberra_dep.found()) config_h.set('USE_LIBCANBERRA', libcanberra_dep.found())
config_h.set('USE_DBUS', dbus_glib_dep.found()) config_h.set('USE_DBUS', dbus_glib_dep.found())
config_h.set('USE_PLUGIN', get_option('plugin')) config_h.set('USE_PLUGIN', get_option('plugin'))
config_h.set('USE_GTK_FRONTEND', get_option('gtk-frontend'))
config_h.set('G_DISABLE_SINGLE_INCLUDES', true) config_h.set('G_DISABLE_SINGLE_INCLUDES', true)
config_h.set('GTK_DISABLE_DEPRECATED', true) config_h.set('GTK_DISABLE_DEPRECATED', true)

View File

@@ -10,7 +10,7 @@ sysinfo_deps = [
] ]
sysinfo_includes = [] sysinfo_includes = []
sysinfo_cargs = [] sysinfo_cargs = ['-DHAVE_CONFIG_H']
system = host_machine.system() system = host_machine.system()
if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system == 'darwin' or system == 'freebsd' if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system == 'darwin' or system == 'freebsd'
@@ -19,6 +19,10 @@ if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system =
'shared/df.c' 'shared/df.c'
] ]
if get_option('gtk-frontend')
sysinfo_cargs += '-DUSE_GTK_FRONTEND'
endif
if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system == 'freebsd' if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system == 'freebsd'
libpci = dependency('libpci', required: false, method: 'pkg-config') libpci = dependency('libpci', required: false, method: 'pkg-config')
if libpci.found() if libpci.found()
@@ -30,6 +34,10 @@ if system == 'linux' or system == 'gnu' or system.startswith('gnu/') or system =
pciids = join_paths(picidsdir, 'pci.ids') pciids = join_paths(picidsdir, 'pci.ids')
sysinfo_cargs += '-DPCIIDS_FILE="@0@"'.format(pciids) sysinfo_cargs += '-DPCIIDS_FILE="@0@"'.format(pciids)
endif endif
if get_option('gtk-frontend')
sysinfo_deps += dependency('gtk+-3.0', version: '>= 3.22')
endif
sysinfo_includes += 'unix' sysinfo_includes += 'unix'
sysinfo_sources += [ sysinfo_sources += [
'unix/backend.c', 'unix/backend.c',
@@ -52,7 +60,7 @@ endif
shared_module('sysinfo', sysinfo_sources, shared_module('sysinfo', sysinfo_sources,
dependencies: sysinfo_deps, dependencies: sysinfo_deps,
include_directories: include_directories(sysinfo_includes), include_directories: [config_h_include, include_directories(sysinfo_includes)],
c_args: sysinfo_cargs, c_args: sysinfo_cargs,
install: true, install: true,
install_dir: plugindir, install_dir: plugindir,

View File

@@ -32,6 +32,10 @@
#include <glib.h> #include <glib.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "format.h" #include "format.h"
#include "df.h" #include "df.h"
@@ -276,7 +280,7 @@ sysinfo_backend_get_network(void)
static const char *sysinfo_detect_toolkit(void) static const char *sysinfo_detect_toolkit(void)
{ {
#if defined(HAVE_GTK3) #if defined(USE_GTK_FRONTEND)
return "GTK3"; return "GTK3";
#else #else
return NULL; return NULL;

View File

@@ -19,7 +19,11 @@
#include <glib.h> #include <glib.h>
#if defined(HAVE_GTK3) #ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#if defined(USE_GTK_FRONTEND)
#include <gdk/gdk.h> #include <gdk/gdk.h>
#endif #endif
#include "parse.h" #include "parse.h"
@@ -175,7 +179,7 @@ char *sysinfo_backend_get_network(void)
static const char *sysinfo_detect_toolkit(void) static const char *sysinfo_detect_toolkit(void)
{ {
#if defined(HAVE_GTK3) #if defined(USE_GTK_FRONTEND)
return "GTK3"; return "GTK3";
#else #else
return NULL; return NULL;
@@ -190,7 +194,7 @@ static const char *sysinfo_detect_display_backend(void)
const gboolean session_wayland = session && g_ascii_strcasecmp(session, "wayland") == 0; const gboolean session_wayland = session && g_ascii_strcasecmp(session, "wayland") == 0;
/* Best-effort: ask GDK what it actually opened, if available. */ /* Best-effort: ask GDK what it actually opened, if available. */
#if defined(HAVE_GTK3) #if defined(USE_GTK_FRONTEND)
{ {
GdkDisplay *display = gdk_display_get_default(); GdkDisplay *display = gdk_display_get_default();
if (display) if (display)

View File

@@ -26,6 +26,10 @@
#include <glib.h> #include <glib.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "../../../src/common/sysinfo/sysinfo.h" #include "../../../src/common/sysinfo/sysinfo.h"
#include "../format.h" #include "../format.h"
@@ -106,7 +110,7 @@ static char *get_memory_info (void)
static const char *sysinfo_detect_toolkit(void) static const char *sysinfo_detect_toolkit(void)
{ {
#if defined(HAVE_GTK3) #if defined(USE_GTK_FRONTEND)
return "GTK3"; return "GTK3";
#else #else
return NULL; return NULL;

View File

@@ -17,7 +17,7 @@
<!-- G_DISABLE_DEPRECATED is unfeasible due to g_completion_* --> <!-- G_DISABLE_DEPRECATED is unfeasible due to g_completion_* -->
<!-- must be buildable with GSEAL_ENABLE in the future, xtext, setup, and chanview-tabs stand in the way --> <!-- must be buildable with GSEAL_ENABLE in the future, xtext, setup, and chanview-tabs stand in the way -->
<OwnFlags>GTK_DISABLE_DEPRECATED;GDK_PIXBUF_DISABLE_DEPRECATED;G_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;HAVE_X509_GET_SIGNATURE_NID;HAVE_SSL_CTX_GET_SSL_METHOD;DEFAULT_CERT_FILE="cert.pem";HAVE_STRTOULL;strtoull=_strtoui64;strcasecmp=stricmp;strncasecmp=strnicmp;__inline__=__inline;$(GtkDefines)</OwnFlags> <OwnFlags>GTK_DISABLE_DEPRECATED;GDK_PIXBUF_DISABLE_DEPRECATED;G_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;HAVE_X509_GET_SIGNATURE_NID;HAVE_SSL_CTX_GET_SSL_METHOD;DEFAULT_CERT_FILE="cert.pem";HAVE_STRTOULL;strtoull=_strtoui64;strcasecmp=stricmp;strncasecmp=strnicmp;__inline__=__inline</OwnFlags>
<!-- FIXME: Add ability to use debug builds --> <!-- FIXME: Add ability to use debug builds -->
<DepsRoot>$(YourDepsPath)\$(ZoiteChatPlatform)\release</DepsRoot> <DepsRoot>$(YourDepsPath)\$(ZoiteChatPlatform)\release</DepsRoot>
@@ -67,7 +67,6 @@
<Glib>$(DepsRoot)\include\glib-2.0;$(DepsRoot)\lib\glib-2.0\include;$(DepsRoot)\include\libxml2</Glib> <Glib>$(DepsRoot)\include\glib-2.0;$(DepsRoot)\lib\glib-2.0\include;$(DepsRoot)\include\libxml2</Glib>
<UsingGtk3 Condition="Exists('$(DepsRoot)\\include\\gtk-3.0\\gtk\\gtk.h')">true</UsingGtk3> <UsingGtk3 Condition="Exists('$(DepsRoot)\\include\\gtk-3.0\\gtk\\gtk.h')">true</UsingGtk3>
<GtkDefines>HAVE_GTK3</GtkDefines>
<Gtk3>$(DepsRoot)\include\gtk-3.0;$(DepsRoot)\lib\gtk-3.0\include</Gtk3> <Gtk3>$(DepsRoot)\include\gtk-3.0;$(DepsRoot)\lib\gtk-3.0\include</Gtk3>
<GtkCommon>$(DepsRoot)\include\atk-1.0;$(DepsRoot)\include\cairo;$(DepsRoot)\include\pango-1.0;$(DepsRoot)\include\gdk-pixbuf-2.0;$(DepsRoot)\include\harfbuzz</GtkCommon> <GtkCommon>$(DepsRoot)\include\atk-1.0;$(DepsRoot)\include\cairo;$(DepsRoot)\include\pango-1.0;$(DepsRoot)\include\gdk-pixbuf-2.0;$(DepsRoot)\include\harfbuzz</GtkCommon>
<Gtk>$(Gtk3);$(GtkCommon)</Gtk> <Gtk>$(Gtk3);$(GtkCommon)</Gtk>