Build with gtk3

This commit is contained in:
Paul Dicker
2025-04-01 17:17:01 +02:00
committed by Stéphane Lesimple
parent a7e1a5591e
commit e75d73c74a
8 changed files with 33 additions and 39 deletions

View File

@@ -52,7 +52,7 @@ jobs:
- name: Build app
run: |
sudo apt-get update && sudo apt-get install -y libglib2.0-dev ghostscript man jq libgtk2.0-dev
sudo apt-get update && sudo apt-get install -y libglib2.0-dev ghostscript man jq libgtk-3-dev
./configure --with-werror
nproc && make -j$(nproc)
env:

View File

@@ -27,12 +27,6 @@ echo "appimage is <$archive>"
mkdir -p dist/locale
cp -vr locale/*/ dist/locale/
if [ "$os" != "linux64" ]; then
if [ "$GUI" = 1 ]; then
mkdir -p dist/share/themes dist/lib/gtk-2.0
cp -vr $MINGW_PREFIX/share/themes/MS-Windows dist/share/themes/
cp -vr $MINGW_PREFIX/lib/gtk-2.0/* dist/lib/gtk-2.0/
rm -rf dist/lib/gtk-2.0/include
fi
mkdir -p dist/lib
ntldd -R dvdisaster
for i in $(ntldd -R dvdisaster | awk '/mingw/ {print $3}' | tr \\\\ / | grep -Eo '[^/]+$')

View File

@@ -26,7 +26,7 @@ jobs:
if: matrix.ui == 'gui'
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: brew install gtk+
run: brew install gtk+3
- name: configure
run: |
set +x
@@ -82,7 +82,7 @@ jobs:
install: git diffutils make pkg-config mingw-w64-${{ matrix.arch }}-glib2 mingw-w64-${{ matrix.arch }}-gcc mingw-w64-${{ matrix.arch }}-ghostscript mingw-w64-${{ matrix.arch }}-ntldd-git man zip
- name: install GUI prereqs
if: matrix.ui == 'gui'
run: pacman -S --noconfirm mingw-w64-${{ matrix.arch }}-gtk2
run: pacman -S --noconfirm mingw-w64-${{ matrix.arch }}-gtk3
- name: git config
run: git config --global core.autocrlf input
shell: bash
@@ -159,7 +159,7 @@ jobs:
mkdir -p /tmp/dist
docker run --device /dev/fuse --privileged --name uu -d -v $PWD:/code -v /tmp/dist:/dist ubuntu:14.04 sleep 1800
- name: install prerequisites in docker
run: docker exec uu sh -c 'sudo apt update && sudo apt install -y libglib2.0-dev ghostscript man libgtk2.0-dev gtk2-engines-pixbuf gtk2-engines libgail-common pkg-config gnome-themes-standard fuse'
run: docker exec uu sh -c 'sudo apt update && sudo apt install -y libglib2.0-dev ghostscript man libgtk3-dev libgail-common pkg-config gnome-themes-standard fuse'
- name: configure in docker
run: docker exec uu sh -c 'cd /code && ./configure --prefix=/usr'
- name: make in docker

View File

@@ -26,7 +26,7 @@ jobs:
if: matrix.ui == 'gui'
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: brew install gtk+
run: brew install gtk+3
- name: configure
run: |
set +x
@@ -85,7 +85,7 @@ jobs:
install: git diffutils make pkg-config mingw-w64-${{ matrix.arch }}-glib2 mingw-w64-${{ matrix.arch }}-gcc mingw-w64-${{ matrix.arch }}-ghostscript mingw-w64-${{ matrix.arch }}-ntldd-git man zip
- name: install GUI prereqs
if: matrix.ui == 'gui'
run: pacman -S --noconfirm mingw-w64-${{ matrix.arch }}-gtk2
run: pacman -S --noconfirm mingw-w64-${{ matrix.arch }}-gtk3
- name: git config
run: git config --global core.autocrlf input
shell: bash
@@ -146,7 +146,7 @@ jobs:
if: matrix.ui == 'gui'
env:
DEBIAN_FRONTEND: noninteractive
run: sudo apt-get install -y libgtk2.0-dev
run: sudo apt-get install -y libgtk-3-dev
- name: configure
run: |
echo ./configure ${{ matrix.clionly }} ${{ matrix.debugprintf }} --with-werror

View File

@@ -68,9 +68,9 @@ GLIB_CFLAGS = $(CFG_GLIB2_CFLAGS)
GLIB_LIBS = $(CFG_GLIB2_LIBS)
GLIB_BINDIR = $(CFG_GLIB2_BINDIR)
GTK_CFLAGS = $(CFG_GTK2_CFLAGS) $(CFG_GLIB2_CFLAGS)
GTK_LIBS = $(CFG_GTK2_LIBS) $(CFG_GLIB2_LIBS)
GTK_BINDIR = $(CFG_GTK2_BINDIR) $(CFG_GLIB2_BINDIR)
GTK_CFLAGS = $(CFG_GTK3_CFLAGS) $(CFG_GLIB2_CFLAGS)
GTK_LIBS = $(CFG_GTK3_LIBS) $(CFG_GLIB2_LIBS)
GTK_BINDIR = $(CFG_GTK3_BINDIR) $(CFG_GLIB2_BINDIR)
EFENCE_LFLAGS = $(CFG_EFENCE_LFLAGS)
EFENCE_LIBS = $(CFG_EFENCE_LIBS)

2
configure vendored
View File

@@ -87,7 +87,7 @@ REQUIRE_GLIB2 2 32 0
echo
if test "$cfg_with_gui" == "yes"; then
REQUIRE_GTK2 2 6 0 WITH_THREADS
REQUIRE_GTK3 3 4 0 WITH_THREADS
fi
if ! CHECK_INCLUDE locale.h locale || ! CHECK_INCLUDE libintl.h intl ; then

View File

@@ -1,5 +1,5 @@
# Bash based configure - library of test functions
# Copyright (C) 2004-2016 Carsten Gn<47>rlich
# Copyright (C) 2004-2016 Carsten Gn<47>rlich
# Copyright (C) 2019-2021 The dvdisaster development team.
#
# Email: support@dvdisaster.org
@@ -1477,13 +1477,13 @@ EOF
}
#
# Require the GTK2 includes and libraries.
# Require the GTK3 includes and libraries.
# Unlike with the other packages, we don't have to fid out about the includes
# and libraries by ourselves, but just query pkg-config about them.
# It seems that people have more trouble with getting GTK+ to work
# than with other toolkits, so we try a bit harder to diagnose them here.
function REQUIRE_GTK2()
function REQUIRE_GTK3()
{ local want_major="$1"
local want_minor="$2"
local want_micro="$3"
@@ -1496,14 +1496,14 @@ function REQUIRE_GTK2()
if test "$want_threads" == "WITH_THREADS"; then threads="--libs gthread-2.0"; fi
echo -e "\n/* *** REQUIRE_GTK2 */\n" >>$LOGFILE
echo -e "\n/* *** REQUIRE_GTK3 */\n" >>$LOGFILE
echo "Gtk+ ${want_major}.${want_minor}.${want_micro} is required..."
# See if pkgconfig returns something
echo -n " pkg-config... "
if pkg-config --cflags gtk+-2.0 >>config.tmp 2>&1 && pkg-config $threads --libs gtk+-2.0 >>config.tmp 2>&1 ; then
if pkg-config --cflags gtk+-3.0 >>config.tmp 2>&1 && pkg-config $threads --libs gtk+-3.0 >>config.tmp 2>&1 ; then
echo "works"
rm config.tmp
else
@@ -1511,18 +1511,18 @@ function REQUIRE_GTK2()
echo -e "\nError message(s) from pkg-config were:"
cat config.tmp
rm config.tmp
cat <<EOF
cat <<EOF
Make sure you have the following packages installed:
- pkg-config (sometimes, the obvious is overlooked ;-)
- glib2
- pango
- atk
- gtk2
- gtk3
Some GNU/Linux distributions (e.g. SuSE) distinguish between
end-user packages of the libraries (e.g. 'gtk2') and
versions suitable for building programs (e.g. 'gtk2-devel').
end-user packages of the libraries (e.g. 'gtk3') and
versions suitable for building programs (e.g. 'gtk3-devel').
You might have to install the development versions explicitly
even if you have already GTK+ or Gnome applications running
on your system.
@@ -1533,17 +1533,17 @@ EOF
# Do a test compile to make sure they did not return some junk
CFG_GTK2_CFLAGS=`pkg-config --cflags gtk+-2.0`
CFG_GTK2_LIBS=`pkg-config $threads --libs gtk+-2.0`
CFG_GTK3_CFLAGS=`pkg-config --cflags gtk+-3.0`
CFG_GTK3_LIBS=`pkg-config $threads --libs gtk+-3.0`
CFG_GTK2_BINDIR=`type -P pkg-config`
CFG_GTK2_BINDIR=`echo $CFG_GTK2_BINDIR | sed -e 's/.exe//' | sed -e 's/\/pkg-config//'`
CFG_GTK3_BINDIR=`which pkg-config`
CFG_GTK3_BINDIR=`echo $CFG_GTK3_BINDIR | sed -e 's/.exe//' | sed -e 's/\/pkg-config//'`
CFG_CFLAGS="$CFG_CFLAGS $CFG_GTK2_CFLAGS"
CFG_LIBS="$CFG_LIBS $CFG_GTK2_LIBS"
CFG_CFLAGS="$CFG_CFLAGS $CFG_GTK3_CFLAGS"
CFG_LIBS="$CFG_LIBS $CFG_GTK3_LIBS"
cat >conftest.c <<EOF
#include <gtk/gtkversion.h>
#include <gtk/gtk.h>
CPPABUSE GTK_MAJOR_VERSION.GTK_MINOR_VERSION.GTK_MICRO_VERSION
EOF
@@ -1568,9 +1568,9 @@ EOF
# Successfully finished
echo "CFG_GTK2_CFLAGS = $CFG_GTK2_CFLAGS" >> Makefile.config
echo "CFG_GTK2_LIBS = $CFG_GTK2_LIBS" >> Makefile.config
echo "CFG_GTK2_BINDIR = $CFG_GTK2_BINDIR" >> Makefile.config
echo "CFG_GTK3_CFLAGS = $CFG_GTK3_CFLAGS" >> Makefile.config
echo "CFG_GTK3_LIBS = $CFG_GTK3_LIBS" >> Makefile.config
echo "CFG_GTK3_BINDIR = $CFG_GTK3_BINDIR" >> Makefile.config
return 1
}

View File

@@ -44,8 +44,8 @@ static gboolean expose_cb(GtkWidget *widget, GdkEventExpose *event, gpointer dat
{ GtkWidget *box = (GtkWidget*)data;
if(!Closure->colors_initialized)
{ GdkColor *bg = &widget->style->bg[0];
GdkColormap *cmap = gdk_colormap_get_system();
{ GdkColor *bg = &gtk_widget_get_style(widget)->bg[0];
GdkVisual *cmap = gdk_visual_get_system();
memcpy(Closure->background, bg, sizeof(GdkColor));