summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2023-01-05 16:02:50 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2023-01-05 16:02:50 +0000
commit92f9c678f50f7529fb51068a9754587ec44cb8e6 (patch)
treec93ec6733b71d4c64ed445d229742084803da970
parent637b49539b6f5ffbe6ff16109948f47daababed0 (diff)
parent45c2f8c18eb3b6565af25bf646855ae4b8b80e68 (diff)
downloadglib-92f9c678f50f7529fb51068a9754587ec44cb8e6.tar.gz
Merge branch 'nirbheek/meson-subproject-usage-fixes' into 'main'
Various fixes for how we interact with subproject dependencies See merge request GNOME/glib!3177
-rw-r--r--.gitlab-ci.yml4
-rw-r--r--.gitlab-ci/README.md4
-rwxr-xr-x.gitlab-ci/run-docker.sh17
-rw-r--r--meson.build17
-rw-r--r--subprojects/libffi.wrap3
-rw-r--r--subprojects/pcre2.wrap24
-rw-r--r--subprojects/proxy-libintl.wrap9
7 files changed, 45 insertions, 33 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 36e86de73..8a2f35cdc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,10 +11,10 @@ cache:
- _ccache/
variables:
- FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v19"
+ FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v20"
COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v14"
- MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v9"
+ MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v10"
MESON_TEST_TIMEOUT_MULTIPLIER: 4
G_MESSAGES_DEBUG: all
MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings"
diff --git a/.gitlab-ci/README.md b/.gitlab-ci/README.md
index 15df442a8..3a1ffe409 100644
--- a/.gitlab-ci/README.md
+++ b/.gitlab-ci/README.md
@@ -5,7 +5,7 @@
GitLab CI jobs run in a Docker image, defined here. To update that image
(perhaps to install some more packages):
-1. Edit `.gitlab-ci/Dockerfile` with the changes you want
+1. Edit `.gitlab-ci/*.Dockerfile` with the changes you want
1. Run `.gitlab-ci/run-docker.sh build --base=debian-stable --base-version=1` to
build the new image (bump the version from the latest listed for that `base`
on https://gitlab.gnome.org/GNOME/glib/container_registry). If rebuilding the
@@ -23,5 +23,5 @@ GitLab CI jobs run in a Docker image, defined here. To update that image
1. Edit `.gitlab-ci.yml` (in the root of this repository) to use your new
image
-[pat]: https://gitlab.gnome.org/profile/personal_access_tokens
+[pat]: https://gitlab.gnome.org/-/profile/personal_access_tokens
[cs]: https://scan.coverity.com/
diff --git a/.gitlab-ci/run-docker.sh b/.gitlab-ci/run-docker.sh
index 33a0ae5d1..625f13ee7 100755
--- a/.gitlab-ci/run-docker.sh
+++ b/.gitlab-ci/run-docker.sh
@@ -15,16 +15,17 @@ read_arg() {
fi
}
-SUDO_CMD="sudo"
-if docker -v |& grep -q podman; then
+if type -p podman; then
# Using podman
- SUDO_CMD=""
+ DOCKER_CMD="podman"
# Docker is actually implemented by podman, and its OCI output
# is incompatible with some of the dockerd instances on GitLab
# CI runners.
export BUILDAH_FORMAT=docker
elif getent group docker | grep -q "\b${USER}\b"; then
- SUDO_CMD=""
+ DOCKER_CMD="docker"
+else
+ DOCKER_CMD="sudo docker"
fi
set -e
@@ -103,7 +104,7 @@ TAG="registry.gitlab.gnome.org/gnome/glib/${base}:${base_version}"
if [ $build == 1 ]; then
echo -e "\\e[1;32mBUILDING\\e[0m: ${base} as ${TAG}"
- $SUDO_CMD docker build \
+ $DOCKER_CMD build \
--build-arg HOST_USER_ID="$UID" \
--build-arg COVERITY_SCAN_PROJECT_NAME="${COVERITY_SCAN_PROJECT_NAME}" \
--build-arg COVERITY_SCAN_TOKEN="${COVERITY_SCAN_TOKEN}" \
@@ -116,16 +117,16 @@ if [ $push == 1 ]; then
echo -e "\\e[1;32mPUSHING\\e[0m: ${base} as ${TAG}"
if [ $no_login == 0 ]; then
- $SUDO_CMD docker login registry.gitlab.gnome.org
+ $DOCKER_CMD login registry.gitlab.gnome.org
fi
- $SUDO_CMD docker push $TAG
+ $DOCKER_CMD push $TAG
exit $?
fi
if [ $run == 1 ]; then
echo -e "\\e[1;32mRUNNING\\e[0m: ${base} as ${TAG}"
- $SUDO_CMD docker run \
+ $DOCKER_CMD run \
--rm \
--volume "$(pwd)/..:/home/user/app" \
--workdir "/home/user/app" \
diff --git a/meson.build b/meson.build
index 75a3db504..83bea942c 100644
--- a/meson.build
+++ b/meson.build
@@ -2038,7 +2038,8 @@ else
libiconv = dependency('iconv')
endif
-pcre2 = dependency('libpcre2-8', version: '>= 10.32', required : false)
+pcre2_req = '>=10.32'
+pcre2 = dependency('libpcre2-8', version: pcre2_req, required: false, allow_fallback: false)
if not pcre2.found()
if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl'
# MSVC: Search for the PCRE2 library by the configuration, which corresponds
@@ -2054,8 +2055,11 @@ endif
# Try again with the fallback
if not pcre2.found()
- pcre2 = dependency('libpcre2-8', required : true, fallback : ['pcre2', 'libpcre2_8'])
- use_pcre2_static_flag = true
+ pcre2 = dependency('libpcre2-8', version: pcre2_req, allow_fallback: true)
+ assert(pcre2.type_name() == 'internal')
+ # static flags are automatically enabled by the subproject if it's built
+ # with default_library=static
+ use_pcre2_static_flag = false
elif host_system == 'windows'
pcre2_static = cc.links('''#define PCRE2_STATIC
#define PCRE2_CODE_UNIT_WIDTH 8
@@ -2077,7 +2081,7 @@ subproject('gvdb')
gvdb_dep = dependency('gvdb')
libm = cc.find_library('m', required : false)
-libffi_dep = dependency('libffi', version : '>= 3.0.0', fallback : ['libffi', 'ffi_dep'])
+libffi_dep = dependency('libffi', version : '>= 3.0.0')
libz_dep = dependency('zlib')
@@ -2086,7 +2090,7 @@ libz_dep = dependency('zlib')
# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
# implementations. This could be extended if issues are found in some platforms.
libintl_deps = []
-libintl = dependency('intl', required: false)
+libintl = dependency('intl', required: false, allow_fallback: false)
if libintl.found()
# libintl supports different threading APIs, which may not
# require additional flags, but it defaults to using pthreads if
@@ -2112,7 +2116,8 @@ endif
if libintl.found()
have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', dependencies: libintl_deps)
else
- libintl = subproject('proxy-libintl').get_variable('intl_dep')
+ libintl = dependency('intl', allow_fallback: true)
+ assert(libintl.type_name() == 'internal')
libintl_deps = [libintl]
have_bind_textdomain_codeset = true # proxy-libintl supports it
endif
diff --git a/subprojects/libffi.wrap b/subprojects/libffi.wrap
index 00b29d6a2..a8a23bbef 100644
--- a/subprojects/libffi.wrap
+++ b/subprojects/libffi.wrap
@@ -3,3 +3,6 @@ directory=libffi
url=https://gitlab.freedesktop.org/gstreamer/meson-ports/libffi.git
revision=meson
depth=1
+
+[provide]
+libffi = ffi_dep
diff --git a/subprojects/pcre2.wrap b/subprojects/pcre2.wrap
index 6196f1d0c..1e5291498 100644
--- a/subprojects/pcre2.wrap
+++ b/subprojects/pcre2.wrap
@@ -1,15 +1,15 @@
[wrap-file]
-directory = pcre2-10.40
-source_url = https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.40/pcre2-10.40.tar.bz2
-source_filename = pcre2-10.40.tar.bz2
-source_hash = 14e4b83c4783933dc17e964318e6324f7cae1bc75d8f3c79bc6969f00c159d68
-patch_filename = pcre2_10.40-3_patch.zip
-patch_url = https://wrapdb.mesonbuild.com/v2/pcre2_10.40-3/get_patch
-patch_hash = 95391923529b4c1647a2cf88cd3b59cceb4f92393775e011f530e7865de0c7fb
-wrapdb_version = 10.40-3
+directory = pcre2-10.42
+source_url = https://github.com/PhilipHazel/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2
+source_filename = pcre2-10.42.tar.bz2
+source_hash = 8d36cd8cb6ea2a4c2bb358ff6411b0c788633a2a45dabbf1aeb4b701d1b5e840
+patch_filename = pcre2_10.42-2_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/pcre2_10.42-2/get_patch
+patch_hash = 350dc342b81a1611af43e5cc23f1b10453c7df51d5bb60ab9ee247daf03802bc
+wrapdb_version = 10.42-2
[provide]
-libpcre2-8 = -libpcre2_8
-libpcre2-16 = -libpcre2_16
-libpcre2-32 = -libpcre2_32
-libpcre2-posix = -libpcre2_posix
+libpcre2-8 = libpcre2_8
+libpcre2-16 = libpcre2_16
+libpcre2-32 = libpcre2_32
+libpcre2-posix = libpcre2_posix
diff --git a/subprojects/proxy-libintl.wrap b/subprojects/proxy-libintl.wrap
index 0e6c8529c..dae4adfeb 100644
--- a/subprojects/proxy-libintl.wrap
+++ b/subprojects/proxy-libintl.wrap
@@ -1,5 +1,8 @@
[wrap-git]
-directory=proxy-libintl
-url=https://github.com/frida/proxy-libintl.git
-revision=c03e1a74b17fa7ec467e110130775409e4828a4c
+directory = proxy-libintl
+url = https://github.com/frida/proxy-libintl.git
+revision = 0.4
depth=1
+
+[provide]
+intl = intl_dep