summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2022-12-29 19:29:40 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2022-12-30 03:34:40 +0530
commit869907ae9190e1455c02be0236879aa973e63bf5 (patch)
tree2933ca37bc4bb4a4bcf83f8c3681c5d9b9dac0bb
parent419e726ce0cd58277644050ed41c63dc29a80274 (diff)
downloadglib-networking-869907ae9190e1455c02be0236879aa973e63bf5.tar.gz
ci: Use meson subprojects instead of gvsbuild
1. gvsbuild has broken CI multiple times in the past while 2. gvsbuild main branch requires python 3.8, and we only have 3.7 3. Older gvsbuild commits / tags have broken URLs, and even if you fix them, the glib version is too old 4. gvsbuild actually takes a very long time to build everything We have an openssl project now. Not suitable for production use, but it's fine for CI. Need newer Meson to be able to use --vsenv reliably: ``` [...] File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\mesonbuild\mesonlib\vsenv.py", line 96, in _setup_vsenv k, v = bat_line.split('=', 1) ValueError: not enough values to unpack (expected 2, got 1) ```
-rw-r--r--.gitlab-ci.yml6
-rw-r--r--.gitlab-ci/openssl.wrap14
-rw-r--r--.gitlab-ci/test-msvc.bat40
-rw-r--r--meson.build22
-rw-r--r--subprojects/.gitignore12
-rw-r--r--subprojects/glib.wrap11
6 files changed, 48 insertions, 57 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7f3cdc3..779e4db 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -129,7 +129,11 @@ vs2017-x64:
tags:
- win32-ps
script:
- - .gitlab-ci/test-msvc.bat
+ - pip3 install --upgrade --user meson~=0.64.0
+ - mv .gitlab-ci\openssl.wrap subprojects
+ - meson setup --vsenv builddir -Dgnutls=disabled -Dopenssl=enabled -Dlibproxy=disabled -Denvironment_proxy=disabled -Dgnome_proxy=disabled -Ddebug_logs=true -Dopenssl:default_library=static
+ - meson compile -C builddir
+ - meson test -C builddir 'glib-networking:' --timeout-multiplier=10
artifacts:
paths:
- build/test-results
diff --git a/.gitlab-ci/openssl.wrap b/.gitlab-ci/openssl.wrap
new file mode 100644
index 0000000..ed29373
--- /dev/null
+++ b/.gitlab-ci/openssl.wrap
@@ -0,0 +1,14 @@
+[wrap-file]
+directory = openssl-1.1.1l
+source_url = https://www.openssl.org/source/openssl-1.1.1l.tar.gz
+source_filename = openssl-1.1.1l.tar.gz
+source_hash = 0b7a3e5e59c34827fe0c3a74b7ec8baef302b98fa80088d7f9153aa16fa76bd1
+patch_filename = openssl_1.1.1l-3_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/openssl_1.1.1l-3/get_patch
+patch_hash = a0cb8285cda3ae0e1898b4e88427c19bf245184259f41395010182655f9f8ce6
+
+[provide]
+libcrypto = libcrypto_dep
+libssl = libssl_dep
+openssl = openssl_dep
+
diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat
deleted file mode 100644
index d99d92f..0000000
--- a/.gitlab-ci/test-msvc.bat
+++ /dev/null
@@ -1,40 +0,0 @@
-@echo on
-:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the
-:: specified build architecture
-call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
-@echo on
-
-set BUILD_DIR=c:\gnet
-
-@RD /S /Q %BUILD_DIR%
-
-IF EXIST %BUILD_DIR% GOTO NOGVSBUILD
-
-git clone --depth 1 https://github.com/wingtk/gvsbuild.git -b glib-2.74.0 || goto :error
-
-pushd gvsbuild
-python.exe build.py --verbose --debug build -p x64 --vs-ver 15 --build-dir %BUILD_DIR% openssl glib || goto :error
-popd
-
-:NOGVSBUILD
-
-set DEPS_DIR=%BUILD_DIR%\gtk\x64\release
-set PATH=%DEPS_DIR%\bin;%PATH%
-set LIB=%DEPS_DIR%\lib;%LIB%
-set LIBPATH=%DEPS_DIR%\lib;%LIBPATH%
-set INCLUDE=%DEPS_DIR%\include;%DEPS_DIR%\include\glib-2.0;%INCLUDE%
-set PKG_CONFIG_PATH=%DEPS_DIR%\lib\pkgconfig
-
-:: FIXME: make warnings fatal
-:: FIXME: Environment proxy ought to work on Windows: https://gitlab.gnome.org/GNOME/glib-networking/-/issues/185
-pip3 install --upgrade --user meson==0.60.0 || goto :error
-meson build -Dgnutls=disabled -Dopenssl=enabled -Dlibproxy=disabled -Denvironment_proxy=disabled -Dgnome_proxy=disabled -Ddebug_logs=true || goto :error
-ninja -C build || goto :error
-
-meson test -C build --timeout-multiplier=10 || goto :error
-
-:: FIXME: can we get code coverage support?
-
-goto :EOF
-:error
-exit /b 1
diff --git a/meson.build b/meson.build
index 2a31738..d262481 100644
--- a/meson.build
+++ b/meson.build
@@ -58,23 +58,13 @@ if host_system.contains('linux') or host_system == 'android'
endif
# *** Check GLib GIO ***
-glib_dep = dependency('glib-2.0', version: '>= 2.73.3',
- fallback: ['glib', 'libglib_dep'])
-gio_dep = dependency('gio-2.0',
- fallback: ['glib', 'libgio_dep'])
-gobject_dep = dependency('gobject-2.0',
- fallback: ['glib', 'libgobject_dep'])
-gmodule_dep = dependency('gmodule-2.0',
- fallback: ['glib', 'libgmodule_dep'])
-
-if glib_dep.type_name() == 'internal'
- glib_proj = subproject('glib')
- gio_module_dir = glib_proj.get_variable('glib_giomodulesdir')
-else
- gio_module_dir = gio_dep.get_variable('giomoduledir',
- pkgconfig_define: ['libdir', join_paths(prefix, libdir)])
-endif
+glib_dep = dependency('glib-2.0', version: '>= 2.73.3')
+gio_dep = dependency('gio-2.0')
+gobject_dep = dependency('gobject-2.0')
+gmodule_dep = dependency('gmodule-2.0')
+gio_module_dir = gio_dep.get_variable('giomoduledir',
+ pkgconfig_define: ['libdir', join_paths(prefix, libdir)])
assert(gio_module_dir != '', 'GIO_MODULE_DIR is missing from gio-2.0.pc')
# *** Checks for LibProxy ***
diff --git a/subprojects/.gitignore b/subprojects/.gitignore
new file mode 100644
index 0000000..0ae31e1
--- /dev/null
+++ b/subprojects/.gitignore
@@ -0,0 +1,12 @@
+/glib*/
+/libffi*/
+/openssl*/
+/packagecache/
+/pcre2*/
+/zlib*/
+
+/gvdb.wrap
+/libffi.wrap
+/openssl.wrap
+/pcre2.wrap
+/zlib.wrap
diff --git a/subprojects/glib.wrap b/subprojects/glib.wrap
new file mode 100644
index 0000000..2ea0dbf
--- /dev/null
+++ b/subprojects/glib.wrap
@@ -0,0 +1,11 @@
+[wrap-file]
+directory = glib-2.74.4
+source_url = https://download.gnome.org/sources/glib/2.74/glib-2.74.4.tar.xz
+source_fallback_url = https://ftp.acc.umu.se/pub/gnome/sources/glib/2.74/glib-2.74.4.tar.xz
+source_filename = glib-2.74.4.tar.xz
+source_hash = 0e82da5ea129b4444227c7e4a9e598f7288d1994bf63f129c44b90cfd2432172
+wrapdb_version = 2.74.4-1
+
+[provide]
+dependency_names = gthread-2.0, gobject-2.0, gmodule-no-export-2.0, gmodule-export-2.0, gmodule-2.0, glib-2.0, gio-2.0, gio-windows-2.0, gio-unix-2.0
+program_names = glib-genmarshal, glib-mkenums, glib-compile-schemas, glib-compile-resources, gio-querymodules, gdbus-codegen