diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2022-03-05 08:49:17 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2022-03-08 16:35:42 +0100 |
commit | 649fc842327e114cb4b0884266dff82b00f8dfa5 (patch) | |
tree | bad406e3cb4640cd51019e115cb0f14c5a02984c | |
parent | 6a80bec4bf7a1e52057c03d2c73cce1bf248c6d7 (diff) | |
download | vte-ricotz/vala.tar.gz |
vala: Support building bindings for vte-2.91-gtk4ricotz/vala
Fixes https://gitlab.gnome.org/GNOME/vte/-/issues/2546
-rw-r--r-- | bindings/meson.build | 2 | ||||
-rw-r--r-- | bindings/vala/meson.build | 88 |
2 files changed, 54 insertions, 36 deletions
diff --git a/bindings/meson.build b/bindings/meson.build index 626e4679..2fc8dd60 100644 --- a/bindings/meson.build +++ b/bindings/meson.build @@ -22,6 +22,6 @@ if get_option('gir') and (get_option('gtk3') or get_option('gtk4')) subdir('gir') endif -if get_option('vapi') and get_option('gtk3') +if get_option('vapi') and (get_option('gtk3') or get_option('gtk4')) subdir('vala') endif diff --git a/bindings/vala/meson.build b/bindings/vala/meson.build index ec1ddf0b..d27a1302 100644 --- a/bindings/vala/meson.build +++ b/bindings/vala/meson.build @@ -15,7 +15,6 @@ # along with this library. If not, see <https://www.gnu.org/licenses/>. assert(get_option('gir'), 'gir is required for vala support') -assert(get_option('gtk3'), 'vala support only available for gtk3') add_languages('vala', required: true) @@ -24,20 +23,6 @@ assert(valac.version().version_compare('>= 0.24.0'), 'vala >= 0.24 required') posix_dep = valac.find_library('posix') -libvte_gtk3_vapi_deps = [ - 'gio-2.0', - 'glib-2.0', - 'pango', - 'gtk+-3.0', -] - -libvte_gtk3_vapi_dep = gnome.generate_vapi( - vte_gtk3_api_name, - sources: libvte_gtk3_gir[0], - packages: libvte_gtk3_vapi_deps, - install: true, -) - # Vala test application vapp_resource_data = files( @@ -71,30 +56,63 @@ if valac.version().version_compare('>= 0.31.1') vapp_valaflags += '--disable-since-check' endif -if gtk3_dep.version().version_compare('>= 3.16') - vapp_valaflags += '--define=GTK_3_16' -endif - vapp_incs = [ top_inc, src_inc, vte_inc, ] -vapp_deps = [ - gio_dep, - glib_dep, - gtk3_dep, - libvte_gtk3_vapi_dep, - posix_dep, -] +if get_option('gtk3') + libvte_gtk3_vapi_deps = [ + 'gio-2.0', + 'glib-2.0', + 'pango', + 'gtk+-3.0', + ] + + libvte_gtk3_vapi_dep = gnome.generate_vapi( + vte_gtk3_api_name, + sources: libvte_gtk3_gir[0], + packages: libvte_gtk3_vapi_deps, + install: true, + ) + + if gtk3_dep.version().version_compare('>= 3.16') + vapp_valaflags += '--define=GTK_3_16' + endif + + vapp_deps = [ + gio_dep, + glib_dep, + gtk3_dep, + libvte_gtk3_vapi_dep, + posix_dep, + ] + + vapp = executable( + 'vala-test', + sources: vapp_sources, + include_directories: vapp_incs, + dependencies: vapp_deps, + c_args: vapp_cflags, + vala_args: vapp_valaflags, + install: false, + ) +endif -vapp = executable( - 'vala-test', - sources: vapp_sources, - include_directories: vapp_incs, - dependencies: vapp_deps, - c_args: vapp_cflags, - vala_args: vapp_valaflags, - install: false, -) +if get_option('gtk4') + libvte_gtk4_vapi_deps = [ + 'gio-2.0', + 'glib-2.0', + 'graphene-1.0', + 'pango', + 'gtk4', + ] + + libvte_gtk4_vapi_dep = gnome.generate_vapi( + vte_gtk4_api_name, + sources: libvte_gtk4_gir[0], + packages: libvte_gtk4_vapi_deps, + install: true, + ) +endif |