Skip to content

Commit

Permalink
Change default GTK version to 3
Browse files Browse the repository at this point in the history
  • Loading branch information
radioactiveman committed May 1, 2024
1 parent 52a5398 commit 79000fc
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 47 deletions.
6 changes: 3 additions & 3 deletions .github/actions/install-dependencies/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# --- Dependency configuration ---
#
# ubuntu-20.04: Qt 5 + GTK2
# ubuntu-22.04: Qt 5 + GTK3
# Windows: Qt 6 + GTK2
# ubuntu-20.04: Qt 5 + GTK 2
# ubuntu-22.04: Qt 5 + GTK 3
# Windows: Qt 6 + GTK 2
# macOS (Autotools): Qt 5 - GTK
# macOS (Meson): Qt 6 - GTK

Expand Down
18 changes: 9 additions & 9 deletions .github/actions/run-action/run-action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# --- Build configuration ---
#
# ubuntu-20.04: Qt 5 + GTK2
# ubuntu-22.04: Qt 5 + GTK3
# Windows: Qt 6 + GTK2
# ubuntu-20.04: Qt 5 + GTK 2
# ubuntu-22.04: Qt 5 + GTK 3
# Windows: Qt 6 + GTK 2
# macOS (Autotools): Qt 5 - GTK
# macOS (Meson): Qt 6 - GTK

Expand All @@ -26,17 +26,17 @@ case "$action" in
case "$os" in
ubuntu-20.04)
if [ "$build_system" = 'meson' ]; then
meson setup build -D qt5=true
meson setup build -D qt5=true -D gtk2=true
else
./autogen.sh && ./configure --enable-qt5
./autogen.sh && ./configure --enable-qt5 --enable-gtk2
fi
;;

ubuntu*)
if [ "$build_system" = 'meson' ]; then
meson setup build -D qt5=true -D gtk3=true
meson setup build -D qt5=true
else
./autogen.sh && ./configure --enable-qt5 --enable-gtk3
./autogen.sh && ./configure --enable-qt5
fi
;;

Expand All @@ -52,9 +52,9 @@ case "$action" in

windows*)
if [ "$build_system" = 'meson' ]; then
meson setup build
meson setup build -D gtk2=true
else
./autogen.sh && ./configure
./autogen.sh && ./configure --enable-gtk2
fi
;;

Expand Down
35 changes: 16 additions & 19 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -172,39 +172,36 @@ dnl Check for POSIX threads
dnl =======================
AC_SEARCH_LIBS([pthread_create], [pthread])
dnl Check for GTK+ and pals
dnl =======================
dnl Check for GTK and pals
dnl ======================
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.32)
PKG_CHECK_MODULES(GMODULE, gmodule-2.0 >= 2.32)
AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_32], [target GLib 2.32])
dnl GTK+ support
dnl =============
AC_ARG_ENABLE(gtk3,
AS_HELP_STRING(--enable-gtk3, [Use GTK3 instead of GTK2 (default=disabled)]),
USE_GTK3=$enableval, USE_GTK3=no)
if test $USE_GTK3 = yes ; then
PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.22)
AC_DEFINE(USE_GTK, 1, [Define if GTK+ support enabled])
AC_DEFINE(USE_GTK3, 1, [Define if GTK3+ support enabled])
fi
AC_SUBST(USE_GTK3)
dnl GTK support
dnl ===========
AC_ARG_ENABLE(gtk,
AS_HELP_STRING(--disable-gtk, [Disable GTK+ support (default=enabled)]),
AS_HELP_STRING(--disable-gtk, [Disable GTK support (default=enabled)]),
USE_GTK=$enableval, USE_GTK=yes)
if test $USE_GTK = yes -a $USE_GTK3 = no ; then
AC_ARG_ENABLE(gtk2,
AS_HELP_STRING(--enable-gtk2, [Use GTK 2 instead of GTK 3 (default=disabled)]),
USE_GTK2=$enableval, USE_GTK2=no)
if test $USE_GTK2 = yes ; then
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.24)
AC_DEFINE([USE_GTK], [1], [Define if GTK+ support enabled])
AC_DEFINE([USE_GTK], [1], [Define if GTK support enabled])
elif test $USE_GTK = yes ; then
PKG_CHECK_MODULES(GTK, gtk+-3.0 >= 3.22)
AC_DEFINE(USE_GTK, 1, [Define if GTK support enabled])
AC_DEFINE(USE_GTK3, 1, [Define if GTK 3 support enabled])
fi
AC_SUBST(USE_GTK)
AC_SUBST(USE_GTK3)
if test $HAVE_MSWINDOWS = yes ; then
PKG_CHECK_MODULES(GIO, gio-2.0 >= 2.32)
Expand Down
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ echo "Configuration:"
echo
echo " Install path: $plugindir"
echo
echo " GTK+ support: $USE_GTK"
echo " GTK support: $USE_GTK"
echo " Qt support: $USE_QT"
echo
echo " Audio Formats"
Expand Down Expand Up @@ -810,7 +810,7 @@ echo " Crystalizer: yes"
echo " Dynamic Range Compressor: yes"
echo " Echo/Surround: yes"
echo " Extra Stereo: yes"
echo " LADSPA Host (requires GTK+): $USE_GTK"
echo " LADSPA Host (requires GTK): $USE_GTK"
echo " Sample Rate Converter: $have_resample"
echo " Silence Removal: yes"
echo " SoX Resampler: $have_soxr"
Expand Down Expand Up @@ -860,8 +860,8 @@ echo " Song Change: $have_songchange"
echo

