From 379f2e862a42cf4888d0efa85de3c6bb849d7d3c Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Wed, 17 May 2023 13:08:31 -0700 Subject: [PATCH] build: Depend on gtk main for GdkGLTextureBuilder - Add a meson subproject for building main gtk - Adapt the docs CI job to install the necessary build deps - Disable werror in the CI for now, until we port aways from deprecated APIs - Switch from using add_global_argument as it would affect subprojects # Conflicts: # .gitignore --- .gitignore | 3 +++ .gitlab-ci.yml | 4 ++-- meson.build | 6 +++--- subprojects/gtk.wrap | 10 ++++++++++ 4 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 subprojects/gtk.wrap diff --git a/.gitignore b/.gitignore index fe487f7..1b203fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .flatpak .flatpak-builder .vscode +subprojects/gtk +subprojects/libsass +subprojects/sassc diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 644a4ac..4063f86 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,9 +21,9 @@ reference: stage: docs needs: [] variables: - MESON_FLAGS: "-Dwerror=true --buildtype=release" + MESON_FLAGS: "--buildtype=release -Dgtk:gtk_doc=false -Dgtk:introspection=disabled -Dgtk:build-examples=false -Dgtk:build-tests=false -Dgtk:demos=false -Dgtk:media-gstreamer=disabled -Dlibepoxy:tests=false" before_script: - - sudo dnf install -y gtk4-devel meson gcc gi-docgen gobject-introspection-devel vala + - sudo dnf install -y git gtk4-devel meson gcc gcc-c++ gi-docgen gobject-introspection-devel vala script: - mkdir -p pfx/ - meson ${MESON_FLAGS} --prefix=${PWD}/pfx -Ddocs=true _build diff --git a/meson.build b/meson.build index 89802b2..31a6f69 100644 --- a/meson.build +++ b/meson.build @@ -23,7 +23,7 @@ add_project_arguments(['-I' + meson.project_build_root()], language: 'c') # Check dependencies glib_req_version = '2.75.0' -gtk_req_version = '4.8' +gtk_req_version = '4.11' glib_req = '>= @0@'.format(glib_req_version) gtk_req = '>= @0@'.format(gtk_req_version) @@ -43,7 +43,7 @@ endif libepoxy_dep = dependency('epoxy') libgio_dep = dependency('gio-2.0', version: glib_req) libgiounix_dep = dependency('gio-unix-2.0', version: glib_req) -libgtk_dep = dependency('gtk4', version: gtk_req) +libgtk_dep = dependency('gtk4', version: gtk_req, fallback: ['gtk']) # Ensure we restrict ABI usage to what we claim project_c_args += [ @@ -141,7 +141,7 @@ test_link_args = [ '-Wl,-z,now', ] if not get_option('buildtype').startswith('debug') and not meson.is_subproject() - add_global_arguments(['-DG_DISABLE_CAST_CHECKS'], language: 'c') + add_project_arguments(['-DG_DISABLE_CAST_CHECKS'], language: 'c') release_args += [ '-DG_DISABLE_ASSERT' ] test_link_args += [ '-Wl,-Bsymbolic', diff --git a/subprojects/gtk.wrap b/subprojects/gtk.wrap new file mode 100644 index 0000000..5ed2f3b --- /dev/null +++ b/subprojects/gtk.wrap @@ -0,0 +1,10 @@ +[wrap-git] +directory=gtk +url=https://gitlab.gnome.org/GNOME/gtk.git +push-url=ssh://git@gitlab.gnome.org:GNOME/gtk.git +revision=main +depth=1 + +[provide] +gtk4=libgtk_dep +dependency_names=gtk4