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 51d353e commit fcf1c63
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 46 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 @@ -30,17 +30,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 @@ -56,9 +56,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
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ echo ""
echo " Install path: $prefix"
echo ""
echo " D-Bus support: $USE_DBUS"
echo " GTK+ support: $USE_GTK"
echo " GTK support: $USE_GTK"
echo " Qt support: $USE_QT"
echo " libarchive support: $USE_LIBARCHIVE"
echo " Valgrind analysis support: $enable_valgrind"
Expand Down
14 changes: 7 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,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 @@ -174,7 +174,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 Down Expand Up @@ -233,8 +233,8 @@ if meson.version().version_compare('>= 0.53')
'D-Bus support': get_option('dbus'),
'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'),
'Libarchive support': get_option('libarchive'),
'Valgrind analysis support': get_option('valgrind'),
'Build stamp': get_option('buildstamp'),
Expand Down
4 changes: 2 additions & 2 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ option('qt5', type: 'boolean', value: false,
description: 'Whether Qt 5 support is enabled')
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('libarchive', type: 'boolean', value: false,
description: 'Whether libarchive support is enabled')
option('buildstamp', type: 'string', value: 'unknown build',
Expand Down
10 changes: 5 additions & 5 deletions win32/notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ <h3>Set up MSYS2 environment</h3>
pacman -S mingw-w64-x86_64-libcue mingw-w64-x86_64-lame mingw-w64-x86_64-opusfile<br>
pacman -S mingw-w64-x86_64-libopenmpt mingw-w64-x86_64-json-glib</tt></p></blockquote>

<h3>Install GTK+</h3>
<h3>Install GTK</h3>

<p>The Makefile accompanying this document automates the process of building GTK+ from source.</p>
<p>The Makefile accompanying this document automates the process of building GTK from source.</p>

<p>In the MinGW shell:</p>
<blockquote><p><tt>cd &lt;PATH TO THIS DOCUMENT&gt;<br>
make -j$(nproc) gtk</tt></p></blockquote>

<p><i>It may be necessary to run the MinGW shell with administrative privileges
for GTK+ to build successfully.</i></p>
for GTK to build successfully.</i></p>

<h3>Install additional libraries</h3>

Expand All @@ -71,7 +71,7 @@ <h3>Install Audacious</h3>

<p>In the MinGW shell:</p>
<blockquote><p><tt>cd /C/audacious<br>
./configure --prefix=/C/aud<br>
./configure --prefix=/C/aud --enable-gtk2<br>
make -j$(nproc)<br>
make install</tt></p></blockquote>

Expand All @@ -82,7 +82,7 @@ <h3>Install Audacious Plugins</h3>

<p>In the MinGW shell:</p>
<blockquote><p><tt>cd /C/audacious-plugins<br>
./configure --prefix=/C/aud<br>
./configure --prefix=/C/aud --enable-gtk2<br>
make -j$(nproc)<br>
make install</tt></p></blockquote>

Expand Down

0 comments on commit fcf1c63

Please sign in to comment.