if test "x$USE_GTK" = "xyes" ; then
echo " GTK+ Support"
echo " ------------"
echo " GTK Support"
echo " -----------"
echo " GTK Interface: yes"
echo " Winamp Classic Interface: yes"
echo " Album Art: yes"
Expand Down
14 changes: 7 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ endif


if get_option('gtk')
if get_option('gtk3')
gtk_req = '>= 3.22'
gtk_dep = dependency('gtk+-3.0', version: gtk_req, required: true)
else
if get_option('gtk2')
gtk_req = '>= 2.24'
gtk_dep = dependency('gtk+-2.0', version: gtk_req, required: true)
else
gtk_req = '>= 3.22'
gtk_dep = dependency('gtk+-3.0', version: gtk_req, required: true)
endif
endif

Expand Down Expand Up @@ -181,7 +181,7 @@ endif

if get_option('gtk')
conf.set10('USE_GTK', true)
if get_option('gtk3')
if not get_option('gtk2')
conf.set10('USE_GTK3', true)
endif
endif
Expand All @@ -207,8 +207,8 @@ if meson.version().version_compare('>= 0.53')
summary({
'Qt 5 support': get_option('qt5'),
'Qt 6 support': get_option('qt') and not get_option('qt5'),
'GTK 2 support': get_option('gtk') and not get_option('gtk3'),
'GTK 3 support': get_option('gtk3'),
'GTK 2 support': get_option('gtk2'),
'GTK 3 support': get_option('gtk') and not get_option('gtk2'),
}, section: 'GUI Toolkits')

summary({
Expand Down
4 changes: 2 additions & 2 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# GUI toolkits
option('gtk', type: 'boolean', value: true,
description: 'Whether GTK support is enabled')
option('gtk3', type: 'boolean', value: false,
description: 'Whether GTK 3 support is enabled')
option('gtk2', type: 'boolean', value: false,
description: 'Whether GTK 2 support is enabled')
option('qt', type: 'boolean', value: true,
description: 'Whether Qt support is enabled')
option('qt5', type: 'boolean', value: false,
Expand Down
6 changes: 3 additions & 3 deletions src/hotkey/meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if get_option('gtk3')
gdk_x11_dep = dependency('gdk-x11-3.0', version: gtk_req, required: false)
else
if get_option('gtk2')
gdk_x11_dep = dependency('gdk-x11-2.0', version: gtk_req, required: false)
else
gdk_x11_dep = dependency('gdk-x11-3.0', version: gtk_req, required: false)
endif
have_hotkey = gdk_x11_dep.found()

Expand Down

0 comments on commit 79000fc

Please sign in to comment.