diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad68f6c33..d5db361d9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,15 +10,14 @@ cache: - _ccache/ variables: - FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v13" - COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v3" - DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v9" - ANDROID_IMAGE: "registry.gitlab.gnome.org/gnome/glib/android-ndk:v6" - MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v5" + FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v14" + COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v4" + DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v10" + ANDROID_IMAGE: "registry.gitlab.gnome.org/gnome/glib/android-ndk:v7" + MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v6" MESON_TEST_TIMEOUT_MULTIPLIER: 2 G_MESSAGES_DEBUG: all - MESON_COMMON_OPTIONS_NO_WARNING: "--buildtype debug --wrap-mode=nodownload" - MESON_COMMON_OPTIONS: "${MESON_COMMON_OPTIONS_NO_WARNING} --fatal-meson-warnings" + MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings" .only-default: only: @@ -72,10 +71,7 @@ fedora-x86_64: variables: CFLAGS: "-coverage -ftest-coverage -fprofile-arcs" script: - # FIXME: Cannot use MESON_COMMON_OPTIONS here because meson warns about gtkdoc - # feature fully functional in 0.54, but we only depend on 0.52. So we cannot build - # with --fatal-meson-warnings. - - meson ${MESON_COMMON_OPTIONS_NO_WARNING} + - meson ${MESON_COMMON_OPTIONS} --werror --default-library=both --prefix=$HOME/glib-installed @@ -326,7 +322,10 @@ vs2017-x64: script: # FIXME: These should use --wrap-mode=nodownload but the Windows CI machines # aren’t currently set up for that. - - .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS} --wrap-mode=default + - .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS} + --wrap-mode=default + --python.platlibdir=C:\Python37\site-packages + --python.purelibdir=C:\Python37\site-packages artifacts: reports: junit: "_build/${env:CI_JOB_NAME}-report.xml" @@ -351,7 +350,11 @@ vs2017-x64-static: script: # FIXME: These should use --wrap-mode=nodownload but the Windows CI machines # aren’t currently set up for that. - - .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS} --wrap-mode=default --default-library=static + - .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS} + --wrap-mode=default + --default-library=static + --python.platlibdir=C:\Python37\site-packages + --python.purelibdir=C:\Python37\site-packages artifacts: reports: junit: "_build/${env:CI_JOB_NAME}-report.xml" @@ -564,10 +567,7 @@ dist-job: only: - tags script: - # FIXME: Cannot use MESON_COMMON_OPTIONS here because meson warns about gtkdoc - # feature fully functional in 0.54, but we only depend on 0.52. So we cannot build - # with --fatal-meson-warnings. - - meson ${MESON_COMMON_OPTIONS_NO_WARNING} --buildtype release -Dgtk_doc=true -Dman=true _build + - meson ${MESON_COMMON_OPTIONS} --buildtype release -Dgtk_doc=true -Dman=true _build - cd _build - ninja dist - ninja glib-doc gobject-doc gio-doc diff --git a/.gitlab-ci/android-ndk.Dockerfile b/.gitlab-ci/android-ndk.Dockerfile index 1ea3622e7..0b410d42d 100644 --- a/.gitlab-ci/android-ndk.Dockerfile +++ b/.gitlab-ci/android-ndk.Dockerfile @@ -72,7 +72,7 @@ RUN rm -rf \ $ANDROID_NDK_PATH/sources/cxx-stl/llvm-libc++/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directory \ $ANDROID_NDK_PATH -RUN pip3 install meson==0.52.0 +RUN pip3 install meson==0.60.3 ARG HOST_USER_ID=5555 ENV HOST_USER_ID ${HOST_USER_ID} diff --git a/.gitlab-ci/coverity.Dockerfile b/.gitlab-ci/coverity.Dockerfile index 2585711c5..0a474fc75 100644 --- a/.gitlab-ci/coverity.Dockerfile +++ b/.gitlab-ci/coverity.Dockerfile @@ -1,4 +1,4 @@ -FROM registry.gitlab.gnome.org/gnome/glib/fedora:v13 +FROM registry.gitlab.gnome.org/gnome/glib/fedora:v14 ARG COVERITY_SCAN_PROJECT_NAME ARG COVERITY_SCAN_TOKEN diff --git a/.gitlab-ci/debian-stable.Dockerfile b/.gitlab-ci/debian-stable.Dockerfile index 84aa98ba2..fc7031271 100644 --- a/.gitlab-ci/debian-stable.Dockerfile +++ b/.gitlab-ci/debian-stable.Dockerfile @@ -65,7 +65,7 @@ RUN locale-gen de_DE.UTF-8 \ ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8 -RUN pip3 install meson==0.52.0 +RUN pip3 install meson==0.60.3 ARG HOST_USER_ID=5555 ENV HOST_USER_ID ${HOST_USER_ID} diff --git a/.gitlab-ci/fedora.Dockerfile b/.gitlab-ci/fedora.Dockerfile index deaa7c74e..f00751879 100644 --- a/.gitlab-ci/fedora.Dockerfile +++ b/.gitlab-ci/fedora.Dockerfile @@ -73,7 +73,7 @@ RUN dnf -y update \ make \ && dnf clean all -RUN pip3 install meson==0.52.1 +RUN pip3 install meson==0.60.3 # Set /etc/machine-id as it’s needed for some D-Bus tests RUN systemd-machine-id-setup diff --git a/.gitlab-ci/mingw.Dockerfile b/.gitlab-ci/mingw.Dockerfile index eb773e0f1..904fc1211 100644 --- a/.gitlab-ci/mingw.Dockerfile +++ b/.gitlab-ci/mingw.Dockerfile @@ -57,7 +57,7 @@ RUN dnf -y install \ WORKDIR /opt COPY cross_file_mingw64.txt /opt -RUN pip3 install meson==0.52.0 +RUN pip3 install meson==0.60.3 ARG HOST_USER_ID=5555 ENV HOST_USER_ID ${HOST_USER_ID} diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat index 1a6924bd2..55bc71bf2 100644 --- a/.gitlab-ci/test-msvc.bat +++ b/.gitlab-ci/test-msvc.bat @@ -12,7 +12,7 @@ for %%x in (%*) do ( set args=%args:~1% :: FIXME: make warnings fatal -pip3 install --upgrade --user meson==0.52.0 || goto :error +pip3 install --upgrade --user meson==0.60.3 || goto :error meson %args% _build || goto :error ninja -C _build || goto :error diff --git a/.gitlab-ci/test-msys2.sh b/.gitlab-ci/test-msys2.sh index ace412373..fbfbbcdcf 100755 --- a/.gitlab-ci/test-msys2.sh +++ b/.gitlab-ci/test-msys2.sh @@ -31,7 +31,7 @@ CCACHE_BASEDIR="$(pwd)" CCACHE_DIR="${CCACHE_BASEDIR}/_ccache" export CCACHE_BASEDIR CCACHE_DIR -pip3 install --upgrade --user meson==0.52.0 +pip3 install --upgrade --user meson==0.60.3 PATH="$(cygpath "$USERPROFILE")/.local/bin:$HOME/.local/bin:$PATH" CFLAGS="-coverage -ftest-coverage -fprofile-arcs" diff --git a/INSTALL.in b/INSTALL.in index c5b551cba..c1463cd04 100644 --- a/INSTALL.in +++ b/INSTALL.in @@ -24,7 +24,9 @@ information.) Information about pkg-config can be found at: http://www.freedesktop.org/software/pkgconfig/ -Meson (http://mesonbuild.com/) is also required. +Meson (http://mesonbuild.com/) is also required. If your distribution does not +package a new enough version of Meson, it can be [installed using +`pip`](https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip). In order to implement conversions between character sets, GLib requires an implementation of the standard iconv() routine. diff --git a/docs/meson-version.md b/docs/meson-version.md new file mode 100644 index 000000000..e1aa7407d --- /dev/null +++ b/docs/meson-version.md @@ -0,0 +1,30 @@ +Meson version policy +=== + +Aims +--- + + * Stable versions of GLib should be buildable from source on the majority of + systems which are still supported by their vendors, without requiring the + user to manually build a number of dependencies + * Unstable versions of GLib should be able to take advantage of newer build + system features where they would make maintenance of GLib easier, without + prejudicing the other aims + +Policy +--- + + * Stable branches of GLib will not change their Meson dependency after the + first release of that stable series + * Unstable branches of GLib can bump their Meson dependency if + - at least that version of Meson currently available in Debian Testing; or + - the Python version required by the new Meson dependency is available in + Debian Stable *and* the oldest currently-supported Ubuntu LTS + * The version of Meson used by GLib should be pinned and pre-installed in the + CI `Dockerfile`s so that GLib is guaranteed to be built against the expected + version + +The reasoning behind allowing a version bump if the Python which Meson depends +on is available in Debian Stable is that it’s [straightforward to install a more +recent Meson version using +`pip`](https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip). diff --git a/docs/reference/meson.build b/docs/reference/meson.build index 1bc97a2f6..564e1ca2a 100644 --- a/docs/reference/meson.build +++ b/docs/reference/meson.build @@ -47,9 +47,6 @@ gtkdoc_common_scan_args = [ ] if get_option('gtk_doc') - if not meson.version().version_compare('>=0.52.0') - error('Building documentation requires Meson >= 0.52.0.') - endif # Check we have the minimum gtk-doc version required. Older versions won't # generate correct documentation. dependency('gtk-doc', version : '>=1.32.1', diff --git a/gio/gio-querymodules-wrapper.py b/gio/gio-querymodules-wrapper.py deleted file mode 100644 index 351700d39..000000000 --- a/gio/gio-querymodules-wrapper.py +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env python3 - -import os -import subprocess -import sys - -if not os.environ.get("DESTDIR"): - print("GIO module cache creation...") - subprocess.call([sys.argv[1], sys.argv[2]]) diff --git a/gio/meson.build b/gio/meson.build index 9df7bdd67..b00ea1026 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -774,7 +774,7 @@ if have_bash bash_comp_inst_dir = '' if bash_comp_dep.found() bash_comp_dir_override = bash_comp_dep.version().version_compare('>= 2.10') ? ['datadir', get_option('datadir')] : ['prefix', get_option('prefix')] - bash_comp_inst_dir = bash_comp_dep.get_pkgconfig_variable('completionsdir', define_variable: bash_comp_dir_override) + bash_comp_inst_dir = bash_comp_dep.get_variable('completionsdir', pkgconfig_define: bash_comp_dir_override) endif if bash_comp_inst_dir == '' @@ -829,17 +829,12 @@ schemas_subdir = join_paths('glib-2.0', 'schemas') libgio_dep = declare_dependency(link_with : libgio, dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep], - include_directories : [gioinc]) - -# Work around variables kwarg requiring Meson 0.56 -if meson.version().version_compare('>=0.56.0') - libgio_dep = declare_dependency(dependencies: libgio_dep, - variables: [ - 'schemasdir=' + join_paths(glib_datadir, schemas_subdir), - 'giomoduledir=' + glib_giomodulesdir, - ] - ) -endif + include_directories : [gioinc], + variables : [ + 'schemasdir=' + join_paths(glib_datadir, schemas_subdir), + 'giomoduledir=' + glib_giomodulesdir, + ], +) pkg.generate(libgio, requires : ['glib-2.0', 'gobject-2.0'], @@ -861,11 +856,7 @@ pkg.generate(libgio, name : 'GIO', description : 'glib I/O library', ) - -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gio-2.0', libgio_dep) -endif - +meson.override_dependency('gio-2.0', libgio_dep) if host_system == 'windows' pkg.generate(requires : ['gobject-2.0', 'gmodule-no-export-2.0', 'gio-2.0'], @@ -876,9 +867,7 @@ if host_system == 'windows' name : 'GIO Windows specific APIs', description : 'Windows specific headers for glib I/O library', ) - if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gio-windows-2.0', libgio_dep) - endif + meson.override_dependency('gio-windows-2.0', libgio_dep) else pkg.generate(requires : ['gobject-2.0', 'gio-2.0'], subdirs : ['gio-unix-2.0'], @@ -888,9 +877,7 @@ else name : 'GIO unix specific APIs', description : 'unix specific headers for glib I/O library', ) - if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gio-unix-2.0', libgio_dep) - endif + meson.override_dependency('gio-unix-2.0', libgio_dep) endif if host_system == 'windows' @@ -991,7 +978,7 @@ glib_compile_resources = executable('glib-compile-resources', # Cannot override those programs in cross compilation case because they are # native executables that cannot be run on the build machine. # See https://gitlab.gnome.org/GNOME/glib/issues/1859. -if not meson.is_cross_build() +if not meson.can_run_host_binaries() meson.override_find_program('glib-compile-schemas', glib_compile_schemas) meson.override_find_program('glib-compile-resources', glib_compile_resources) meson.override_find_program('gio-querymodules', gio_querymodules) diff --git a/gio/tests/meson.build b/gio/tests/meson.build index 937c50885..7b4613403 100644 --- a/gio/tests/meson.build +++ b/gio/tests/meson.build @@ -603,7 +603,7 @@ if installed_tests_enabled endforeach endif -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() compiler_type = '--compiler=@0@'.format(cc.get_id()) @@ -830,7 +830,7 @@ foreach test_name, extra_args : gio_tests foreach var, value : installed_tests_env envs += '@0@=@1@'.format(var, value) endforeach - test_env_override = '@0@ @1@ '.format(env_program.path(), ' '.join(envs)) + test_env_override = '@0@ @1@ '.format(env_program.full_path(), ' '.join(envs)) endif test_conf.set('env', test_env_override) configure_file( diff --git a/glib/gnulib/gl_cv_cc_double_expbit0/meson.build b/glib/gnulib/gl_cv_cc_double_expbit0/meson.build index a6573d805..9ef27b0cc 100644 --- a/glib/gnulib/gl_cv_cc_double_expbit0/meson.build +++ b/glib/gnulib/gl_cv_cc_double_expbit0/meson.build @@ -71,7 +71,7 @@ int main () gl_cv_cc_double_expbit0_word = -1 gl_cv_cc_double_expbit0_bit = -1 -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(double_exponent_test, name : 'where to find the exponent in a \'double\'') if run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/gnulib/gl_cv_func_frexp_works/meson.build b/glib/gnulib/gl_cv_func_frexp_works/meson.build index 29f7bcabe..7319c28d9 100644 --- a/glib/gnulib/gl_cv_func_frexp_works/meson.build +++ b/glib/gnulib/gl_cv_func_frexp_works/meson.build @@ -76,7 +76,7 @@ int main() return result; }''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(frexp_test, name : 'frexp works', dependencies : [libm]) diff --git a/glib/gnulib/gl_cv_func_frexpl_works/meson.build b/glib/gnulib/gl_cv_func_frexpl_works/meson.build index 50e614e89..68af20295 100644 --- a/glib/gnulib/gl_cv_func_frexpl_works/meson.build +++ b/glib/gnulib/gl_cv_func_frexpl_works/meson.build @@ -104,7 +104,7 @@ int main() } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(frexpl_test, name : 'frexpl works', dependencies : [libm]) diff --git a/glib/gnulib/gl_cv_func_ldexpl_works/meson.build b/glib/gnulib/gl_cv_func_ldexpl_works/meson.build index ae176cb8e..3c95dc7d7 100644 --- a/glib/gnulib/gl_cv_func_ldexpl_works/meson.build +++ b/glib/gnulib/gl_cv_func_ldexpl_works/meson.build @@ -33,7 +33,7 @@ int main() } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(ldexpl_test, name : 'ldexpl works', dependencies : [libm]) diff --git a/glib/gnulib/gl_cv_func_printf_directive_a/meson.build b/glib/gnulib/gl_cv_func_printf_directive_a/meson.build index 10e0f8726..3283c98d2 100644 --- a/glib/gnulib/gl_cv_func_printf_directive_a/meson.build +++ b/glib/gnulib/gl_cv_func_printf_directive_a/meson.build @@ -79,7 +79,7 @@ glibc_printf_directive_a_test = ''' int main () { return 0; } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(printf_directive_a_test, name : 'printf supports the \'a\' and \'A\' directives') gl_cv_func_printf_directive_a = run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/gnulib/gl_cv_func_printf_directive_f/meson.build b/glib/gnulib/gl_cv_func_printf_directive_f/meson.build index b749fc0c6..afde78bf8 100644 --- a/glib/gnulib/gl_cv_func_printf_directive_f/meson.build +++ b/glib/gnulib/gl_cv_func_printf_directive_f/meson.build @@ -29,7 +29,7 @@ int main () } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(printf_directive_f_test, name : 'printf supports the \'F\' directive') gl_cv_func_printf_directive_f = run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/gnulib/gl_cv_func_printf_directive_ls/meson.build b/glib/gnulib/gl_cv_func_printf_directive_ls/meson.build index 35656b659..a7486ff49 100644 --- a/glib/gnulib/gl_cv_func_printf_directive_ls/meson.build +++ b/glib/gnulib/gl_cv_func_printf_directive_ls/meson.build @@ -62,7 +62,7 @@ int main () } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(printf_directive_ls_test, name : 'printf supports the \'ls\' directive') gl_cv_func_printf_directive_ls = run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/gnulib/gl_cv_func_printf_enomem/meson.build b/glib/gnulib/gl_cv_func_printf_enomem/meson.build index d0320e0a7..caa712442 100644 --- a/glib/gnulib/gl_cv_func_printf_enomem/meson.build +++ b/glib/gnulib/gl_cv_func_printf_enomem/meson.build @@ -54,7 +54,7 @@ int main() } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(printf_enomem_test, name : 'printf survives out-of-memory conditions') gl_cv_func_printf_enomem = run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/gnulib/gl_cv_func_printf_flag_grouping/meson.build b/glib/gnulib/gl_cv_func_printf_flag_grouping/meson.build index 00229c9aa..d30325bb7 100644 --- a/glib/gnulib/gl_cv_func_printf_flag_grouping/meson.build +++ b/glib/gnulib/gl_cv_func_printf_flag_grouping/meson.build @@ -20,7 +20,7 @@ int main () return 0; }''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(printf_flag_grouping_test, name : 'printf supports the grouping flag') gl_cv_func_printf_flag_grouping = run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/gnulib/gl_cv_func_printf_flag_leftadjust/meson.build b/glib/gnulib/gl_cv_func_printf_flag_leftadjust/meson.build index 26923ff6f..07daa9636 100644 --- a/glib/gnulib/gl_cv_func_printf_flag_leftadjust/meson.build +++ b/glib/gnulib/gl_cv_func_printf_flag_leftadjust/meson.build @@ -22,7 +22,7 @@ int main () } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(printf_flag_leftadjust_test, name : 'printf supports the left-adjust flag correctly') gl_cv_func_printf_flag_leftadjust = run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/gnulib/gl_cv_func_printf_flag_zero/meson.build b/glib/gnulib/gl_cv_func_printf_flag_zero/meson.build index 0fd170667..2cb00a8e5 100644 --- a/glib/gnulib/gl_cv_func_printf_flag_zero/meson.build +++ b/glib/gnulib/gl_cv_func_printf_flag_zero/meson.build @@ -23,7 +23,7 @@ int main () } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(printf_flag_zero_test, name : 'printf supports the zero flag correctly') gl_cv_func_printf_flag_zero = run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/gnulib/gl_cv_func_printf_infinite/meson.build b/glib/gnulib/gl_cv_func_printf_infinite/meson.build index 824eca8c0..9e30a382b 100644 --- a/glib/gnulib/gl_cv_func_printf_infinite/meson.build +++ b/glib/gnulib/gl_cv_func_printf_infinite/meson.build @@ -77,7 +77,7 @@ int main () } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(printf_infinite_double_test, name : 'printf supports infinite \'double\' arguments') gl_cv_func_printf_infinite = run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/gnulib/gl_cv_func_printf_infinite_long_double/meson.build b/glib/gnulib/gl_cv_func_printf_infinite_long_double/meson.build index 8b813b14d..64bab0fea 100644 --- a/glib/gnulib/gl_cv_func_printf_infinite_long_double/meson.build +++ b/glib/gnulib/gl_cv_func_printf_infinite_long_double/meson.build @@ -167,7 +167,7 @@ int main () ''' if gl_cv_func_printf_long_double - if not meson.is_cross_build() or meson.has_exe_wrapper() + if meson.can_run_host_binaries() run_result = cc.run(printf_infinite_long_double_test, name : 'printf supports infinite \'long double\' arguments') gl_cv_func_printf_infinite_long_double = (run_result.compiled() and run_result.returncode() == 0) diff --git a/glib/gnulib/gl_cv_func_printf_long_double/meson.build b/glib/gnulib/gl_cv_func_printf_long_double/meson.build index bd68fb377..3d0e01934 100644 --- a/glib/gnulib/gl_cv_func_printf_long_double/meson.build +++ b/glib/gnulib/gl_cv_func_printf_long_double/meson.build @@ -30,7 +30,7 @@ int main () } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(printf_long_double_test, name : 'printf supports \'long double\' arguments') gl_cv_func_printf_long_double = run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/gnulib/gl_cv_func_printf_precision/meson.build b/glib/gnulib/gl_cv_func_printf_precision/meson.build index 6f7ef4e3d..35290c52f 100644 --- a/glib/gnulib/gl_cv_func_printf_precision/meson.build +++ b/glib/gnulib/gl_cv_func_printf_precision/meson.build @@ -37,7 +37,7 @@ int main () } ''' -if not meson.is_cross_build() or meson.has_exe_wrapper() +if meson.can_run_host_binaries() run_result = cc.run(printf_precision_test, name : 'printf supports large precisions') gl_cv_func_printf_precision = run_result.compiled() and run_result.returncode() == 0 diff --git a/glib/meson.build b/glib/meson.build index 93fa5049a..4975d8bb8 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -401,17 +401,14 @@ pkg.generate(libglib, name : 'GLib', description : 'C Utility Library', ) - -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('glib-2.0', libglib_dep) -endif +meson.override_dependency('glib-2.0', libglib_dep) # On Windows, glib needs a spawn helper for g_spawn* API if host_system == 'windows' if host_machine.cpu_family() == 'x86' executable('gspawn-win32-helper', 'gspawn-win32-helper.c', install : true, - gui_app : true, + win_subsystem : 'windows', include_directories : configinc, dependencies : [libglib_dep]) executable('gspawn-win32-helper-console', 'gspawn-win32-helper.c', @@ -422,7 +419,7 @@ if host_system == 'windows' else executable('gspawn-win64-helper', 'gspawn-win32-helper.c', install : true, - gui_app : true, + win_subsystem : 'windows', include_directories : configinc, dependencies : [libglib_dep]) executable('gspawn-win64-helper-console', 'gspawn-win32-helper.c', @@ -453,11 +450,9 @@ configure_file( install_data('glib_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb')) # This is needed to make gdb find glib_gdb.py -if meson.version().version_compare('>=0.58') - env = environment() - env.prepend('PYTHONPATH', meson.current_source_dir()) - meson.add_devenv(env) -endif +env = environment() +env.prepend('PYTHONPATH', meson.current_source_dir()) +meson.add_devenv(env) gdb_conf = configuration_data() gdb_conf.set('datadir', glib_datadir) diff --git a/glib/tests/meson.build b/glib/tests/meson.build index 6f2752cb6..f2be776e5 100644 --- a/glib/tests/meson.build +++ b/glib/tests/meson.build @@ -315,7 +315,7 @@ executable('testing-helper', 'testing-helper.c', ) # some testing of gtester functionality -if not meson.is_cross_build() and host_system != 'windows' +if meson.can_run_host_binaries() and host_system != 'windows' xmllint = find_program('xmllint', required: false) if xmllint.found() tmpsample_xml = custom_target('tmpsample.xml', diff --git a/gmodule/meson.build b/gmodule/meson.build index e4c1023ec..0c5aad311 100644 --- a/gmodule/meson.build +++ b/gmodule/meson.build @@ -25,7 +25,7 @@ if g_module_impl == 'G_MODULE_IMPL_DL' if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' message('Building for MSVC: assuming that symbols are prefixed with underscore') g_module_need_uscore = 1 - elif meson.has_exe_wrapper() + elif meson.can_run_host_binaries() # FIXME: communicate result via stdout instead of return value, so non-0 return is not printed in bold red rres = cc.run(dlopen_dlsym_test_code, dependencies : libdl_dep, @@ -126,11 +126,9 @@ libgmodule_dep = declare_dependency(link_with : libgmodule, include_directories : [gmoduleinc], dependencies : [libglib_dep]) -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gmodule-no-export-2.0', libgmodule_dep) - meson.override_dependency('gmodule-export-2.0', libgmodule_dep) - meson.override_dependency('gmodule-2.0', libgmodule_dep) -endif +meson.override_dependency('gmodule-no-export-2.0', libgmodule_dep) +meson.override_dependency('gmodule-export-2.0', libgmodule_dep) +meson.override_dependency('gmodule-2.0', libgmodule_dep) if build_tests subdir('tests') diff --git a/gobject/meson.build b/gobject/meson.build index 026a0351e..07d096f36 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -150,10 +150,7 @@ pkg.generate(libgobject, libgobject_dep = declare_dependency(link_with : libgobject, include_directories : [gobjectinc], dependencies : [libglib_dep, glib_enumtypes_dep]) - -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gobject-2.0', libgobject_dep) -endif +meson.override_dependency('gobject-2.0', libgobject_dep) executable('gobject-query', 'gobject-query.c', install : true, @@ -171,11 +168,9 @@ configure_file( ) # This is needed to make gdb find gobject_gdb.py -if meson.version().version_compare('>=0.58') - env = environment() - env.prepend('PYTHONPATH', meson.current_source_dir()) - meson.add_devenv(env) -endif +env = environment() +env.prepend('PYTHONPATH', meson.current_source_dir()) +meson.add_devenv(env) if enable_systemtap gobject_stp = configure_file(input : 'gobject.stp.in', diff --git a/gthread/meson.build b/gthread/meson.build index 808e889cc..94a9ce5b5 100644 --- a/gthread/meson.build +++ b/gthread/meson.build @@ -34,7 +34,4 @@ pkg.generate(libgthread, ) libgthread_dep = declare_dependency(link_with : libgthread) - -if meson.version().version_compare('>=0.54.0') - meson.override_dependency('gthread-2.0', libgthread_dep) -endif +meson.override_dependency('gthread-2.0', libgthread_dep) diff --git a/meson.build b/meson.build index 13f28638a..1619cfa2e 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project('glib', 'c', 'cpp', version : '2.73.0', - # NOTE: We keep this pinned at 0.52 because that's what Debian Stable ships - meson_version : '>= 0.52.0', + # NOTE: See the policy in docs/meson-version.md before changing the Meson dependency + meson_version : '>= 0.60.0', default_options : [ 'buildtype=debugoptimized', 'warning_level=3', @@ -12,7 +12,7 @@ project('glib', 'c', 'cpp', cc = meson.get_compiler('c') cxx = meson.get_compiler('cpp') -cc_can_run = not meson.is_cross_build() or meson.has_exe_wrapper() +cc_can_run = meson.can_run_host_binaries() if cc.get_argument_syntax() == 'msvc' # Ignore several spurious warnings for things glib does very commonly @@ -100,7 +100,7 @@ installed_tests_template = files('template.test.in') installed_tests_template_tap = files('template-tap.test.in') # Don’t build the tests unless we can run them (either natively, in an exe wrapper, or by installing them for later use) -build_tests = get_option('tests') and (not meson.is_cross_build() or (meson.is_cross_build() and meson.has_exe_wrapper()) or installed_tests_enabled) +build_tests = get_option('tests') and (meson.can_run_host_binaries() or installed_tests_enabled) add_project_arguments('-D_GNU_SOURCE', language: 'c') @@ -662,19 +662,6 @@ if host_system != 'windows' and cc.has_function('stpcpy', prefix : '#include = 21 - #error Android is 21 or newer - #endif''') - if android_is_older and meson.version().version_compare('< 0.54.2') - error('Compiling for \n#include ') glib_conf.set('HAVE_MEMALIGN', 1) endif @@ -1047,7 +1034,7 @@ main(void) have_good_vsnprintf = true endif else - have_good_vsnprintf = meson.get_cross_property('have_c99_vsnprintf', false) + have_good_vsnprintf = meson.get_external_property('have_c99_vsnprintf', false) glib_conf.set('HAVE_C99_VSNPRINTF', have_good_vsnprintf) endif @@ -1095,7 +1082,7 @@ main(void) have_good_snprintf = true endif else - have_good_snprintf = meson.get_cross_property('have_c99_snprintf', false) + have_good_snprintf = meson.get_external_property('have_c99_snprintf', false) glib_conf.set('HAVE_C99_SNPRINTF', have_good_snprintf) endif @@ -1122,7 +1109,7 @@ main (void) have_good_printf = true endif else - have_good_printf = meson.get_cross_property('have_unix98_printf', false) + have_good_printf = meson.get_external_property('have_unix98_printf', false) glib_conf.set('HAVE_UNIX98_PRINTF', have_good_printf) endif endif @@ -1716,7 +1703,7 @@ if cc_can_run rres = cc.run(va_list_val_copy_prog, name : 'va_lists can be copied as values') glib_va_val_copy = rres.compiled() and rres.returncode() == 0 else - glib_va_val_copy = meson.get_cross_property('va_val_copy', true) + glib_va_val_copy = meson.get_external_property('va_val_copy', true) endif if not glib_va_val_copy glib_vacopy = glib_vacopy + '\n#define G_VA_COPY_AS_ARRAY 1' @@ -1995,7 +1982,7 @@ if cc_can_run rres = cc.run(stack_grows_check_prog, name : 'stack grows check') growing_stack = rres.compiled() and rres.returncode() == 0 else - growing_stack = meson.get_cross_property('growing_stack', false) + growing_stack = meson.get_external_property('growing_stack', false) endif glibconfig_conf.set10('G_HAVE_GROWING_STACK', growing_stack) @@ -2214,7 +2201,7 @@ if cc.has_function('strlcpy') if rres.compiled() and rres.returncode() == 0 glib_conf.set('HAVE_STRLCPY', 1) endif - elif meson.get_cross_property('have_strlcpy', false) + elif meson.get_external_property('have_strlcpy', false) glib_conf.set('HAVE_STRLCPY', 1) endif endif @@ -2271,7 +2258,7 @@ if cc_can_run rres = cc.run(cmdline_test_code, name : '/proc/self/cmdline') have_proc_self_cmdline = rres.compiled() and rres.returncode() == 0 else - have_proc_self_cmdline = meson.get_cross_property('have_proc_self_cmdline', false) + have_proc_self_cmdline = meson.get_external_property('have_proc_self_cmdline', false) endif glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) diff --git a/subprojects/pcre.wrap b/subprojects/pcre.wrap index a6b07b961..22f524303 100644 --- a/subprojects/pcre.wrap +++ b/subprojects/pcre.wrap @@ -1,11 +1,11 @@ [wrap-file] -directory = pcre-8.37 -source_url = https://sourceforge.net/projects/pcre/files/pcre/8.37/pcre-8.37.tar.bz2 -source_filename = pcre-8.37.tar.bz2 -source_hash = 51679ea8006ce31379fb0860e46dd86665d864b5020fc9cd19e71260eef4789d -patch_filename = pcre_8.37-4_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/pcre_8.37-4/get_patch -patch_hash = c957f42da6f6378300eb8a18f4a5cccdb8e2aada51a703cac842982f9f785399 +directory = pcre-8.45 +source_url = https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.bz2 +source_filename = pcre-8.45.tar.bz2 +source_hash = 4dae6fdcd2bb0bb6c37b5f97c33c2be954da743985369cddac3546e3218bffb8 +patch_filename = pcre_8.45-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/pcre_8.45-1/get_patch +patch_hash = 821f9b0e5578c5b3983434465de93e30ddfceb92e331a0c9110aba6bf0634ffa [provide] libpcre = pcre_dep diff --git a/tests/meson.build b/tests/meson.build index 42dc26ec1..cd41a7f3f 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -46,7 +46,7 @@ test_extra_programs = { if host_machine.system() == 'windows' test_extra_programs += { - 'spawn-test-win32-gui' : {'gui_app' : true} + 'spawn-test-win32-gui' : {'win_subsystem' : 'windows'} } endif @@ -119,6 +119,6 @@ foreach program_name, extra_args : test_extra_programs dependencies : common_deps + extra_args.get('dependencies', []), install_dir : installed_tests_execdir, install : install, - gui_app : extra_args.get('gui_app', false), + win_subsystem : extra_args.get('win_subsystem', 'console'), ) endforeach