build: Switch to GTK4 and libadwaita

Switch the build system to GTK4 and libadwaita, instead of GTK3
and libhandy.

This commit breaks the build.
This commit is contained in:
Georges Basile Stavracas Neto 2022-07-07 21:20:30 -03:00
parent 52b4b490f3
commit c31640fa12
7 changed files with 19 additions and 14 deletions

View File

@ -7,7 +7,7 @@ cache:
- _ccache/ - _ccache/
variables: variables:
DEBIAN_IMAGE: "registry.freedesktop.org/pwithnall/malcontent/debian-unstable:v2" DEBIAN_IMAGE: "registry.freedesktop.org/pwithnall/malcontent/debian-unstable:v3"
MESON_TEST_TIMEOUT_MULTIPLIER: 2 MESON_TEST_TIMEOUT_MULTIPLIER: 2
G_MESSAGES_DEBUG: all G_MESSAGES_DEBUG: all
MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload" MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload"

View File

@ -5,14 +5,14 @@ RUN apt-get update -qq && apt-get install --no-install-recommends -qq -y \
git \ git \
gtk-doc-tools \ gtk-doc-tools \
lcov \ lcov \
libadwaita-1-dev \
libaccountsservice-dev \ libaccountsservice-dev \
libappstream-dev \ libappstream-dev \
libflatpak-dev \ libflatpak-dev \
libgirepository1.0-dev \ libgirepository1.0-dev \
libglib2.0-dev \ libglib2.0-dev \
libglib-testing-0-dev \ libglib-testing-0-dev \
libgtk-3-dev \ libgtk-4-dev \
libhandy-1-dev \
libpam0g-dev \ libpam0g-dev \
libpolkit-gobject-1-dev \ libpolkit-gobject-1-dev \
libxml2-utils \ libxml2-utils \

View File

@ -28,8 +28,8 @@ libmalcontent_ui_public_deps = [
dependency('gio-2.0', version: '>= 2.44'), dependency('gio-2.0', version: '>= 2.44'),
dependency('glib-2.0', version: '>= 2.54.2'), dependency('glib-2.0', version: '>= 2.54.2'),
dependency('gobject-2.0', version: '>= 2.54'), dependency('gobject-2.0', version: '>= 2.54'),
dependency('gtk+-3.0', version: '>= 3.24'), dependency('gtk4', version: '>= 4.6'),
libhandy_dep, libadwaita_dep,
libmalcontent_dep, libmalcontent_dep,
] ]
libmalcontent_ui_private_deps = [ libmalcontent_ui_private_deps = [
@ -87,7 +87,7 @@ if xmllint.found()
'validate-ui', xmllint, 'validate-ui', xmllint,
args: [ args: [
'--nonet', '--noblanks', '--noout', '--nonet', '--noblanks', '--noout',
'--relaxng', join_paths(gtk_prefix, 'share', 'gtk-3.0', 'gtkbuilder.rng'), '--relaxng', join_paths(gtk_prefix, 'share', 'gtk-4.0', 'gtk4builder.rng'),
files( files(
'restrict-applications-dialog.ui', 'restrict-applications-dialog.ui',
'restrict-applications-selector.ui', 'restrict-applications-selector.ui',

View File

@ -27,9 +27,9 @@ malcontent_control = executable('malcontent-control',
dependency('gio-2.0', version: '>= 2.44'), dependency('gio-2.0', version: '>= 2.44'),
dependency('glib-2.0', version: '>= 2.54.2'), dependency('glib-2.0', version: '>= 2.54.2'),
dependency('gobject-2.0', version: '>= 2.54'), dependency('gobject-2.0', version: '>= 2.54'),
dependency('gtk+-3.0'), dependency('gtk4', version: '>= 4.6'),
dependency('polkit-gobject-1'), dependency('polkit-gobject-1'),
libhandy_dep, libadwaita_dep,
libmalcontent_dep, libmalcontent_dep,
libmalcontent_ui_dep, libmalcontent_ui_dep,
], ],
@ -84,7 +84,7 @@ if xmllint.found()
'validate-ui', xmllint, 'validate-ui', xmllint,
args: [ args: [
'--nonet', '--noblanks', '--noout', '--nonet', '--noblanks', '--noout',
'--relaxng', join_paths(gtk_prefix, 'share', 'gtk-3.0', 'gtkbuilder.rng'), '--relaxng', join_paths(gtk_prefix, 'share', 'gtk-4.0', 'gtk4builder.rng'),
files( files(
'carousel.ui', 'carousel.ui',
'main.ui', 'main.ui',

View File

@ -134,7 +134,12 @@ else
'Malcontent-' + libmalcontent_api_version + '.typelib'] 'Malcontent-' + libmalcontent_api_version + '.typelib']
endif endif
if get_option('ui').enabled() if get_option('ui').enabled()
libhandy_dep = dependency('libhandy-1', version: '>=1.1.0', fallback: ['libhandy', 'libhandy_dep']) libadwaita_dep = dependency(
'libadwaita-1',
version: '>= 1.1',
fallback: ['libadwaita', 'libadwaita_dep'],
default_options: ['examples=false', 'introspection=disabled', 'tests=false', 'vapi=false'],
)
subdir('libmalcontent-ui') subdir('libmalcontent-ui')
endif endif
subdir('malcontent-client') subdir('malcontent-client')

View File

@ -0,0 +1,4 @@
[wrap-git]
url = https://gitlab.gnome.org/GNOME/libadwaita.git
revision = 1.1.0
depth = 1

View File

@ -1,4 +0,0 @@
[wrap-git]
directory = libhandy
url = https://gitlab.gnome.org/GNOME/libhandy.git
revision = origin/main