diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-02-21 00:51:44 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-02-27 02:48:42 +0530 |
commit | a058ab837d85474f95ca410c9bed51b123ccd0d0 (patch) | |
tree | 253e8e9cbfd6c800fb82ef7d7805f72993fa0f51 | |
parent | b5816971622410c790f6f2220f7e81a9ca27e264 (diff) |
Bump glib to 2.62.5 and glib-networking to 2.62.3
26 files changed, 47 insertions, 3682 deletions
diff --git a/recipes/build-tools/glib-tools.recipe b/recipes/build-tools/glib-tools.recipe index e4f0a1b1..ccf5e1b2 100644 --- a/recipes/build-tools/glib-tools.recipe +++ b/recipes/build-tools/glib-tools.recipe @@ -2,37 +2,20 @@ class Recipe(recipe.Recipe): name = 'glib-tools' - version = '2.56.1' + version = '2.62.5' stype = SourceType.TARBALL url = 'gnome://glib/%(maj_ver)s/glib-%(version)s.tar.xz' tarball_dirname = 'glib-%(version)s' - tarball_checksum = '40ef3f44f2c651c7a31aedee44259809b6f03d3d20be44545cd7d177221c0b8d' + tarball_checksum = 'b8d1cdafa46658b63d7512efbe2cd21bd36cd7be83140e44930c47b79f82452e' licenses = [License.LGPLv2Plus] btype = BuildType.MESON meson_options = {'internal_pcre': 'true', 'libmount': 'false', - 'dtrace': 'false', 'iconv': 'libc', 'selinux' : 'false'} + 'dtrace': 'false', 'iconv': 'auto', 'selinux' : 'disabled'} deps = ['libffi', 'zlib', 'pkg-config', 'meson', 'gettext-tools'] - patches = ['../glib/glib-2.57-meson-backported-fixes.patch', - '../glib/0001-gengiotypefuncs.py-Read-and-parse-files-in-binary-mo.patch', - # XXX: Remove when we upgrade our mingw toolchain - 'glib-tools/0001-meson-Disable-tests-fail-on-our-ancient-MinGW.patch', - ] def prepare(self): - if self.config.target_platform != Platform.LINUX: - # Disable valgrind code on non-Linux, in the best case it just - # gives us compiler errors :) - self.append_env('CFLAGS', '-DNVALGRIND=1') - self.meson_options.update({'xattr': 'false'}) - # macOS provides libiconv as a separate library - if self.config.target_platform == Platform.DARWIN: - self.meson_options.update({'iconv': 'native'}) - # linux and BSD provide iconv as a part of libc - elif self.config.target_platform == Platform.LINUX: - self.meson_options.update({'iconv': 'libc'}) - # Other platforms don't provide libiconv, so we build it - else: - self.meson_options.update({'iconv': 'gnu'}) + # Android only provides libiconv with API level >=28 (Pie and newer) + if self.config.target_platform == Platform.ANDROID: self.deps.append('libiconv') if self.config.target_platform == Platform.WINDOWS: diff --git a/recipes/glib-networking.recipe b/recipes/glib-networking.recipe index 494e495d..c1f17414 100644 --- a/recipes/glib-networking.recipe +++ b/recipes/glib-networking.recipe @@ -5,27 +5,17 @@ from cerbero.tools.libtool import LibtoolLibrary class Recipe(recipe.Recipe): name = 'glib-networking' - version = '2.56.1' + version = '2.62.3' licenses = [{License.LGPLv2Plus: None, License.Misc: ['LICENSE_EXCEPTION']}] stype = SourceType.TARBALL btype = BuildType.MESON url = 'gnome://' - tarball_checksum = 'df47b0e0a037d2dcf6b1846cbdf68dd4b3cc055e026bb40c4a55f19f29f635c8' + tarball_checksum = '8ca1f86f23a76b5c7640624f7d5490705c78e81375e1741c9a1c41ce7f8f7ff7' meson_options = {'ca_certificates_path': '', 'libproxy_support': 'false', 'gnome_proxy_support': 'false', 'pkcs11_support': 'false', # Also build static modules on all platforms 'static_modules': 'true'} deps = ['glib', 'gnutls'] - # These patches are upstream, remove on bump - patches = [name + '/0001-meson-Use-.so-for-modules-on-macOS-instead-of-dylib.patch', - name + '/0002-meson-Unbreak-the-non-macOS-builds.patch', - # XXX: This patch may require changes to gnutls's system trust - # since we can no longer set the certificate path in glib-networking - name + '/0003-Use-the-GnuTLS-system-trust-by-default.patch', - name + '/0004-meson-Only-run-gio-querymodules-if-it-s-found.patch', - name + '/0001-Don-t-use-the-GCC-ternary-syntax-extension.patch', - # https://gitlab.gnome.org/GNOME/glib-networking/merge_requests/22 - name + '/0001-tls-modules-Export-load-unload-query-symbols-on-MSVC.patch'] files_misc = ['lib/gio/modules/libgiognutls%(mext)s'] files_lang = ['glib-networking'] diff --git a/recipes/glib-networking/0001-Don-t-use-the-GCC-ternary-syntax-extension.patch b/recipes/glib-networking/0001-Don-t-use-the-GCC-ternary-syntax-extension.patch deleted file mode 100644 index 711fd973..00000000 --- a/recipes/glib-networking/0001-Don-t-use-the-GCC-ternary-syntax-extension.patch +++ /dev/null @@ -1,27 +0,0 @@ -From fb50b50e6fc94c713ea0710e236403bff1419a98 Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Tue, 19 Jun 2018 10:34:06 +0530 -Subject: [PATCH] Don't use the GCC ternary syntax extension - -It breaks MSVC compatibility, and is only useful when the expression has -to be evaluated only once, which is not applicable here. ---- - tls/gnutls/gtlsclientconnection-gnutls.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tls/gnutls/gtlsclientconnection-gnutls.c b/tls/gnutls/gtlsclientconnection-gnutls.c -index 97cb821..fae4b71 100644 ---- a/tls/gnutls/gtlsclientconnection-gnutls.c -+++ b/tls/gnutls/gtlsclientconnection-gnutls.c -@@ -155,7 +155,7 @@ g_tls_client_connection_gnutls_compute_session_id (GTlsClientConnectionGnutls *g - session_id = g_strdup_printf ("%s/%s/%d/%s", addrstr, - server_hostname ? server_hostname : "", - port, -- cert_hash ?: ""); -+ cert_hash ? cert_hash : ""); - gnutls->session_id = g_bytes_new_take (session_id, strlen (session_id)); - g_free (addrstr); - g_free (cert_hash); --- -2.12.2.windows.2 - diff --git a/recipes/glib-networking/0001-meson-Use-.so-for-modules-on-macOS-instead-of-dylib.patch b/recipes/glib-networking/0001-meson-Use-.so-for-modules-on-macOS-instead-of-dylib.patch deleted file mode 100644 index 54bfa433..00000000 --- a/recipes/glib-networking/0001-meson-Use-.so-for-modules-on-macOS-instead-of-dylib.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 3b5ddb24df9fab42d95393e520a040d3c8b15f7a Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Tue, 22 May 2018 05:03:18 +0530 -Subject: [PATCH 1/4] meson: Use .so for modules on macOS instead of dylib - -This matches what libtool produces, and what gio/gmodule expect. ---- - meson.build | 10 +++++++++- - proxy/gnome/meson.build | 1 + - proxy/libproxy/meson.build | 1 + - tls/gnutls/meson.build | 1 + - 4 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 1e6b29e..1c52cc0 100644 ---- a/meson.build -+++ b/meson.build -@@ -16,6 +16,7 @@ installed_tests_metadir = join_paths(datadir, 'installed-tests', meson.project_n - installed_tests_execdir = join_paths(libexecdir, 'installed-tests', meson.project_name()) - - cc = meson.get_compiler('c') -+host_system = host_machine.system() - - config_h = configuration_data() - -@@ -36,7 +37,7 @@ symbol_map = join_paths(meson.current_source_dir(), meson.project_name() + '.map - - module_ldflags = [] - --if host_machine.system().contains('linux') -+if host_system.contains('linux') - test_ldflag = '-Wl,--version-script,' + symbol_map - - module_ldflags += cc.get_supported_arguments(test_ldflag) -@@ -100,6 +101,13 @@ subdir('po') - enable_installed_tests = get_option('installed_tests') - test_template = files('template.test.in') - -+module_suffix = '' -+# Keep the autotools convention for shared module suffix because GModule -+# depends on it: https://gitlab.gnome.org/GNOME/glib/issues/520 -+if ['darwin', 'ios'].contains(host_system) -+ module_suffix = 'so' -+endif -+ - if enable_libproxy_support or enable_gnome_proxy_support - proxy_test_programs = [] - -diff --git a/proxy/gnome/meson.build b/proxy/gnome/meson.build -index 069a459..1e65c9a 100644 ---- a/proxy/gnome/meson.build -+++ b/proxy/gnome/meson.build -@@ -16,6 +16,7 @@ module = shared_module( - dependencies: deps, - link_args: module_ldflags, - link_depends: symbol_map, -+ name_suffix: module_suffix, - install: true, - install_dir: gio_module_dir - ) -diff --git a/proxy/libproxy/meson.build b/proxy/libproxy/meson.build -index baa7ab7..c0c8af6 100644 ---- a/proxy/libproxy/meson.build -+++ b/proxy/libproxy/meson.build -@@ -40,6 +40,7 @@ module = shared_module( - c_args: '-DGLIBPROXY_MODULE', - link_args: module_ldflags, - link_depends: symbol_map, -+ name_suffix: module_suffix, - install: true, - install_dir: gio_module_dir - ) -diff --git a/tls/gnutls/meson.build b/tls/gnutls/meson.build -index 98bbb73..c0d4b3f 100644 ---- a/tls/gnutls/meson.build -+++ b/tls/gnutls/meson.build -@@ -38,6 +38,7 @@ module = shared_module( - dependencies: deps, - link_args: module_ldflags, - link_depends: symbol_map, -+ name_suffix: module_suffix, - install: true, - install_dir: gio_module_dir - ) --- -2.17.0 - diff --git a/recipes/glib-networking/0001-tls-modules-Export-load-unload-query-symbols-on-MSVC.patch b/recipes/glib-networking/0001-tls-modules-Export-load-unload-query-symbols-on-MSVC.patch deleted file mode 100644 index c2d60e90..00000000 --- a/recipes/glib-networking/0001-tls-modules-Export-load-unload-query-symbols-on-MSVC.patch +++ /dev/null @@ -1,46 +0,0 @@ -From dab7c001aaf3f5863873f51a22f0c00b993f52ab Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Wed, 20 Feb 2019 14:47:04 +0530 -Subject: [PATCH] tls modules: Export load/unload/query symbols on MSVC - -These must be explicitly exported or the DLLs outputted won't be -loadable - -'g_io_gnutls_load': The specified procedure could not be found. -Failed to load module: c:\path\to\lib\gio\modules\giognutls.dll ---- - tls/gnutls/gnutls-module.c | 6 +++--- - tls/openssl/openssl-module.c | 6 +++--- - 2 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/tls/gnutls/gnutls-module.c b/tls/gnutls/gnutls-module.c -index 8983bd7..8dd09ca 100644 ---- a/tls/gnutls/gnutls-module.c -+++ b/tls/gnutls/gnutls-module.c -@@ -30,7 +30,7 @@ - #include "gtlsbackend-gnutls-pkcs11.h" - - --void -+G_MODULE_EXPORT void - g_io_gnutls_load (GIOModule *module) - { - gchar *locale_dir; -@@ -53,12 +53,12 @@ g_io_gnutls_load (GIOModule *module) - g_free (locale_dir); - } - --void -+G_MODULE_EXPORT void - g_io_gnutls_unload (GIOModule *module) - { - } - --gchar ** -+G_MODULE_EXPORT gchar ** - g_io_gnutls_query (void) - { - gchar *eps[] = { --- -2.20.1 - diff --git a/recipes/glib-networking/0002-meson-Unbreak-the-non-macOS-builds.patch b/recipes/glib-networking/0002-meson-Unbreak-the-non-macOS-builds.patch deleted file mode 100644 index ef7fae33..00000000 --- a/recipes/glib-networking/0002-meson-Unbreak-the-non-macOS-builds.patch +++ /dev/null @@ -1,36 +0,0 @@ -From a93b55e9e0dc659c457d943c9520d18191e2e6f0 Mon Sep 17 00:00:00 2001 -From: Debarshi Ray <debarshir@gnome.org> -Date: Tue, 29 May 2018 18:58:40 +0200 -Subject: [PATCH 2/4] meson: Unbreak the non-macOS builds - -The name_suffix keyword argument identifies an empty array, not an -empty string, as None or null [1]. Using an empty string creates -shared objects without any suffix whatsoever on non-macOS -environments, which GModule can't load. - -Fallout from 8d3367c2c500a8c9f67f0447c4f711ca89625ae4 - -[1] As per the implementation of the BuildTarget class in -meson/mesonbuild/build.py - -https://gitlab.gnome.org/GNOME/glib-networking/issues/33 ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 1c52cc0..c875331 100644 ---- a/meson.build -+++ b/meson.build -@@ -101,7 +101,7 @@ subdir('po') - enable_installed_tests = get_option('installed_tests') - test_template = files('template.test.in') - --module_suffix = '' -+module_suffix = [] - # Keep the autotools convention for shared module suffix because GModule - # depends on it: https://gitlab.gnome.org/GNOME/glib/issues/520 - if ['darwin', 'ios'].contains(host_system) --- -2.17.0 - diff --git a/recipes/glib-networking/0003-Use-the-GnuTLS-system-trust-by-default.patch b/recipes/glib-networking/0003-Use-the-GnuTLS-system-trust-by-default.patch deleted file mode 100644 index 8ab05492..00000000 --- a/recipes/glib-networking/0003-Use-the-GnuTLS-system-trust-by-default.patch +++ /dev/null @@ -1,348 +0,0 @@ -From 6c8ee5721428db1635bcc05044419038cbcf82ba Mon Sep 17 00:00:00 2001 -From: Michael Catanzaro <mcatanzaro@igalia.com> -Date: Thu, 8 Feb 2018 22:02:06 -0600 -Subject: [PATCH 3/4] Use the GnuTLS system trust by default - -Get rid of the ca_certificates_path build flag. The default GTlsDatabase -will now use the GnuTLS system trust. GTlsFileDatabase now builds its -internal hash tables by iterating its gnutls_x509_trust_list_t, rather -than by parsing its certificate file manually. - -The find-ca-certificates script is removed, since it's no longer needed. - -There are some potential compatibility risks here: - - * The minimum required GnuTLS version is increased from 3.3.5 to 3.4. - - * If GnuTLS is not configured with a system trust, all certificate - verification using the default GTlsDatabase will fail. I noticed that - GNOME's flatpak runtime does not configure a system trust, so this - breaks HTTPS there. This is sad for Epiphany Technology Preview, but - we should do this anyway, and separately fix the GNOME runtime. - - * It was previously possible to configure glib-networking using - --without-ca-certificates to ensure the default GTlsDatabase is - empty (GNOME #727282). Apparently this was desirable on some embedded - systems, though I'm not sure why. Such configuration is still - possible by configuring GnuTLS with no system trust. Presumably, - anybody relying on this behavior will notice that the - --without-ca-certificates flag has disappeared during the build - system change and investigate, so this seems unproblematic. - - * The default GTlsDatabase is a GTlsFileDatabase, but it might not - actually correspond to a file anymore. This will be fixed in the next - commit. - - * If the anchors property of a GTlsFileDatabase is NULL, that - previously indicated an empty GTlsFileDatabase, but now indicates - that the system trust is used. This will also be fixed in the next - commit. - - * Certificate handles created using the default GTlsDatabase will be - different before and after this commit. This seems unlikely to cause - problems in practice, since a quick Debian codesearch reveals zero - applications using our certificate handles. But, if an application - were to rely on handles generated by previous versions of - glib-networking being valid in the new version, it would break. - -None of the above seem likely to cause practical issues, once -distributors ensure that GnuTLS is built properly, so I think we can -proceed. - -https://bugzilla.gnome.org/show_bug.cgi?id=753260 ---- - find-ca-certificates | 20 ----- - meson.build | 10 +-- - meson_options.txt | 1 - - tls/gnutls/gtlsbackend-gnutls.c | 6 +- - tls/gnutls/gtlsfiledatabase-gnutls.c | 117 +++++++++++++++------------ - 5 files changed, 66 insertions(+), 88 deletions(-) - delete mode 100755 find-ca-certificates - -diff --git a/find-ca-certificates b/find-ca-certificates -deleted file mode 100755 -index 4c5fd8f..0000000 ---- a/find-ca-certificates -+++ /dev/null -@@ -1,20 +0,0 @@ --#!/usr/bin/env python3 -- --import errno --import os --import sys -- --locations = [ '/etc/pki/tls/certs/ca-bundle.crt', -- '/etc/ssl/certs/ca-certificates.crt', -- '/etc/ssl/ca-bundle.pem' --] -- --if len(sys.argv) > 1: -- locations.insert(0, sys.argv[1]) -- --for location in locations: -- if os.path.isfile(location): -- sys.stdout.write(location) -- sys.exit(0) -- --sys.exit(errno.ENOENT) -diff --git a/meson.build b/meson.build -index c875331..5c2bb05 100644 ---- a/meson.build -+++ b/meson.build -@@ -64,14 +64,7 @@ if enable_gnome_proxy_support - endif - - # *** Checks for GnuTLS *** --gnutls_dep = dependency('gnutls', version: '>= 3.3.5', required: true) -- --msg = 'location of system Certificate Authority list: ' --res = run_command(join_paths(meson.source_root(), 'find-ca-certificates'), get_option('ca_certificates_path')) --assert(res.returncode() == 0, msg + ' could not find any CA certificate store. Use -Dca_certificates_path=PATH to set') --ca_certificates_path = res.stdout().strip() --message(msg + ca_certificates_path) --config_h.set_quoted('GTLS_SYSTEM_CA_FILE', ca_certificates_path, description: 'The system CA list') -+gnutls_dep = dependency('gnutls', version: '>= 3.4', required: true) - - # *** Checks for p11-kit *** - enable_pkcs11_support = get_option('pkcs11_support') -@@ -134,5 +127,4 @@ meson.add_install_script('meson_post_install.py', gio_module_dir) - output = '\n\n libproxy support: ' + enable_libproxy_support.to_string() + '\n' - output += ' GNOME proxy support: ' + enable_gnome_proxy_support.to_string() + '\n' - output += ' PKCS#11 support: ' + enable_pkcs11_support.to_string() + '\n' --output += ' TLS CA file: ' + ca_certificates_path + '\n' - message(output) -diff --git a/meson_options.txt b/meson_options.txt -index 8cf58ed..1e04d19 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -1,6 +1,5 @@ - option('libproxy_support', type: 'boolean', value: true, description: 'support for libproxy proxy configration') - option('gnome_proxy_support', type: 'boolean', value: true, description: 'support for GNOME desktop proxy configuration') --option('ca_certificates_path', type: 'string', value: '', description: 'path to system Certificate Authority list') - option('pkcs11_support', type: 'boolean', value: true, description: 'support for PKCS#11 using p11-kit') - option('installed_tests', type: 'boolean', value: false, description: 'enable installed tests') - option('static_modules', type: 'boolean', value: false, description: 'build static modules') -diff --git a/tls/gnutls/gtlsbackend-gnutls.c b/tls/gnutls/gtlsbackend-gnutls.c -index 0a6b5d4..97502d3 100644 ---- a/tls/gnutls/gtlsbackend-gnutls.c -+++ b/tls/gnutls/gtlsbackend-gnutls.c -@@ -114,11 +114,7 @@ static GTlsDatabase* - g_tls_backend_gnutls_real_create_database (GTlsBackendGnutls *self, - GError **error) - { -- const gchar *anchor_file = NULL; --#ifdef GTLS_SYSTEM_CA_FILE -- anchor_file = GTLS_SYSTEM_CA_FILE; --#endif -- return g_tls_file_database_new (anchor_file, error); -+ return g_tls_file_database_new (NULL, error); - } - - static void -diff --git a/tls/gnutls/gtlsfiledatabase-gnutls.c b/tls/gnutls/gtlsfiledatabase-gnutls.c -index 5a5c965..3fb7b4a 100644 ---- a/tls/gnutls/gtlsfiledatabase-gnutls.c -+++ b/tls/gnutls/gtlsfiledatabase-gnutls.c -@@ -149,13 +149,24 @@ create_handle_for_certificate (const gchar *filename, - gchar *uri; - - /* -- * Here we create a URI that looks like: -+ * Here we create a URI that looks like - * file:///etc/ssl/certs/ca-certificates.crt#11b2641821252596420e468c275771f5e51022c121a17bd7a89a2f37b6336c8f -+ * or system-trust:#11b2641821252596420e468c275771f5e51022c121a17bd7a89a2f37b6336c8f. -+ * -+ * system-trust is a meaningless URI scheme; we just need some stable way to -+ * uniquely identify these certificates. - */ - -- uri_part = g_filename_to_uri (filename, NULL, NULL); -- if (!uri_part) -- return NULL; -+ if (filename) -+ { -+ uri_part = g_filename_to_uri (filename, NULL, NULL); -+ if (!uri_part) -+ return NULL; -+ } -+ else -+ { -+ uri_part = g_strdup ("system-trust:"); -+ } - - bookmark = g_compute_checksum_for_bytes (G_CHECKSUM_SHA256, der); - uri = g_strconcat (uri_part, "#", bookmark, NULL); -@@ -189,40 +200,29 @@ create_handles_array_unlocked (const gchar *filename, - return handles; - } - --static gboolean --load_anchor_file (const gchar *filename, -- GHashTable *subjects, -- GHashTable *issuers, -- GHashTable *complete, -- GError **error) -+static void -+initialize_tables (gnutls_x509_trust_list_t trust_list, -+ GHashTable *subjects, -+ GHashTable *issuers, -+ GHashTable *complete) - { -- GList *list, *l; -- gnutls_x509_crt_t cert; -+ gnutls_x509_trust_list_iter_t iter = NULL; -+ gnutls_x509_crt_t cert = NULL; - gnutls_datum_t dn; -- GBytes *der; -- GBytes *subject; -- GBytes *issuer; -+ GBytes *der = NULL; -+ GBytes *subject = NULL; -+ GBytes *issuer = NULL; - gint gerr; -- GError *my_error = NULL; -- -- list = g_tls_certificate_list_new_from_file (filename, &my_error); -- if (my_error) -- { -- g_propagate_error (error, my_error); -- return FALSE; -- } - -- for (l = list; l; l = l->next) -+ while ((gerr = gnutls_x509_trust_list_iter_get_ca (trust_list, &iter, &cert)) == 0) - { -- cert = g_tls_certificate_gnutls_get_cert (l->data); - gerr = gnutls_x509_crt_get_raw_dn (cert, &dn); - if (gerr < 0) - { - g_warning ("failed to get subject of anchor certificate: %s", - gnutls_strerror (gerr)); -- continue; -+ goto next; - } -- - subject = g_bytes_new_with_free_func (dn.data, dn.size, gnutls_free, dn.data); - - gerr = gnutls_x509_crt_get_raw_issuer_dn (cert, &dn); -@@ -230,13 +230,18 @@ load_anchor_file (const gchar *filename, - { - g_warning ("failed to get issuer of anchor certificate: %s", - gnutls_strerror (gerr)); -- continue; -+ goto next; - } -- - issuer = g_bytes_new_with_free_func (dn.data, dn.size, gnutls_free, dn.data); - -- der = g_tls_certificate_gnutls_get_bytes (l->data); -- g_return_val_if_fail (der != NULL, FALSE); -+ gerr = gnutls_x509_crt_export2 (cert, GNUTLS_X509_FMT_DER, &dn); -+ if (gerr < 0) -+ { -+ g_warning ("failed to get certificate DER: %s", -+ gnutls_strerror (gerr)); -+ goto next; -+ } -+ der = g_bytes_new_with_free_func (dn.data, dn.size, gnutls_free, dn.data); - - /* Three different ways of looking up same certificate */ - bytes_multi_table_insert (subjects, subject, der); -@@ -245,15 +250,12 @@ load_anchor_file (const gchar *filename, - g_hash_table_insert (complete, g_bytes_ref (der), - g_bytes_ref (der)); - -- g_bytes_unref (der); -- g_bytes_unref (subject); -- g_bytes_unref (issuer); -- -- g_object_unref (l->data); -+next: -+ g_clear_pointer (&der, g_bytes_unref); -+ g_clear_pointer (&subject, g_bytes_unref); -+ g_clear_pointer (&issuer, g_bytes_unref); -+ g_clear_pointer (&cert, gnutls_x509_crt_deinit); - } -- g_list_free (list); -- -- return TRUE; - } - - -@@ -267,11 +269,10 @@ g_tls_file_database_gnutls_finalize (GObject *object) - g_clear_pointer (&self->issuers, g_hash_table_destroy); - g_clear_pointer (&self->complete, g_hash_table_destroy); - g_clear_pointer (&self->handles, g_hash_table_destroy); -- if (self->anchor_filename) -- { -- g_free (self->anchor_filename); -- gnutls_x509_trust_list_deinit (self->trust_list, 1); -- } -+ g_clear_pointer (&self->anchor_filename, g_free); -+ -+ gnutls_x509_trust_list_deinit (self->trust_list, 1); -+ - g_mutex_clear (&self->mutex); - - G_OBJECT_CLASS (g_tls_file_database_gnutls_parent_class)->finalize (object); -@@ -303,6 +304,7 @@ g_tls_file_database_gnutls_set_property (GObject *object, - { - GTlsFileDatabaseGnutls *self = G_TLS_FILE_DATABASE_GNUTLS (object); - const char *anchor_path; -+ int gerr; - - switch (prop_id) - { -@@ -320,11 +322,24 @@ g_tls_file_database_gnutls_set_property (GObject *object, - g_free (self->anchor_filename); - gnutls_x509_trust_list_deinit (self->trust_list, 1); - } -+ - self->anchor_filename = g_strdup (anchor_path); - gnutls_x509_trust_list_init (&self->trust_list, 0); -- gnutls_x509_trust_list_add_trust_file (self->trust_list, -- anchor_path, NULL, -- GNUTLS_X509_FMT_PEM, 0, 0); -+ -+ if (self->anchor_filename) -+ { -+ gnutls_x509_trust_list_add_trust_file (self->trust_list, -+ anchor_path, NULL, -+ GNUTLS_X509_FMT_PEM, 0, 0); -+ } -+ else -+ { -+ gerr = gnutls_x509_trust_list_add_system_trust (self->trust_list, 0, 0); -+ if (gerr == GNUTLS_E_UNIMPLEMENTED_FEATURE) -+ g_warning ("Failed to load system trust store: gnutls_x509_trust_list_add_system_trust is not implemented for this platform"); -+ else if (gerr < 0) -+ g_warning ("Failed to load system trust store: %s", gnutls_strerror (gerr)); -+ } - break; - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -@@ -641,7 +656,7 @@ g_tls_file_database_gnutls_initable_init (GInitable *initable, - { - GTlsFileDatabaseGnutls *self = G_TLS_FILE_DATABASE_GNUTLS (initable); - GHashTable *subjects, *issuers, *complete; -- gboolean result; -+ gboolean result = TRUE; - - if (g_cancellable_set_error_if_cancelled (cancellable, error)) - return FALSE; -@@ -653,11 +668,7 @@ g_tls_file_database_gnutls_initable_init (GInitable *initable, - (GDestroyNotify)g_bytes_unref, - (GDestroyNotify)g_bytes_unref); - -- if (self->anchor_filename) -- result = load_anchor_file (self->anchor_filename, subjects, issuers, -- complete, error); -- else -- result = TRUE; -+ initialize_tables (self->trust_list, subjects, issuers, complete); - - if (g_cancellable_set_error_if_cancelled (cancellable, error)) - result = FALSE; --- -2.17.0 - diff --git a/recipes/glib-networking/0004-meson-Only-run-gio-querymodules-if-it-s-found.patch b/recipes/glib-networking/0004-meson-Only-run-gio-querymodules-if-it-s-found.patch deleted file mode 100644 index 612dbfb7..00000000 --- a/recipes/glib-networking/0004-meson-Only-run-gio-querymodules-if-it-s-found.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 81e64a81ba808bc05aaa6f95eed47366bffa9ea9 Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Wed, 9 May 2018 20:03:00 +0530 -Subject: [PATCH 4/4] meson: Only run gio-querymodules if it's found - -And run the correct one if it's found - -https://bugzilla.gnome.org/show_bug.cgi?id=795982 ---- - meson.build | 6 +++++- - meson_post_install.py | 2 +- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index 5c2bb05..c8a4666 100644 ---- a/meson.build -+++ b/meson.build -@@ -122,7 +122,11 @@ endif - subdir('tls/gnutls') - subdir('tls/tests') - --meson.add_install_script('meson_post_install.py', gio_module_dir) -+# Will automatically pick it up from the cross file if defined -+gio_querymodules = find_program('gio-querymodules', required : false) -+if gio_querymodules.found() -+ meson.add_install_script('meson_post_install.py', gio_querymodules.path(), gio_module_dir) -+endif - - output = '\n\n libproxy support: ' + enable_libproxy_support.to_string() + '\n' - output += ' GNOME proxy support: ' + enable_gnome_proxy_support.to_string() + '\n' -diff --git a/meson_post_install.py b/meson_post_install.py -index 3082d42..8960540 100644 ---- a/meson_post_install.py -+++ b/meson_post_install.py -@@ -6,4 +6,4 @@ import sys - - if not os.environ.get('DESTDIR'): - print('GIO module cache creation...') -- subprocess.call(['gio-querymodules', sys.argv[1]]) -+ subprocess.call([sys.argv[1], sys.argv[2]]) --- -2.17.0 - diff --git a/recipes/glib.recipe b/recipes/glib.recipe index cdd4bdf8..81b79e75 100644 --- a/recipes/glib.recipe +++ b/recipes/glib.recipe @@ -22,13 +22,14 @@ GLIB_CONFIG_UNVERSAL='''\ class Recipe(recipe.Recipe): name = 'glib' - version = '2.56.1' + version = '2.62.5' stype = SourceType.TARBALL url = 'gnome://' - tarball_checksum = '40ef3f44f2c651c7a31aedee44259809b6f03d3d20be44545cd7d177221c0b8d' + tarball_checksum = 'b8d1cdafa46658b63d7512efbe2cd21bd36cd7be83140e44930c47b79f82452e' licenses = [License.LGPLv2Plus] btype = BuildType.MESON - meson_options = {'internal_pcre': 'true', 'libmount': 'false', 'dtrace': 'false'} + meson_options = {'internal_pcre': 'true', 'libmount': 'false', 'dtrace': 'false', + 'iconv': 'auto'} deps = ['libffi', 'zlib'] patches = ["glib/0003-Add-support-for-loading-GIO-modules-from-the-distro-.patch", @@ -36,31 +37,10 @@ class Recipe(recipe.Recipe): "glib/0006-giomodule-do-not-try-to-load-modules-from-gio-module.patch", "glib/0008-Unhide-_g_io_modules_ensure_extension_points_registe.patch", 'glib/0009-Implementation-of-Cocoa-event-loop-integration-in-GM.patch', - 'glib/0013-gmain-Fix-erroneous-if-condition-when-dtrace-is-disa.patch', - # All these patches are upstream and can be removed on version bump - 'glib/glib-2.57-meson-backported-fixes.patch', - 'glib/0001-meson-Add-exception-for-atomic-ops-test-for-Android.patch', - 'glib/0001-gengiotypefuncs.py-Read-and-parse-files-in-binary-mo.patch', - 'glib/0001-Use-a-real-test-for-G_HAVE_GNUC_VISIBILITY.patch', - 'glib/0001-Revert-Revert-Rename-objective-c-files-from-c-to-m.patch', - 'glib/0002-Revert-Revert-Meson-Fix-cocoa-and-carbon-support.patch', - 'glib/0003-Fix-missing-osx-files-when-running-make-dist.patch', - # https://gitlab.gnome.org/GNOME/glib/merge_requests/280 - 'glib/0001-meson-Always-set-G_MODULE_SUFFIX-to-so-on-macOS.patch', - # https://gitlab.gnome.org/GNOME/glib/merge_requests/282 - 'glib/0001-meson-Add-macOS-libtool-versioning-to-maintain-ABI-c.patch', - # https://gitlab.gnome.org/GNOME/glib/merge_requests/273 - 'glib/0001-gtlsbackend-add-support-for-setting-the-default-TLS-.patch', - # https://gitlab.gnome.org/GNOME/glib/merge_requests/686 - 'glib/0001-gio-Also-support-modules-built-with-MSVC.patch', - # https://gitlab.gnome.org/GNOME/glib/merge_requests/187 - 'glib/0001-meson-use-the-new-python-module-instead-of-the-pytho.patch', - # https://gitlab.gnome.org/GNOME/glib/merge_requests/25 - 'glib/0001-msvc-set-the-execution-and-source-encoding-to-utf-8..patch', # https://gitlab.gnome.org/GNOME/glib/merge_requests/1254 'glib/0001-giomodule-gio-modules-are-no-longer-installed-in-bin.patch', - # https://gitlab.gnome.org/GNOME/glib/merge_requests/1265 - 'glib/0001-build-don-t-check-for-protected-visibility.patch', + # https://github.com/mesonbuild/meson/issues/6257 + 'glib/0001-meson-host_system-is-ios-inside-cerbero.patch', ] files_libs = [ @@ -134,19 +114,9 @@ class Recipe(recipe.Recipe): self.meson_options.update({'xattr': 'false'}) self.deps.append('proxy-libintl') - # macOS and iOS provide libiconv as a separate library - if self.config.target_platform in (Platform.DARWIN, Platform.IOS): - self.meson_options.update({'iconv': 'native'}) - # linux and BSD provide iconv as a part of libc - elif self.config.target_platform == Platform.LINUX: - self.meson_options.update({'iconv': 'libc'}) - # On Windows, glib uses an internal copy of libiconv - elif self.config.target_platform == Platform.WINDOWS: - self.meson_options.update({'iconv': 'native'}) - # Other platforms don't provide libiconv, so we build it - else: + # Android only provides libiconv with API level >=28 (Pie and newer) + if self.config.target_platform == Platform.ANDROID: self.deps.append('libiconv') - self.meson_options.update({'iconv': 'gnu'}) if self.config.target_platform == Platform.WINDOWS: # Want secure versions of stdlib functions. Glib already defines @@ -173,7 +143,7 @@ class Recipe(recipe.Recipe): path1 = '/usr/lib/gio/modules' path2 = None use_old_uri_scheme = False - self.meson_options.update({'selinux': 'false'}) + self.meson_options.update({'selinux': 'disabled'}) # Old Debian/Ubuntu if self.config.target_distro_version in [DistroVersion.DEBIAN_SQUEEZE, DistroVersion.UBUNTU_LUCID, diff --git a/recipes/glib/0001-Revert-Revert-Rename-objective-c-files-from-c-to-m.patch b/recipes/glib/0001-Revert-Revert-Rename-objective-c-files-from-c-to-m.patch deleted file mode 100644 index 18ee79a7..00000000 --- a/recipes/glib/0001-Revert-Revert-Rename-objective-c-files-from-c-to-m.patch +++ /dev/null @@ -1,103 +0,0 @@ -From ead46cdc7e70db6bd5c1535a0d2574e4b14803b8 Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Wed, 23 May 2018 09:16:27 -0400 -Subject: [PATCH 1/3] Revert "Revert "Rename objective-c files from .c to .m"" - -This reverts commit 2e9f3a9afe4c5cb1ebdda5e33e6fd3552bf56d38. ---- - gio/Makefile.am | 23 +++++++++++++++---- - ...nbackend.c => gcocoanotificationbackend.m} | 0 - ...gsbackend.c => gnextstepsettingsbackend.m} | 0 - gio/{gosxappinfo.c => gosxappinfo.m} | 0 - gio/{gosxcontenttype.c => gosxcontenttype.m} | 0 - gio/meson.build | 12 ++++------ - 6 files changed, 23 insertions(+), 12 deletions(-) - rename gio/{gcocoanotificationbackend.c => gcocoanotificationbackend.m} (100%) - rename gio/{gnextstepsettingsbackend.c => gnextstepsettingsbackend.m} (100%) - rename gio/{gosxappinfo.c => gosxappinfo.m} (100%) - rename gio/{gosxcontenttype.c => gosxcontenttype.m} (100%) - -diff --git a/gio/Makefile.am b/gio/Makefile.am -index df4f24014..bf2b40fd0 100644 ---- a/gio/Makefile.am -+++ b/gio/Makefile.am -@@ -602,10 +602,25 @@ libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \ - -export-dynamic $(no_undefined) - - if OS_COCOA --# Let's avoid polluting the CFLAGS of libgio with -xobjective-c --# We cannot simply rename the ObjC files to .m because it plays --# tricks with Automake. For further reference, see: --# https://bugzilla.gnome.org/show_bug.cgi?id=672777 -+# We cannot build .m files because it would require adding AC_PROG_OBJC in -+# configure.ac, and it cannot be added conditionally. That means we would always -+# depend on an objective-c compiler even when not needed. To work around that -+# limitation we rename .m files to .c and compile them separately with -+# -xobjective-c into an intermediary library. Note that we cannot rename those -+# files to .c directly in the source tree because Meson needs the .m extension. -+# See https://bugzilla.gnome.org/show_bug.cgi?id=672777. -+OBJC_FILES = \ -+ gnextstepsettingsbackend.m \ -+ gosxcontenttype.m \ -+ gosxappinfo.m \ -+ gcocoanotificationbackend.m \ -+ $(NULL) -+OBJC_C_FILES = $(OBJC_FILES:.m=.c) -+BUILT_SOURCES += $(OBJC_C_FILES) -+CLEANFILES += $(OBJC_C_FILES) -+$(OBJC_C_FILES): %.c: %.m Makefile -+ cp $< $@ -+ - libgio_objc_2_0_la_CFLAGS = $(libgio_2_0_la_CFLAGS) -xobjective-c - libgio_objc_2_0_la_CPPFLAGS = $(libgio_2_0_la_CPPFLAGS) - libgio_objc_2_0_la_LDFLAGS = $(libgio_2_0_la_LDFLAGS) -Wl,-framework,Foundation -Wl,-framework,AppKit -diff --git a/gio/gcocoanotificationbackend.c b/gio/gcocoanotificationbackend.m -similarity index 100% -rename from gio/gcocoanotificationbackend.c -rename to gio/gcocoanotificationbackend.m -diff --git a/gio/gnextstepsettingsbackend.c b/gio/gnextstepsettingsbackend.m -similarity index 100% -rename from gio/gnextstepsettingsbackend.c -rename to gio/gnextstepsettingsbackend.m -diff --git a/gio/gosxappinfo.c b/gio/gosxappinfo.m -similarity index 100% -rename from gio/gosxappinfo.c -rename to gio/gosxappinfo.m -diff --git a/gio/gosxcontenttype.c b/gio/gosxcontenttype.m -similarity index 100% -rename from gio/gosxcontenttype.c -rename to gio/gosxcontenttype.m -diff --git a/gio/meson.build b/gio/meson.build -index 42f67715d..8d542bcfe 100644 ---- a/gio/meson.build -+++ b/gio/meson.build -@@ -292,11 +292,6 @@ if host_system == 'windows' - settings_sources += files('gregistrysettingsbackend.c') - endif - --# FIXME: --#if OS_COCOA --#settings_sources += files('gnextstepsettingsbackend.c') --#endif -- - application_headers = files( - 'gapplication.h', - 'gapplicationcommandline.h', -@@ -412,10 +407,11 @@ if host_system != 'windows' - ) - - if glib_have_cocoa -- contenttype_sources += files('gosxcontenttype.c') -- appinfo_sources += files('gosxappinfo.c') -+ settings_sources += files('gnextstepsettingsbackend.m') -+ contenttype_sources += files('gosxcontenttype.m') -+ appinfo_sources += files('gosxappinfo.m') - if glib_have_os_x_9_or_later -- unix_sources += files('gcocoanotificationbackend.c') -+ unix_sources += files('gcocoanotificationbackend.m') - endif - else - contenttype_sources += files('gcontenttype.c') --- -2.17.1 - diff --git a/recipes/glib/0001-Use-a-real-test-for-G_HAVE_GNUC_VISIBILITY.patch b/recipes/glib/0001-Use-a-real-test-for-G_HAVE_GNUC_VISIBILITY.patch deleted file mode 100644 index 173b7b46..00000000 --- a/recipes/glib/0001-Use-a-real-test-for-G_HAVE_GNUC_VISIBILITY.patch +++ /dev/null @@ -1,95 +0,0 @@ -From a9c65317d30dc1acacdcf4846b4d61e93ccf5e25 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= - =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com> -Date: Fri, 23 Mar 2018 18:26:01 +0000 -Subject: [PATCH] Use a real test for G_HAVE_GNUC_VISIBILITY - -Accurate G_HAVE_GNUC_VISIBILITY is needed to correctly -define G_GNUC_INTERNAL later on. Autotools did that, -meson currently doesn't and opts to just set -G_HAVE_GNUC_VISIBILITY to 1 for all compilers except MSVC. -This leads to MinGW GCC having G_HAVE_GNUC_VISIBILITY=1, -which results in G_GNUC_INTERNAL being defined to -__attribute__((visibility("hidden"))), which is not supported. - -Because cc.compiles() does not support override_options or -anything like that, we just feed it '-Werror' as-is, since -MSVC is known as not supporting visibility attributes anyway. - -https://bugzilla.gnome.org/show_bug.cgi?id=794636 ---- - glib/glibconfig.h.in | 2 +- - meson.build | 41 +++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 42 insertions(+), 1 deletion(-) - -diff --git a/glib/glibconfig.h.in b/glib/glibconfig.h.in -index fb456a972..2bf6c43c1 100644 ---- a/glib/glibconfig.h.in -+++ b/glib/glibconfig.h.in -@@ -133,10 +133,10 @@ typedef unsigned @glib_intptr_type_define@ guintptr; - #endif - - #mesondefine G_HAVE_GROWING_STACK -+#mesondefine G_HAVE_GNUC_VISIBILITY - - #ifndef _MSC_VER - # define G_HAVE_GNUC_VARARGS 1 --# define G_HAVE_GNUC_VISIBILITY 1 - #endif - - #if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590) -diff --git a/meson.build b/meson.build -index 9f08db92b..26689a6e4 100644 ---- a/meson.build -+++ b/meson.build -@@ -112,6 +112,47 @@ if host_system == 'windows' - glib_conf.set('BROKEN_POLL', true) - endif - -+# Check for GNU visibility attributes -+g_have_gnuc_visibility = cc.compiles(''' -+ void -+ __attribute__ ((visibility ("hidden"))) -+ f_hidden (void) -+ { -+ } -+ void -+ __attribute__ ((visibility ("internal"))) -+ f_internal (void) -+ { -+ } -+ void -+ __attribute__ ((visibility ("protected"))) -+ f_protected (void) -+ { -+ } -+ void -+ __attribute__ ((visibility ("default"))) -+ f_default (void) -+ { -+ } -+ int main (void) -+ { -+ f_hidden(); -+ f_internal(); -+ f_protected(); -+ f_default(); -+ return 0; -+ } -+ ''', -+ # Not supported by MSVC, but MSVC also won't support visibility, -+ # so it's OK to pass -Werror explicitly. Replace with -+ # override_options : 'werror=true' once that is supported -+ args: ['-Werror'], -+ name : 'GNU C visibility attributes test') -+ -+if g_have_gnuc_visibility -+ glibconfig_conf.set('G_HAVE_GNUC_VISIBILITY', '1') -+endif -+ - # Detect and set symbol visibility - glib_hidden_visibility_args = [] - if get_option('default_library') != 'static' --- -2.17.0 - diff --git a/recipes/glib/0001-build-don-t-check-for-protected-visibility.patch b/recipes/glib/0001-build-don-t-check-for-protected-visibility.patch deleted file mode 100644 index d062ceb9..00000000 --- a/recipes/glib/0001-build-don-t-check-for-protected-visibility.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 34bf2a16cb1771582803249d4ef288847bdd976c Mon Sep 17 00:00:00 2001 -From: Matthew Waters <matthew@centricular.com> -Date: Tue, 3 Dec 2019 12:51:01 +1100 -Subject: [PATCH] build: don't check for protected visibility - -It's not supported on macOS' clang compiler and will fail the visibility -check and thus make the G_GNUC_INTERNAL attribute do nothing. - -Compiler stderr: - /var/folders/nt/j2v2x4wd5cl33fq27mm31mwc0000gn/T/tmpxxf2zzi_/testfile.c:13:19: error: target does not support 'protected' visibility; using 'default' [-Werror,-Wunsupported-visibility] - __attribute__ ((visibility ("protected"))) - ^ -1 error generated. - -Checking if "GNU C visibility attributes test" compiles: NO ---- - meson.build | 6 ------ - 1 file changed, 6 deletions(-) - -diff --git a/meson.build b/meson.build -index 82d2105..b3bee52 100644 ---- a/meson.build -+++ b/meson.build -@@ -132,11 +132,6 @@ g_have_gnuc_visibility = cc.compiles(''' - { - } - void -- __attribute__ ((visibility ("protected"))) -- f_protected (void) -- { -- } -- void - __attribute__ ((visibility ("default"))) - f_default (void) - { -@@ -145,7 +140,6 @@ g_have_gnuc_visibility = cc.compiles(''' - { - f_hidden(); - f_internal(); -- f_protected(); - f_default(); - return 0; - } --- -2.21.0 (Apple Git-122.2) - diff --git a/recipes/glib/0001-gengiotypefuncs.py-Read-and-parse-files-in-binary-mo.patch b/recipes/glib/0001-gengiotypefuncs.py-Read-and-parse-files-in-binary-mo.patch deleted file mode 100644 index 6a3d7c48..00000000 --- a/recipes/glib/0001-gengiotypefuncs.py-Read-and-parse-files-in-binary-mo.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 458b6288bf260212f89bb75ade746a32cb19970a Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Tue, 22 May 2018 13:52:18 +0530 -Subject: [PATCH] gengiotypefuncs.py: Read and parse files in binary mode - -Fixes this build error on macOS when inside an ssh terminal: - -Traceback (most recent call last): - File "[...]/gio/tests/gengiotypefuncs.py", line 23, in <module> - for line in f: - File "[...]/lib/python3.6/encodings/ascii.py", line 26, in decode - return codecs.ascii_decode(input, self.errors)[0] -UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 2625: ordinal not in range(128) - -https://bugzilla.gnome.org/show_bug.cgi?id=796328 ---- - gio/tests/gengiotypefuncs.py | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/gio/tests/gengiotypefuncs.py b/gio/tests/gengiotypefuncs.py -index 9732d7892..47219f357 100644 ---- a/gio/tests/gengiotypefuncs.py -+++ b/gio/tests/gengiotypefuncs.py -@@ -19,11 +19,11 @@ if debug: print (len(in_files), 'input files') - - for filename in in_files: - if debug: print ('Input file: ', filename) -- with open(filename, "r") as f: -+ with open(filename, 'rb') as f: - for line in f: -- line = line.rstrip('\n').rstrip('\r') -+ line = line.rstrip(b'\n').rstrip(b'\r') - # print line -- match = re.search(r'\bg_[a-zA-Z0-9_]*_get_type\b', line) -+ match = re.search(b'\bg_[a-zA-Z0-9_]*_get_type\b', line) - if match: - func = match.group(0) - if not func in funcs: --- -2.17.0 - diff --git a/recipes/glib/0001-gio-Also-support-modules-built-with-MSVC.patch b/recipes/glib/0001-gio-Also-support-modules-built-with-MSVC.patch deleted file mode 100644 index e27bc05a..00000000 --- a/recipes/glib/0001-gio-Also-support-modules-built-with-MSVC.patch +++ /dev/null @@ -1,28 +0,0 @@ -From fb668198e4d165ea46503de9b9cc84e2bceace58 Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Wed, 20 Feb 2019 20:48:33 +0530 -Subject: [PATCH] gio: Also support modules built with MSVC - -GIO modules built with MSVC do not begin with 'lib', but they can -begin with 'gio'. Without this, you can only load GIO modules built -with MSVC that are `name.dll`, not `gioname.dll`. ---- - gio/giomodule-priv.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gio/giomodule-priv.c b/gio/giomodule-priv.c -index 41afa54..350c780 100644 ---- a/gio/giomodule-priv.c -+++ b/gio/giomodule-priv.c -@@ -51,7 +51,7 @@ _g_io_module_extract_name (const char *filename) - - if (g_str_has_prefix (bname, "libgio")) - prefix_len = 6; -- else if (g_str_has_prefix (bname, "lib")) -+ else if (g_str_has_prefix (bname, "lib") || g_str_has_prefix (bname, "gio")) - prefix_len = 3; - else - prefix_len = 0; /* use whole name (minus suffix) as plugin name */ --- -2.20.1.windows.1 - diff --git a/recipes/glib/0001-gtlsbackend-add-support-for-setting-the-default-TLS-.patch b/recipes/glib/0001-gtlsbackend-add-support-for-setting-the-default-TLS-.patch deleted file mode 100644 index 5c42de7c..00000000 --- a/recipes/glib/0001-gtlsbackend-add-support-for-setting-the-default-TLS-.patch +++ /dev/null @@ -1,314 +0,0 @@ -From 660b999d516caadd605ed09114b5caa4b393d559 Mon Sep 17 00:00:00 2001 -From: Matthew Waters <matthew@centricular.com> -Date: Thu, 16 Aug 2018 23:25:29 +1000 -Subject: [PATCH] gtlsbackend: add support for setting the default TLS database - -There are many cases where a default TLS database is not able to be -defined within the constraints of a system. For example glib-networking -(or glib-openssl) cannot retrieve the default certificate store on iOS -or Android and need to be initialized from a cert file of certificates -bundled with the application. - -Previously GStreamer was relying on a custom patch to glib-networking to -populate the default database from the file pointed to by the -CA_CERTIFICATES environment variable however the mechanism that enabled -this was recently remove from glib-networking. - -Adding a more generic g_tls_backend_set_default_database() API allows -application developers to override the default database using their own -certificates as well as allowing equivalent functionality on Android/iOS -(or others) as on the default database handling Linux. - -Fixes https://gitlab.gnome.org/GNOME/glib-networking/issues/35 ---- - docs/reference/gio/gio-sections.txt | 1 + - gio/gtlsbackend.c | 43 ++++++++- - gio/gtlsbackend.h | 3 + - gio/tests/Makefile.am | 1 + - gio/tests/gtesttlsbackend.c | 140 ++++++++++++++++++++++++++++ - 5 files changed, 187 insertions(+), 1 deletion(-) - -diff --git a/docs/reference/gio/gio-sections.txt b/docs/reference/gio/gio-sections.txt -index 2eb7efc..2d73550 100644 ---- a/docs/reference/gio/gio-sections.txt -+++ b/docs/reference/gio/gio-sections.txt -@@ -3624,6 +3624,7 @@ g_tls_backend_get_default - g_tls_backend_supports_tls - g_tls_backend_supports_dtls - g_tls_backend_get_default_database -+g_tls_backend_set_default_database - g_tls_backend_get_certificate_type - g_tls_backend_get_client_connection_type - g_tls_backend_get_server_connection_type -diff --git a/gio/gtlsbackend.c b/gio/gtlsbackend.c -index 80af6ad..d67e490 100644 ---- a/gio/gtlsbackend.c -+++ b/gio/gtlsbackend.c -@@ -21,6 +21,7 @@ - #include "glib.h" - - #include "gtlsbackend.h" -+#include "gtlsdatabase.h" - #include "gdummytlsbackend.h" - #include "gioenumtypes.h" - #include "giomodule-priv.h" -@@ -84,6 +85,9 @@ - - G_DEFINE_INTERFACE (GTlsBackend, g_tls_backend, G_TYPE_OBJECT) - -+static GTlsDatabase *default_database; -+G_LOCK_DEFINE_STATIC (default_database_lock); -+ - static void - g_tls_backend_default_init (GTlsBackendInterface *iface) - { -@@ -161,13 +165,50 @@ g_tls_backend_supports_dtls (GTlsBackend *backend) - GTlsDatabase * - g_tls_backend_get_default_database (GTlsBackend *backend) - { -+ GTlsDatabase *db; -+ - g_return_val_if_fail (G_IS_TLS_BACKEND (backend), NULL); - - /* This method was added later, so accept the (remote) possibility it can be NULL */ - if (!G_TLS_BACKEND_GET_INTERFACE (backend)->get_default_database) - return NULL; - -- return G_TLS_BACKEND_GET_INTERFACE (backend)->get_default_database (backend); -+ G_LOCK (default_database_lock); -+ -+ if (!default_database) -+ default_database = G_TLS_BACKEND_GET_INTERFACE (backend)->get_default_database (backend); -+ db = default_database ? g_object_ref (default_database) : NULL; -+ G_UNLOCK (default_database_lock); -+ -+ return db; -+} -+ -+/** -+ * g_tls_backend_set_default_database: -+ * @backend: the #GTlsBackend -+ * @database: (nullable): the #GTlsDatabase -+ * -+ * Set the default #GTlsDatabase used to verify TLS connections -+ * -+ * Any subsequent call to g_tls_backend_get_default_database() will return -+ * the database set in this call. Existing databases and connections are not -+ * modified. -+ * -+ * Setting a %NULL default database will reset to using the system default -+ * database as if g_tls_backend_set_default_database() had never been called. -+ * -+ * Since: 2.60 -+ */ -+void -+g_tls_backend_set_default_database (GTlsBackend *backend, -+ GTlsDatabase *database) -+{ -+ g_return_if_fail (G_IS_TLS_BACKEND (backend)); -+ g_return_if_fail (database == NULL || G_IS_TLS_DATABASE (database)); -+ -+ G_LOCK (default_database_lock); -+ g_set_object (&default_database, database); -+ G_UNLOCK (default_database_lock); - } - - /** -diff --git a/gio/gtlsbackend.h b/gio/gtlsbackend.h -index a75036f..54ed17f 100644 ---- a/gio/gtlsbackend.h -+++ b/gio/gtlsbackend.h -@@ -85,6 +85,9 @@ GTlsBackend * g_tls_backend_get_default (void); - - GLIB_AVAILABLE_IN_ALL - GTlsDatabase * g_tls_backend_get_default_database (GTlsBackend *backend); -+GLIB_AVAILABLE_IN_ALL -+void g_tls_backend_set_default_database (GTlsBackend *backend, -+ GTlsDatabase *database); - - GLIB_AVAILABLE_IN_ALL - gboolean g_tls_backend_supports_tls (GTlsBackend *backend); -diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am -index 14cd928..4c6bcc9 100644 ---- a/gio/tests/Makefile.am -+++ b/gio/tests/Makefile.am -@@ -511,6 +511,7 @@ endif # OS_UNIX - endif # HAVE_DBUS_DAEMON - - tls_interaction_SOURCES = tls-interaction.c gtesttlsbackend.c gtesttlsbackend.h -+tls_database_SOURCES = tls-database.c gtesttlsbackend.c gtesttlsbackend.h - - # ----------------------------------------------------------------------------- - -diff --git a/gio/tests/gtesttlsbackend.c b/gio/tests/gtesttlsbackend.c -index 83dad36..18381e8 100644 ---- a/gio/tests/gtesttlsbackend.c -+++ b/gio/tests/gtesttlsbackend.c -@@ -22,6 +22,8 @@ - - static GType _g_test_tls_certificate_get_type (void); - static GType _g_test_tls_connection_get_type (void); -+static GTlsDatabase * _g_test_tls_backend_get_default_database (GTlsBackend * backend); -+static GType _g_test_tls_database_get_type (void); - - struct _GTestTlsBackend { - GObject parent_instance; -@@ -57,6 +59,26 @@ g_test_tls_backend_iface_init (GTlsBackendInterface *iface) - iface->get_certificate_type = _g_test_tls_certificate_get_type; - iface->get_client_connection_type = _g_test_tls_connection_get_type; - iface->get_server_connection_type = _g_test_tls_connection_get_type; -+ iface->get_default_database = _g_test_tls_backend_get_default_database; -+ iface->get_file_database_type = _g_test_tls_database_get_type; -+} -+ -+static GTlsDatabase * -+_g_test_tls_backend_get_default_database (GTlsBackend * backend) -+{ -+ static GTlsDatabase *default_db; -+ GError *error = NULL; -+ -+ if (!default_db) -+ { -+ default_db = g_initable_new (_g_test_tls_database_get_type (), -+ NULL, -+ &error, -+ NULL); -+ g_assert_no_error (error); -+ } -+ -+ return default_db; - } - - /* Test certificate type */ -@@ -164,6 +186,8 @@ g_test_tls_certificate_finalize (GObject *object) - g_free (cert->cert_pem); - g_free (cert->key_pem); - g_clear_object (&cert->issuer); -+ -+ G_OBJECT_CLASS (g_test_tls_certificate_parent_class)->finalize (object); - } - - static void -@@ -327,3 +351,119 @@ g_test_tls_connection_get_private_key_pem (GTlsCertificate *cert) - { - return ((GTestTlsCertificate *)cert)->key_pem; - } -+ -+/* Test database type */ -+ -+typedef struct _GTestTlsDatabase GTestTlsDatabase; -+typedef struct _GTestTlsDatabaseClass GTestTlsDatabaseClass; -+ -+struct _GTestTlsDatabase { -+ GTlsDatabase parent_instance; -+ gchar *anchors; -+}; -+ -+struct _GTestTlsDatabaseClass { -+ GTlsDatabaseClass parent_class; -+}; -+ -+enum -+{ -+ PROP_DATABASE_0, -+ -+ PROP_DATABASE_ANCHORS, -+}; -+ -+static void g_test_tls_database_initable_iface_init (GInitableIface *iface); -+static void g_test_tls_file_database_file_database_interface_init (GInitableIface *iface); -+ -+#define g_test_tls_database_get_type _g_test_tls_database_get_type -+G_DEFINE_TYPE_WITH_CODE (GTestTlsDatabase, g_test_tls_database, G_TYPE_TLS_DATABASE, -+ G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, -+ g_test_tls_database_initable_iface_init); -+ G_IMPLEMENT_INTERFACE (G_TYPE_TLS_FILE_DATABASE, -+ g_test_tls_file_database_file_database_interface_init)) -+ -+static void -+g_test_tls_database_get_property (GObject *object, -+ guint prop_id, -+ GValue *value, -+ GParamSpec *pspec) -+{ -+ GTestTlsDatabase *db = (GTestTlsDatabase *) object; -+ -+ switch (prop_id) -+ { -+ case PROP_DATABASE_ANCHORS: -+ g_value_set_string (value, db->anchors); -+ break; -+ default: -+ g_assert_not_reached (); -+ break; -+ } -+} -+ -+static void -+g_test_tls_database_set_property (GObject *object, -+ guint prop_id, -+ const GValue *value, -+ GParamSpec *pspec) -+{ -+ GTestTlsDatabase *db = (GTestTlsDatabase *) object; -+ -+ switch (prop_id) -+ { -+ case PROP_DATABASE_ANCHORS: -+ g_free (db->anchors); -+ db->anchors = g_value_dup_string (value); -+ break; -+ default: -+ g_assert_not_reached (); -+ break; -+ } -+} -+ -+static void -+g_test_tls_database_finalize (GObject *object) -+{ -+ GTestTlsDatabase *db = (GTestTlsDatabase *) object; -+ -+ g_free (db->anchors); -+ -+ G_OBJECT_CLASS (g_test_tls_database_parent_class)->finalize (object); -+} -+ -+static void -+g_test_tls_database_class_init (GTestTlsDatabaseClass *test_class) -+{ -+ GObjectClass *gobject_class = G_OBJECT_CLASS (test_class); -+ -+ gobject_class->get_property = g_test_tls_database_get_property; -+ gobject_class->set_property = g_test_tls_database_set_property; -+ gobject_class->finalize = g_test_tls_database_finalize; -+ -+ g_object_class_override_property (gobject_class, PROP_DATABASE_ANCHORS, "anchors"); -+} -+ -+static void -+g_test_tls_database_init (GTestTlsDatabase *database) -+{ -+} -+ -+static gboolean -+g_test_tls_database_initable_init (GInitable *initable, -+ GCancellable *cancellable, -+ GError **error) -+{ -+ return TRUE; -+} -+ -+static void -+g_test_tls_file_database_file_database_interface_init (GInitableIface *iface) -+{ -+} -+ -+static void -+g_test_tls_database_initable_iface_init (GInitableIface *iface) -+{ -+ iface->init = g_test_tls_database_initable_init; -+} --- -2.17.1 - diff --git a/recipes/glib/0001-meson-Add-exception-for-atomic-ops-test-for-Android.patch b/recipes/glib/0001-meson-Add-exception-for-atomic-ops-test-for-Android.patch deleted file mode 100644 index a06af7c4..00000000 --- a/recipes/glib/0001-meson-Add-exception-for-atomic-ops-test-for-Android.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 9c704bc1381610ddcb6c01ff136bee861fe83526 Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Tue, 22 May 2018 11:45:37 +0530 -Subject: [PATCH] meson: Add exception for atomic ops test for Android - -Some compilers, particularly Android on armv5 and old versions of Clang -provide atomic ops, but don't define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 -so we need to define it ourselves. - -This matches what configure does, with the exception that now it's only -done for Android since clang defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 -now. - -https://bugzilla.gnome.org/show_bug.cgi?id=796325 ---- - meson.build | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index 11ae73919..b8b1e353c 100644 ---- a/meson.build -+++ b/meson.build -@@ -1375,14 +1375,26 @@ atomictest = '''int main() { - return 0; - } - ''' -+atomicdefine = ''' -+#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 -+#error "compiler has atomic ops, but doesn't define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4" -+#endif -+''' - if cc.get_id() == 'msvc' or cc.links(atomictest, name : 'atomic ops') -- glibconfig_conf.set('G_ATOMIC_LOCK_FREE', true) -+ have_atomic_lock_free = true -+ if host_system == 'android' and not cc.compiles(atomicdefine, name : 'atomic ops define') -+ # When building for armv5 on Android, gcc 4.9 provides -+ # __sync_bool_compare_and_swap but doesn't define -+ # __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 -+ glib_conf.set('__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4', true) -+ endif - else -+ have_atomic_lock_free = false - if host_machine.cpu_family() == 'x86' and cc.links(atomictest, args : '-march=i486') - error('GLib must be built with -march=i486 or later.') - endif -- glibconfig_conf.set('G_ATOMIC_LOCK_FREE', false) - endif -+glibconfig_conf.set('G_ATOMIC_LOCK_FREE', have_atomic_lock_free) - - # === Threads === - --- -2.17.0 - diff --git a/recipes/glib/0001-meson-Add-macOS-libtool-versioning-to-maintain-ABI-c.patch b/recipes/glib/0001-meson-Add-macOS-libtool-versioning-to-maintain-ABI-c.patch deleted file mode 100644 index 04a0131c..00000000 --- a/recipes/glib/0001-meson-Add-macOS-libtool-versioning-to-maintain-ABI-c.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 8e675287782534e7e6e2549a5e96f03caf5304b2 Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Tue, 28 Aug 2018 20:27:40 +0530 -Subject: [PATCH] meson: Add macOS libtool versioning to maintain ABI - compatibility - ---- - gio/meson.build | 1 + - glib/meson.build | 1 + - gmodule/meson.build | 1 + - gobject/meson.build | 1 + - gthread/meson.build | 1 + - meson.build | 4 +++- - 6 files changed, 8 insertions(+), 1 deletion(-) - -diff --git a/gio/meson.build b/gio/meson.build -index 12a3eca..d0837c7 100644 ---- a/gio/meson.build -+++ b/gio/meson.build -@@ -788,6 +788,7 @@ libgio = library('gio-2.0', - gio_dtrace_hdr, gio_dtrace_obj, - version : library_version, - soversion : soversion, -+ darwin_versions : darwin_versions, - install : true, - include_directories : [configinc, gioinc], - link_with : internal_deps, -diff --git a/glib/meson.build b/glib/meson.build -index 9f3e087..96dc782 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -240,6 +240,7 @@ libglib = library('glib-2.0', - sources : [deprecated_sources, glib_sources], - version : library_version, - soversion : soversion, -+ darwin_versions : darwin_versions, - install : true, - # intl.lib is not compatible with SAFESEH - link_args : noseh_link_args, -diff --git a/gmodule/meson.build b/gmodule/meson.build -index 3b57fb4..9137f00 100644 ---- a/gmodule/meson.build -+++ b/gmodule/meson.build -@@ -99,6 +99,7 @@ libgmodule = library('gmodule-2.0', - sources : gmodule_sources, - version : library_version, - soversion : soversion, -+ darwin_versions : darwin_versions, - install : true, - include_directories : [configinc, gmoduleinc], - dependencies : [libdl_dep, libglib_dep], -diff --git a/gobject/meson.build b/gobject/meson.build -index 1bf0e00..abd7331 100644 ---- a/gobject/meson.build -+++ b/gobject/meson.build -@@ -66,6 +66,7 @@ libgobject = library('gobject-2.0', - sources : gobject_sources, - version : library_version, - soversion : soversion, -+ darwin_versions : darwin_versions, - install : true, - include_directories : [configinc], - dependencies : [libffi_dep, libglib_dep], -diff --git a/gthread/meson.build b/gthread/meson.build -index 3787dba..4f296fc 100644 ---- a/gthread/meson.build -+++ b/gthread/meson.build -@@ -16,6 +16,7 @@ libgthread = library('gthread-2.0', - sources : gthread_sources, - version : library_version, - soversion : soversion, -+ darwin_versions : darwin_versions, - install : true, - dependencies : [libglib_dep], - c_args : ['-DG_LOG_DOMAIN="GThread"' ] + glib_hidden_visibility_args) -diff --git a/meson.build b/meson.build -index fbccab7..427e776 100644 ---- a/meson.build -+++ b/meson.build -@@ -43,7 +43,9 @@ binary_age = 100 * minor_version + micro_version - soversion = 0 - # Maintain compatibility with previous libtool versioning - # current = minor * 100 + micro --library_version = '@0@.@1@.@2@'.format(soversion, binary_age - interface_age, interface_age) -+current = binary_age - interface_age -+library_version = '@0@.@1@.@2@'.format(soversion, current, interface_age) -+darwin_versions = [current + 1, '@0@.@1@'.format(current + 1, interface_age)] - - configinc = include_directories('.') - glibinc = include_directories('glib') --- -2.15.2 (Apple Git-101.1) - diff --git a/recipes/glib/0001-meson-Always-set-G_MODULE_SUFFIX-to-so-on-macOS.patch b/recipes/glib/0001-meson-Always-set-G_MODULE_SUFFIX-to-so-on-macOS.patch deleted file mode 100644 index 58a4677b..00000000 --- a/recipes/glib/0001-meson-Always-set-G_MODULE_SUFFIX-to-so-on-macOS.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 2ab85db846c79b8f3ab710e7af44490c9734f057 Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Mon, 11 Jun 2018 07:02:08 +0530 -Subject: [PATCH] meson: Always set G_MODULE_SUFFIX to so on macOS - -This is what Autotools does, and it's what the entire world expects. - -https://gitlab.gnome.org/GNOME/glib/issues/1413 ---- - meson.build | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/meson.build b/meson.build -index 91b8721a1..07ff90174 100644 ---- a/meson.build -+++ b/meson.build -@@ -1227,11 +1227,9 @@ glibconfig_conf.set('glongbits', long_size * 8) - glibconfig_conf.set('gsizebits', sizet_size * 8) - glibconfig_conf.set('gssizebits', ssizet_size * 8) - --# FIXME: maybe meson should tell us the libsuffix? -+# XXX: https://gitlab.gnome.org/GNOME/glib/issues/1413 - if host_system == 'windows' - g_module_suffix = 'dll' --elif host_system == 'darwin' -- g_module_suffix = 'dylib' - else - g_module_suffix = 'so' - endif --- -2.17.0 - diff --git a/recipes/glib/0001-meson-host_system-is-ios-inside-cerbero.patch b/recipes/glib/0001-meson-host_system-is-ios-inside-cerbero.patch new file mode 100644 index 00000000..8943cc2e --- /dev/null +++ b/recipes/glib/0001-meson-host_system-is-ios-inside-cerbero.patch @@ -0,0 +1,31 @@ +From ec12c163aab22fa08d6797d182b7e296cead0c10 Mon Sep 17 00:00:00 2001 +From: Nirbheek Chauhan <nirbheek@centricular.com> +Date: Fri, 21 Feb 2020 19:12:32 +0530 +Subject: [PATCH] meson: host_system is ios inside cerbero + +This is actually the only way right now to differentiate between iOS +and macOS inside Meson, but sadly it's not entirely standardized +upstream: https://mesonbuild.com/Reference-tables.html#operating-system-names + +We can upstream this to glib when things get standardized in Meson: +https://github.com/mesonbuild/meson/issues/6257 +--- + meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/meson.build b/meson.build +index 484f4c750..00b3bda32 100644 +--- a/meson.build ++++ b/meson.build +@@ -2026,7 +2026,7 @@ if host_system == 'windows' + export_dynamic_ldflags = [] + elif host_system == 'cygwin' + export_dynamic_ldflags = ['-Wl,--export-all-symbols'] +-elif host_system == 'darwin' ++elif host_system in ['darwin', 'ios'] + export_dynamic_ldflags = [] + elif host_system == 'sunos' + export_dynamic_ldflags = [] +-- +2.24.1 + diff --git a/recipes/glib/0001-meson-use-the-new-python-module-instead-of-the-pytho.patch b/recipes/glib/0001-meson-use-the-new-python-module-instead-of-the-pytho.patch deleted file mode 100644 index 1751c109..00000000 --- a/recipes/glib/0001-meson-use-the-new-python-module-instead-of-the-pytho.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 631c3534b784b44578860c1971c4ebd297c40f33 Mon Sep 17 00:00:00 2001 -From: Christoph Reiter <reiter.christoph@gmail.com> -Date: Wed, 18 Jul 2018 17:03:22 +0200 -Subject: [PATCH] meson: use the new 'python' module instead of the 'python3' - one. Closes #1455 - -The new python module, added with 0.46, works with Python 2 and 3 and -allows to pass a path for the interpreter to use, if the need arises. - -Previously the meson build set PYTHON, used in the shebang line of -the scripts installed by glib, to the full path of the interpreter. -The new meson module doesn't expose that atm, but we should set it to -a executable name anyway, and not a full path. ---- - gio/gdbus-2.0/codegen/meson.build | 2 +- - gobject/meson.build | 2 +- - gobject/tests/meson.build | 7 ++----- - meson.build | 4 +++- - 4 files changed, 7 insertions(+), 8 deletions(-) - -diff --git a/gio/gdbus-2.0/codegen/meson.build b/gio/gdbus-2.0/codegen/meson.build -index af1bc9fb2..f5e82a2ff 100644 ---- a/gio/gdbus-2.0/codegen/meson.build -+++ b/gio/gdbus-2.0/codegen/meson.build -@@ -10,7 +10,7 @@ gdbus_codegen_files = [ - - gdbus_codegen_conf = configuration_data() - gdbus_codegen_conf.set('VERSION', glib_version) --gdbus_codegen_conf.set('PYTHON', python.path()) -+gdbus_codegen_conf.set('PYTHON', python_name) - gdbus_codegen_conf.set('DATADIR', glib_datadir) - - # Install gdbus-codegen executable -diff --git a/gobject/meson.build b/gobject/meson.build -index d34a897a7..ffa8b75d0 100644 ---- a/gobject/meson.build -+++ b/gobject/meson.build -@@ -92,7 +92,7 @@ python_tools = [ - - python_tools_conf = configuration_data() - python_tools_conf.set('VERSION', glib_version) --python_tools_conf.set('PYTHON', python.path()) -+python_tools_conf.set('PYTHON', python_name) - - foreach tool: python_tools - tool_bin = configure_file( -diff --git a/meson.build b/meson.build -index 15f895e7f..5f7c7707c 100644 ---- a/meson.build -+++ b/meson.build -@@ -1800,7 +1800,9 @@ elif meson.get_cross_property('have_strlcpy', false) - endif - endif - --python = import('python3').find_python() -+python = import('python').find_installation('python3') -+# used for '#!/usr/bin/env <name>' -+python_name = 'python3' - - # Determine which user environment-dependent files that we want to install - have_bash = find_program('bash', required : false).found() # For completion scripts --- -2.20.1.windows.1 - diff --git a/recipes/glib/0001-msvc-set-the-execution-and-source-encoding-to-utf-8..patch b/recipes/glib/0001-msvc-set-the-execution-and-source-encoding-to-utf-8..patch deleted file mode 100644 index a86bd5ae..00000000 --- a/recipes/glib/0001-msvc-set-the-execution-and-source-encoding-to-utf-8..patch +++ /dev/null @@ -1,31 +0,0 @@ -From 947b585ca637409bfc5400f8307535d23b7d1f6d Mon Sep 17 00:00:00 2001 -From: Christoph Reiter <reiter.christoph@gmail.com> -Date: Sun, 27 May 2018 20:11:21 +0200 -Subject: [PATCH] msvc: set the execution and source encoding to utf-8. Fixes - #1294 - -gcc defaults to utf-8 for both (see -fexec-charset and -finput-charset in the -gcc man page) so we should use it with msvc as well. - -msvc by default uses the locale encoding unless there is a BOM, see -https://msdn.microsoft.com/en-us/library/mt708821.aspx ---- - meson.build | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/meson.build b/meson.build -index 62989bedd..d173d57bf 100644 ---- a/meson.build -+++ b/meson.build -@@ -23,6 +23,8 @@ if cc.get_id() == 'msvc' - # Disable SAFESEH with MSVC for plugins and libs that use external deps that - # are built with MinGW - noseh_link_args = ['/SAFESEH:NO'] -+ # Set the input and exec encoding to utf-8, like is the default with GCC -+ add_project_arguments(cc.get_supported_arguments(['/utf-8']), language: 'c') - else - noseh_link_args = [] - # -mms-bitfields vs -fnative-struct ? --- -2.17.1 - diff --git a/recipes/glib/0002-Revert-Revert-Meson-Fix-cocoa-and-carbon-support.patch b/recipes/glib/0002-Revert-Revert-Meson-Fix-cocoa-and-carbon-support.patch deleted file mode 100644 index 8a75e877..00000000 --- a/recipes/glib/0002-Revert-Revert-Meson-Fix-cocoa-and-carbon-support.patch +++ /dev/null @@ -1,126 +0,0 @@ -From 197ed18cf246a04178b90285b5c590d72eefa40b Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Wed, 23 May 2018 09:16:35 -0400 -Subject: [PATCH 1/3] Revert "Revert "Meson: Fix cocoa and carbon support"" - -This reverts commit e25a2f95b3d1f39c5abc208d797f6c065d67713e. ---- - gio/meson.build | 8 +++++--- - meson.build | 60 ++++++++++++++++++++++++++++++++++----------------------- - 2 files changed, 41 insertions(+), 27 deletions(-) - -diff --git a/gio/meson.build b/gio/meson.build -index ae70540..12a3eca 100644 ---- a/gio/meson.build -+++ b/gio/meson.build -@@ -419,10 +419,11 @@ if host_system != 'windows' - contenttype_sources += files('gcontenttype.c') - appinfo_sources += files('gdesktopappinfo.c') - gio_unix_include_headers += files('gdesktopappinfo.h') -- subdir('xdgmime') -- internal_deps += [xdgmime_lib] - endif - -+ subdir('xdgmime') -+ internal_deps += [xdgmime_lib] -+ - install_headers(gio_unix_include_headers, subdir : 'gio-unix-2.0/gio') - - if glib_conf.has('HAVE_NETLINK') -@@ -796,6 +797,7 @@ libgio = library('gio-2.0', - libgobject_dep, libgmodule_dep, selinux_dep, xattr_dep, - platform_deps, network_libs], - c_args : gio_c_args, -+ objc_args : gio_c_args, - # intl.lib is not compatible with SAFESEH - link_args : noseh_link_args, - ) -@@ -941,7 +943,7 @@ executable('gdbus', 'gdbus-tool.c', - link_args : noseh_link_args, - dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) - --if host_system != 'windows' -+if host_system != 'windows' and not glib_have_cocoa - executable('gapplication', 'gapplication-tool.c', - install : true, - c_args : gio_c_args, -diff --git a/meson.build b/meson.build -index b2aeb54..fbccab7 100644 ---- a/meson.build -+++ b/meson.build -@@ -535,36 +535,48 @@ if host_system == 'linux' - endif - - osx_ldflags = [] -+glib_have_os_x_9_or_later = false -+glib_have_carbon = false -+glib_have_cocoa = false - --# Mac OS X Carbon support --glib_have_carbon = cc.compiles('''#include <Carbon/Carbon.h> -- #include <CoreServices/CoreServices.h>''', -- name : 'Mac OS X Carbon support') -+if host_system == 'darwin' -+ add_languages('objc') -+ objcc = meson.get_compiler('objc') - --glib_have_os_x_9_or_later = false -+ osx_ldflags += ['-Wl,-framework,CoreFoundation'] - --if glib_have_carbon -- glib_conf.set('HAVE_CARBON', true) -- osx_ldflags += '-Wl,-framework,Carbon' -- glib_have_os_x_9_or_later = cc.compiles('''#include <AvailabilityMacros.h> -- #if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 -- #error Compiling for minimum OS X version before 10.9 -- #endif''', name : 'OS X 9 or later') --endif -+ # Mac OS X Carbon support -+ glib_have_carbon = objcc.compiles('''#include <Carbon/Carbon.h> -+ #include <CoreServices/CoreServices.h>''', -+ name : 'Mac OS X Carbon support') - --# Mac OS X Cocoa support --glib_have_cocoa = cc.compiles('''#include <Cocoa/Cocoa.h> -- #ifdef GNUSTEP_BASE_VERSION -- #error "Detected GNUstep, not Cocoa" -- #endif''', -- name : 'Mac OS X Cocoa support') - --if glib_have_cocoa -- glib_conf.set('HAVE_COCOA', true) -- osx_ldflags += '-Wl,-framework,Foundation -Wl,-framework,AppKit' --endif -+ if glib_have_carbon -+ glib_conf.set('HAVE_CARBON', true) -+ osx_ldflags += '-Wl,-framework,Carbon' -+ glib_have_os_x_9_or_later = objcc.compiles('''#include <AvailabilityMacros.h> -+ #if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 -+ #error Compiling for minimum OS X version before 10.9 -+ #endif''', name : 'OS X 9 or later') -+ endif -+ -+ # Mac OS X Cocoa support -+ glib_have_cocoa = objcc.compiles('''#include <Cocoa/Cocoa.h> -+ #ifdef GNUSTEP_BASE_VERSION -+ #error "Detected GNUstep, not Cocoa" -+ #endif''', -+ name : 'Mac OS X Cocoa support') - --add_project_link_arguments(osx_ldflags, language : 'c') -+ if glib_have_cocoa -+ glib_conf.set('HAVE_COCOA', true) -+ osx_ldflags += ['-Wl,-framework,Foundation', '-Wl,-framework,AppKit'] -+ endif -+ -+ # FIXME: libgio mix C and objC source files and there is no way to reliably -+ # know which language flags it's going to use to link. Add to both languages -+ # for now. See https://github.com/mesonbuild/meson/issues/3585. -+ add_project_link_arguments(osx_ldflags, language : ['objc', 'c']) -+endif - - # Check for futex(2) - if cc.links('''#include <linux/futex.h> --- -2.14.3 (Apple Git-98) - diff --git a/recipes/glib/0003-Fix-missing-osx-files-when-running-make-dist.patch b/recipes/glib/0003-Fix-missing-osx-files-when-running-make-dist.patch deleted file mode 100644 index 4aefa343..00000000 --- a/recipes/glib/0003-Fix-missing-osx-files-when-running-make-dist.patch +++ /dev/null @@ -1,44 +0,0 @@ -From c627fb492624bdbbb9206d88e7852bddeacfcb00 Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Wed, 23 May 2018 10:07:22 -0400 -Subject: [PATCH 3/3] Fix missing osx files when running "make dist" - -Fixes #528, #1381. ---- - gio/Makefile.am | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/gio/Makefile.am b/gio/Makefile.am -index bf2b40fd0..8eaf22e0a 100644 ---- a/gio/Makefile.am -+++ b/gio/Makefile.am -@@ -601,13 +601,13 @@ libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \ - -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ - -export-dynamic $(no_undefined) - --if OS_COCOA - # We cannot build .m files because it would require adding AC_PROG_OBJC in - # configure.ac, and it cannot be added conditionally. That means we would always - # depend on an objective-c compiler even when not needed. To work around that - # limitation we rename .m files to .c and compile them separately with - # -xobjective-c into an intermediary library. Note that we cannot rename those - # files to .c directly in the source tree because Meson needs the .m extension. -+# This must be done outside of "if OS_COCOA" block otherwise distcheck fails. - # See https://bugzilla.gnome.org/show_bug.cgi?id=672777. - OBJC_FILES = \ - gnextstepsettingsbackend.m \ -@@ -618,9 +618,11 @@ OBJC_FILES = \ - OBJC_C_FILES = $(OBJC_FILES:.m=.c) - BUILT_SOURCES += $(OBJC_C_FILES) - CLEANFILES += $(OBJC_C_FILES) -+EXTRA_DIST += $(OBJC_FILES) - $(OBJC_C_FILES): %.c: %.m Makefile - cp $< $@ - -+if OS_COCOA - libgio_objc_2_0_la_CFLAGS = $(libgio_2_0_la_CFLAGS) -xobjective-c - libgio_objc_2_0_la_CPPFLAGS = $(libgio_2_0_la_CPPFLAGS) - libgio_objc_2_0_la_LDFLAGS = $(libgio_2_0_la_LDFLAGS) -Wl,-framework,Foundation -Wl,-framework,AppKit --- -2.17.1 - diff --git a/recipes/glib/0009-Implementation-of-Cocoa-event-loop-integration-in-GM.patch b/recipes/glib/0009-Implementation-of-Cocoa-event-loop-integration-in-GM.patch index e93f4243..a968448c 100644 --- a/recipes/glib/0009-Implementation-of-Cocoa-event-loop-integration-in-GM.patch +++ b/recipes/glib/0009-Implementation-of-Cocoa-event-loop-integration-in-GM.patch @@ -10,30 +10,6 @@ Subject: [PATCH 09/13] Implementation of Cocoa event loop integration in glib/gmain.c | 985 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 991 insertions(+), 2 deletions(-) -diff --git a/glib/Makefile.am b/glib/Makefile.am -index d755853..611eb5b 100644 ---- a/glib/Makefile.am -+++ b/glib/Makefile.am -@@ -44,6 +44,10 @@ AM_CPPFLAGS = \ - -DGLIB_COMPILATION \ - -DPCRE_STATIC - -+if OS_COCOA -+AM_CPPFLAGS += -xobjective-c -+endif -+ - AM_CFLAGS = $(GLIB_WARN_CFLAGS) - - MIRRORING_TAB_SOURCE = \ -@@ -353,7 +357,7 @@ pcre_inc = - endif - - libglib_2_0_la_CFLAGS = $(AM_CFLAGS) $(GLIB_HIDDEN_VISIBILITY_CFLAGS) $(LIBSYSTEMD_CFLAGS) --libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD) $(LIBSYSTEMD_LIBS) -+libglib_2_0_la_LIBADD = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ @ICONV_LIBS@ @G_LIBS_EXTRA@ $(pcre_lib) $(G_THREAD_LIBS_EXTRA) $(G_THREAD_LIBS_FOR_GTHREAD) $(LIBSYSTEMD_LIBS) $(COCOA_LIBS) - libglib_2_0_la_DEPENDENCIES = libcharset/libcharset.la $(printf_la) @GIO@ @GSPAWN@ @PLATFORMDEP@ $(glib_win32_res) $(glib_def) - - libglib_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS) \ diff --git a/glib/gmain.c b/glib/gmain.c index 27c0234..2a88474 100644 --- a/glib/gmain.c @@ -1102,16 +1078,6 @@ index ea9bf41..9f3e087 100644 if host_system == 'windows' glib_win_rc = configure_file( input: 'glib.rc.in', -@@ -238,7 +246,8 @@ libglib = library('glib-2.0', - include_directories : configinc, - link_with : [charset_lib, gnulib_lib], - dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps, -- c_args : ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre_static_args + glib_hidden_visibility_args -+ c_args : ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre_static_args + glib_hidden_visibility_args, -+ objc_args : ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre_static_args + glib_hidden_visibility_args - ) - - libglib_dep = declare_dependency( -- 2.14.3 (Apple Git-98) diff --git a/recipes/glib/0013-gmain-Fix-erroneous-if-condition-when-dtrace-is-disa.patch b/recipes/glib/0013-gmain-Fix-erroneous-if-condition-when-dtrace-is-disa.patch deleted file mode 100644 index c8c47b39..00000000 --- a/recipes/glib/0013-gmain-Fix-erroneous-if-condition-when-dtrace-is-disa.patch +++ /dev/null @@ -1,34 +0,0 @@ -From e3b6ca6367b66f825de2beee7beb727c6592a85a Mon Sep 17 00:00:00 2001 -From: Jan Schmidt <jan@centricular.com> -Date: Mon, 24 Apr 2017 22:24:26 +1000 -Subject: [PATCH 13/13] gmain: Fix erroneous if condition when dtrace is - disabled - -Add a block around an if statement whose contents disappear -when DTrace support is compiled out, making it erroneously -associate to the next line. ---- - glib/gmain.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/glib/gmain.c b/glib/gmain.c -index 2a88474..cfb9e6b 100644 ---- a/glib/gmain.c -+++ b/glib/gmain.c -@@ -1700,11 +1700,12 @@ g_source_set_callback_indirect (GSource *source, - if (context) - LOCK_CONTEXT (context); - -- if (callback_funcs != &g_source_callback_funcs) -+ if (callback_funcs != &g_source_callback_funcs) { - TRACE (GLIB_SOURCE_SET_CALLBACK_INDIRECT (source, callback_data, - callback_funcs->ref, - callback_funcs->unref, - callback_funcs->get)); -+ } - - old_cb_data = source->callback_data; - old_cb_funcs = source->callback_funcs; --- -2.7.4 - diff --git a/recipes/glib/glib-2.57-meson-backported-fixes.patch b/recipes/glib/glib-2.57-meson-backported-fixes.patch deleted file mode 100644 index 929b45cf..00000000 --- a/recipes/glib/glib-2.57-meson-backported-fixes.patch +++ /dev/null @@ -1,1883 +0,0 @@ -From 07d2a2de8a67131d31dfe1093abc8920334c7f8b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= - =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com> -Date: Wed, 11 Apr 2018 11:11:24 +0000 -Subject: [PATCH 01/24] W32 gstdio: Don't try to get reparse tag - unconditionally - -We do not need to use FindFirstFileW() to get a reparse tag if the -file that is being examined is not a reparse point. - -This is a quick and relatively painless fix for the fact that -FindFirstFileW() fails on root directories. Since root directories -are unlikely to be reparse points (is it even possible?), not using -this function on non-reparse-points just sidesteps the issue. - -https://bugzilla.gnome.org/show_bug.cgi?id=795153 ---- - glib/gstdio.c | 23 ++++++++++++++--------- - 1 file changed, 14 insertions(+), 9 deletions(-) - -diff --git a/glib/gstdio.c b/glib/gstdio.c -index 858d56999..faaa1bafd 100644 ---- a/glib/gstdio.c -+++ b/glib/gstdio.c -@@ -209,18 +209,23 @@ _g_win32_stat_utf16_no_trailing_slashes (const gunichar2 *filename, - */ - if (fd < 0) - { -- HANDLE tmp = FindFirstFileW (filename, -- &finddata); -+ memset (&finddata, 0, sizeof (finddata)); - -- if (tmp == INVALID_HANDLE_VALUE) -+ if (handle_info.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) - { -- error_code = GetLastError (); -- errno = w32_error_to_errno (error_code); -- CloseHandle (file_handle); -- return -1; -- } -+ HANDLE tmp = FindFirstFileW (filename, -+ &finddata); - -- FindClose (tmp); -+ if (tmp == INVALID_HANDLE_VALUE) -+ { -+ error_code = GetLastError (); -+ errno = w32_error_to_errno (error_code); -+ CloseHandle (file_handle); -+ return -1; -+ } -+ -+ FindClose (tmp); -+ } - - if (is_symlink && !for_symlink) - { --- -2.17.0 - - -From 0a6ccdccb5078024ddc5aca72e4d5113ee851792 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine <fontaine.fabrice@gmail.com> -Date: Tue, 10 Apr 2018 18:55:11 +0200 -Subject: [PATCH 02/24] gio: fix compilation without F_{S,G}ETPIPE_SZ - -Commit a5778ef7c51044147fe470ea1707dd297f44f880 broke compilation on -architectures without F_SETPIPE_SZ and F_GETPIPE_SZ such as or1k. -If those variables are undefined, put back previous behavior, buffer -size set to 1024 * 64 - -Fixes: - - http://autobuild.buildroot.net/results/398490e07343a931b25ca6ab5c90a75d7a073e9f - -(Modified by Philip Withnall <withnall@endlessm.com> to add an -explanatory comment.) - -Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> - -https://bugzilla.gnome.org/show_bug.cgi?id=795133 ---- - gio/gfile.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/gio/gfile.c b/gio/gfile.c -index 334ad8ec3..a67aad383 100644 ---- a/gio/gfile.c -+++ b/gio/gfile.c -@@ -3012,6 +3012,7 @@ splice_stream_with_progress (GInputStream *in, - if (!g_unix_open_pipe (buffer, FD_CLOEXEC, error)) - return FALSE; - -+#if defined(F_SETPIPE_SZ) && defined(F_GETPIPE_SZ) - /* Try a 1MiB buffer for improved throughput. If that fails, use the default - * pipe size. See: https://bugzilla.gnome.org/791457 */ - buffer_size = fcntl (buffer[1], F_SETPIPE_SZ, 1024 * 1024); -@@ -3029,6 +3030,13 @@ splice_stream_with_progress (GInputStream *in, - goto out; - } - } -+#else -+ /* If #F_GETPIPE_SZ isn’t available, assume we’re on Linux < 2.6.35, -+ * but ≥ 2.6.11, meaning the pipe capacity is 64KiB. Ignore the possibility of -+ * running on Linux < 2.6.11 (where the capacity was the system page size, -+ * typically 4KiB) because it’s ancient. See pipe(7). */ -+ buffer_size = 1024 * 64; -+#endif - - g_assert (buffer_size > 0); - --- -2.17.0 - - -From e2939d5fa86f51d638051a76ab07e7d6d87cba68 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine <fontaine.fabrice@gmail.com> -Date: Tue, 10 Apr 2018 19:18:57 +0200 -Subject: [PATCH 03/24] gobject: fix compilation with gcc <= 4.7 - -On gcc 4.7, we got the following error: - -i686-nptl-linux-gnu-gcc --version -> i686-nptl-linux-gnu-gcc (crosstool-NG 1.20.0) 4.7.4 -> $ echo '#include <glib-object.h>' | i686-nptl-linux-gnu-gcc -x c -I -staging/usr/include/glib-2.0 -I staging/usr/lib/glib-2.0/include -Wall --Werror -c - -o /tmp/foo.o -> In file included from -staging/usr/include/glib-2.0/gobject/gbinding.h:29:0, -> from staging/usr/include/glib-2.0/glib-object.h:23, -> from <stdin>:1: -> staging/usr/include/glib-2.0/gobject/gobject.h: In function -'g_set_object': -> staging/usr/include/glib-2.0/gobject/gobject.h:725:5: error: value -computed is not used [-Werror=unused-value] -> cc1: all warnings being treated as errors - -This error has been added by commit 3fae39a5d742afe73741f5fd7aa24e3ae8182f06 -So enable the new g_set_object definition only if gcc >= 4.8 - -Fixes: - - http://autobuild.buildroot.net/results/b29a2f868438a2210873ea72f491db63175848be - -Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> - -https://bugzilla.gnome.org/show_bug.cgi?id=795138 ---- - gobject/gobject.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gobject/gobject.h b/gobject/gobject.h -index 9830663ce..838046fe0 100644 ---- a/gobject/gobject.h -+++ b/gobject/gobject.h -@@ -507,7 +507,7 @@ GLIB_AVAILABLE_IN_ALL - void g_object_remove_weak_pointer (GObject *object, - gpointer *weak_pointer_location); - --#if defined(__GNUC__) && !defined(__cplusplus) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56 -+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) && !defined(__cplusplus) && GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_56 - /* Make reference APIs type safe with macros */ - #define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj)) - #define g_object_ref_sink(Obj) ((__typeof__(Obj)) (g_object_ref_sink) (Obj)) --- -2.17.0 - - -From 1c6c488d519bccec1f723330e90a98c0ae095b84 Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Mon, 23 Apr 2018 11:47:17 -0400 -Subject: [PATCH 04/24] struct ip_mreq_source definition is broken on Android - NDK <= r16 - -This fix the build on Android r16 and older, see: -https://issuetracker.google.com/issues/36987220 - -https://bugzilla.gnome.org/show_bug.cgi?id=740791 ---- - config.h.meson | 3 +++ - configure.ac | 15 +++++++++++++++ - gio/gsocket.c | 16 +++++++++++++--- - gio/meson.build | 10 ++++++++++ - 4 files changed, 41 insertions(+), 3 deletions(-) - -diff --git a/config.h.meson b/config.h.meson -index d540cb801..8c3f3132e 100644 ---- a/config.h.meson -+++ b/config.h.meson -@@ -15,6 +15,9 @@ - /* poll doesn't work on devices */ - #mesondefine BROKEN_POLL - -+/* struct ip_mreq_source definition is broken on Android NDK <= r16 */ -+#mesondefine BROKEN_IP_MREQ_SOURCE_STRUCT -+ - /* Whether we're building a DLL and hence need symbols exported for a DLL */ - #mesondefine DLL_EXPORT - -diff --git a/configure.ac b/configure.ac -index 2013d198e..627022ef2 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -961,6 +961,21 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM( - AC_MSG_RESULT(no) - ]) - -+AC_MSG_CHECKING([if ip_mreq_source.imr_interface has s_addr member]) -+AC_COMPILE_IFELSE([AC_LANG_PROGRAM( -+ [[ -+ #include <netinet/in.h> -+ ]], -+ [[ -+ struct ip_mreq_source mc_req_src; -+ mc_req_src.imr_interface.s_addr = 0; -+ ]])], [ -+ AC_MSG_RESULT(yes) -+ ], [ -+ AC_MSG_RESULT(no) -+ AC_DEFINE(BROKEN_IP_MREQ_SOURCE_STRUCT, 1, [struct ip_mreq_source definition is broken on Android NDK <= r16]) -+]) -+ - AS_IF([test $glib_native_win32 = yes], [ - # <wspiapi.h> in the Windows SDK and in mingw-w64 has wrappers for - # inline workarounds for getaddrinfo, getnameinfo and freeaddrinfo if -diff --git a/gio/gsocket.c b/gio/gsocket.c -index 06042d8a8..b4a941eb1 100644 ---- a/gio/gsocket.c -+++ b/gio/gsocket.c -@@ -2380,6 +2380,13 @@ g_socket_multicast_group_operation_ssm (GSocket *socket, - case G_SOCKET_FAMILY_IPV4: - { - #ifdef IP_ADD_SOURCE_MEMBERSHIP -+ -+#ifdef BROKEN_IP_MREQ_SOURCE_STRUCT -+#define S_ADDR_FIELD(src) src.imr_interface -+#else -+#define S_ADDR_FIELD(src) src.imr_interface.s_addr -+#endif -+ - gint optname; - struct ip_mreq_source mc_req_src; - -@@ -2397,7 +2404,7 @@ g_socket_multicast_group_operation_ssm (GSocket *socket, - memset (&mc_req_src, 0, sizeof (mc_req_src)); - - /* By default use the default IPv4 multicast interface. */ -- mc_req_src.imr_interface.s_addr = g_htonl (INADDR_ANY); -+ S_ADDR_FIELD(mc_req_src) = g_htonl (INADDR_ANY); - - if (iface) - { -@@ -2412,7 +2419,7 @@ g_socket_multicast_group_operation_ssm (GSocket *socket, - return FALSE; - } - /* (0.0.0.iface_index) only works on Windows. */ -- mc_req_src.imr_interface.s_addr = g_htonl (iface_index); -+ S_ADDR_FIELD(mc_req_src) = g_htonl (iface_index); - #elif defined (HAVE_SIOCGIFADDR) - int ret; - struct ifreq ifr; -@@ -2442,7 +2449,7 @@ g_socket_multicast_group_operation_ssm (GSocket *socket, - } - - iface_addr = (struct sockaddr_in *) &ifr.ifr_addr; -- mc_req_src.imr_interface.s_addr = iface_addr->sin_addr.s_addr; -+ S_ADDR_FIELD(mc_req_src) = iface_addr->sin_addr.s_addr; - #endif /* defined(G_OS_WIN32) && defined (HAVE_IF_NAMETOINDEX) */ - } - memcpy (&mc_req_src.imr_multiaddr, g_inet_address_to_bytes (group), -@@ -2455,6 +2462,9 @@ g_socket_multicast_group_operation_ssm (GSocket *socket, - join_group ? IP_ADD_SOURCE_MEMBERSHIP : IP_DROP_SOURCE_MEMBERSHIP; - result = setsockopt (socket->priv->fd, IPPROTO_IP, optname, - &mc_req_src, sizeof (mc_req_src)); -+ -+#undef S_ADDR_FIELD -+ - #else - g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, - join_group ? -diff --git a/gio/meson.build b/gio/meson.build -index 7817a4797..c83d8405f 100644 ---- a/gio/meson.build -+++ b/gio/meson.build -@@ -154,6 +154,16 @@ if host_system != 'windows' - glib_conf.set('HAVE_SIOCGIFADDR', '/**/') - endif - -+ if not cc.compiles('''#include <netinet/in.h> -+ int main(int argc, char ** argv) { -+ struct ip_mreq_source mc_req_src; -+ mc_req_src.imr_interface.s_addr = 0; -+ return 0; -+ }''', -+ name : 'ip_mreq_source.imr_interface has s_addr member') -+ glib_conf.set('BROKEN_IP_MREQ_SOURCE_STRUCT', 1) -+ endif -+ - endif - - network_args_string = '' --- -2.17.0 - - -From 73ad4e4669620a82350f2195b68e5b9d6ca67967 Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Fri, 20 Apr 2018 12:09:32 -0400 -Subject: [PATCH 05/24] Meson: Add missing link on libintl in tests - -This fix undefined symbol link error when building for non-glibc -platform. Applications must link on libintl, it is not a public -dependency of libglib. - -On glibc platforms libintl is a not found dependency and is just ignored -by meson, so it doesn't hurt to always have it. - -https://bugzilla.gnome.org/show_bug.cgi?id=795406 ---- - gio/tests/meson.build | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - -diff --git a/gio/tests/meson.build b/gio/tests/meson.build -index 668839402..5aceb7c26 100644 ---- a/gio/tests/meson.build -+++ b/gio/tests/meson.build -@@ -1,8 +1,10 @@ --common_gio_tests_deps = [libglib_dep, libgmodule_dep, libgobject_dep, libgio_dep] -- --if host_system == 'darwin' --common_gio_tests_deps += [libintl] --endif -+common_gio_tests_deps = [ -+ libglib_dep, -+ libgmodule_dep, -+ libgobject_dep, -+ libgio_dep, -+ libintl -+] - - subdir('gdbus-object-manager-example') - --- -2.17.0 - - -From 42a091755f8faaed96d2a07ca57eecdb483d606c Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Mon, 23 Apr 2018 10:33:44 -0400 -Subject: [PATCH 06/24] Fix build when pthread_getname_np is not available - -On Android _setname_ is always available but _getname_ is available only -with API level >= 26. - -https://bugzilla.gnome.org/show_bug.cgi?id=795406 ---- - config.h.meson | 3 +++ - configure.ac | 9 +++++++++ - glib/tests/thread.c | 2 +- - meson.build | 18 ++++++++++-------- - 4 files changed, 23 insertions(+), 9 deletions(-) - -diff --git a/config.h.meson b/config.h.meson -index 8c3f3132e..57e1ef5fb 100644 ---- a/config.h.meson -+++ b/config.h.meson -@@ -337,6 +337,9 @@ - /* Have function pthread_setname_np with TID as argument */ - #mesondefine HAVE_PTHREAD_SETNAME_NP_WITH_TID - -+/* Have function pthread_getname_np */ -+#mesondefine HAVE_PTHREAD_GETNAME_NP -+ - /* Define to 1 if the system has the type `ptrdiff_t'. */ - #mesondefine HAVE_PTRDIFF_T - -diff --git a/configure.ac b/configure.ac -index 627022ef2..61d0544a6 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2245,6 +2245,15 @@ AS_IF([ test x"$have_threads" = xposix], [ - AC_DEFINE(HAVE_PTHREAD_SETNAME_NP_WITH_TID,1, - [Have function pthread_setname_np(pthread_t, const char*)])], - [AC_MSG_RESULT(no)]) -+ AC_MSG_CHECKING(for pthread_getname_np(pthread_t, name, len)) -+ AC_LINK_IFELSE( -+ [AC_LANG_PROGRAM( -+ [#include <pthread.h>], -+ [[char name[16]; pthread_getname_np(pthread_self(), name, 16);]])], -+ [AC_MSG_RESULT(yes) -+ AC_DEFINE(HAVE_PTHREAD_GETNAME_NP,1, -+ [Have function pthread_getname_np(pthread_t, name, len)])], -+ [AC_MSG_RESULT(no)]) - CPPFLAGS="$glib_save_CPPFLAGS" - ]) - -diff --git a/glib/tests/thread.c b/glib/tests/thread.c -index 544783692..a79b9513f 100644 ---- a/glib/tests/thread.c -+++ b/glib/tests/thread.c -@@ -174,7 +174,7 @@ test_thread5 (void) - static gpointer - thread6_func (gpointer data) - { --#ifdef HAVE_PTHREAD_SETNAME_NP_WITH_TID -+#if defined (HAVE_PTHREAD_SETNAME_NP_WITH_TID) && defined (HAVE_PTHREAD_GETNAME_NP) - char name[16]; - - pthread_getname_np (pthread_self(), name, 16); -diff --git a/meson.build b/meson.build -index d9bf2c46a..84fa5a18e 100644 ---- a/meson.build -+++ b/meson.build -@@ -1400,6 +1400,11 @@ if host_system == 'windows' - glibconfig_conf.set('g_threads_impl_def', 'WIN32') - glib_conf.set('THREADS_WIN32', 1) - else -+ pthread_prefix = ''' -+ #ifndef _GNU_SOURCE -+ # define _GNU_SOURCE -+ #endif -+ #include <pthread.h>''' - glibconfig_conf.set('g_threads_impl_def', 'POSIX') - glib_conf.set('THREADS_POSIX', 1) - if cc.has_header_symbol('pthread.h', 'pthread_attr_setstacksize') -@@ -1411,11 +1416,11 @@ else - if cc.has_header_symbol('pthread.h', 'pthread_cond_timedwait_relative_np') - glib_conf.set('HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP', 1) - endif -+ if cc.has_header_symbol('pthread.h', 'pthread_getname_np', prefix : pthread_prefix) -+ glib_conf.set('HAVE_PTHREAD_GETNAME_NP', 1) -+ endif - # Assume that pthread_setname_np is available in some form; same as configure -- if cc.links('''#ifndef _GNU_SOURCE -- # define _GNU_SOURCE -- #endif -- #include <pthread.h> -+ if cc.links(pthread_prefix + ''' - int main() { - pthread_setname_np("example"); - }''', -@@ -1423,10 +1428,7 @@ else - dependencies : thread_dep) - # macOS and iOS - glib_conf.set('HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID', 1) -- elif cc.links('''#ifndef _GNU_SOURCE -- # define _GNU_SOURCE -- #endif -- #include <pthread.h> -+ elif cc.links(pthread_prefix + ''' - int main() { - pthread_setname_np(pthread_self(), "example"); - }''', --- -2.17.0 - - -From 5f59824d257b4f128a6ddc3c9405b252c5cd0e02 Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Sat, 5 May 2018 03:19:54 +0530 -Subject: [PATCH 07/24] meson: Update glib version - ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 84fa5a18e..8f3cb91a1 100644 ---- a/meson.build -+++ b/meson.build -@@ -1,5 +1,5 @@ - project('glib', 'c', 'cpp', -- version : '2.56.0', -+ version : '2.56.1', - meson_version : '>= 0.44.0', - default_options : [ - 'warning_level=1', --- -2.17.0 - - -From 6330d09f07833bbea75b9bbe821d431891628c30 Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Mon, 11 Dec 2017 14:47:04 -0500 -Subject: [PATCH 08/24] Meson: Use pkgconfig module to generate all pc files - -This requires improved pc file generator from meson 0.45. - -https://bugzilla.gnome.org/show_bug.cgi?id=788773 ---- - gio/meson.build | 39 +++++++++++++++++++++++++++++++++++++++ - glib/meson.build | 14 ++++++++++++++ - gmodule/meson.build | 32 ++++++++++++++++++++++++++++++++ - gobject/meson.build | 9 +++++++++ - gthread/meson.build | 9 +++++++++ - meson.build | 31 ++++--------------------------- - 6 files changed, 107 insertions(+), 27 deletions(-) - -diff --git a/gio/meson.build b/gio/meson.build -index c83d8405f..ca544d93c 100644 ---- a/gio/meson.build -+++ b/gio/meson.build -@@ -804,6 +804,45 @@ libgio = library('gio-2.0', - link_args : noseh_link_args, - ) - -+giomodulesdir = get_option('gio_module_dir') -+if giomodulesdir == '' -+ giomodulesdir = join_paths('${libdir}', 'gio', 'modules') -+endif -+ -+pkg.generate(libraries : libgio, -+ requires : ['glib-2.0', 'gobject-2.0'], -+ variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')), -+ 'giomoduledir=' + giomodulesdir, -+ 'glib_compile_schemas=' + join_paths('${bindir}', 'glib-compile-schemas'), -+ 'glib_compile_resources=' + join_paths('${bindir}', 'glib-compile-resources'), -+ 'gdbus_codegen=' + join_paths('${bindir}', 'gdbus-codegen')], -+ version : glib_version, -+ install_dir : glib_pkgconfigreldir, -+ filebase : 'gio-2.0', -+ name : 'GIO', -+ description : 'glib I/O library', -+) -+ -+if host_system == 'windows' -+ pkg.generate(requires : ['gobject-2.0', 'gmodule-no-export-2.0', 'gio-2.0'], -+ subdirs : ['gio-win32-2.0'], -+ version : glib_version, -+ install_dir : glib_pkgconfigreldir, -+ filebase : 'gio-windows-2.0', -+ name : 'GIO Windows specific APIs', -+ description : 'Windows specific headers for glib I/O library', -+ ) -+else -+ pkg.generate(requires : ['gobject-2.0', 'gio-2.0'], -+ subdirs : ['gio-unix-2.0'], -+ version : glib_version, -+ install_dir : glib_pkgconfigreldir, -+ filebase : 'gio-unix-2.0', -+ name : 'GIO unix specific APIs', -+ description : 'unix specific headers for glib I/O library', -+ ) -+endif -+ - libgio_dep = declare_dependency(link_with : libgio, - dependencies : [gioenumtypes_dep], - # We sadly need to export configinc here because everyone includes <gio/*.h> -diff --git a/glib/meson.build b/glib/meson.build -index 9df77b6f9..3b4caf8ce 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -249,6 +249,20 @@ libglib_dep = declare_dependency( - # We sadly need to export configinc here because everyone includes <glib/*.h> - include_directories : [configinc, glibinc]) - -+pkg.generate(libraries : libglib, -+ subdirs : ['glib-2.0'], -+ extra_cflags : ['-I${libdir}/glib-2.0/include'], -+ variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')), -+ 'glib_genmarshal=' + join_paths('${bindir}', 'glib-genmarshal'), -+ 'gobject_query=' + join_paths('${bindir}', 'gobject-query'), -+ 'glib_mkenums=' + join_paths('${bindir}', 'glib-mkenums')], -+ version : glib_version, -+ install_dir : glib_pkgconfigreldir, -+ filebase : 'glib-2.0', -+ name : 'GLib', -+ description : 'C Utility Library', -+) -+ - # On Windows, glib needs a spawn helper for g_spawn* API - if host_system == 'windows' - if host_machine.cpu_family() == 'x86' -diff --git a/gmodule/meson.build b/gmodule/meson.build -index 03c689e3a..3b57fb477 100644 ---- a/gmodule/meson.build -+++ b/gmodule/meson.build -@@ -104,5 +104,37 @@ libgmodule = library('gmodule-2.0', - dependencies : [libdl_dep, libglib_dep], - c_args : ['-DG_LOG_DOMAIN="GModule"', '-DG_DISABLE_DEPRECATED'] + glib_hidden_visibility_args) - -+supported_var = 'gmodule_supported=@0@'.format(g_module_impl != '0') -+ -+pkg.generate(libraries : [libgmodule, thread_dep], -+ requires : ['glib-2.0'], -+ version : glib_version, -+ variables : [supported_var], -+ install_dir : glib_pkgconfigreldir, -+ filebase : 'gmodule-no-export-2.0', -+ name : 'GModule', -+ description : 'Dynamic module loader for GLib', -+) -+ -+pkg.generate(libraries : [libgmodule], -+ requires : ['glib-2.0'], -+ version : glib_version, -+ variables : [supported_var], -+ install_dir : glib_pkgconfigreldir, -+ filebase : 'gmodule-export-2.0', -+ name : 'GModule', -+ description : 'Dynamic module loader for GLib', -+) -+ -+pkg.generate(libraries : [libgmodule], -+ requires : ['glib-2.0'], -+ version : glib_version, -+ variables : [supported_var], -+ install_dir : glib_pkgconfigreldir, -+ filebase : 'gmodule-2.0', -+ name : 'GModule', -+ description : 'Dynamic module loader for GLib', -+) -+ - libgmodule_dep = declare_dependency(link_with : libgmodule, - include_directories : gmoduleinc) -diff --git a/gobject/meson.build b/gobject/meson.build -index f1ab8fd46..98e306d7f 100644 ---- a/gobject/meson.build -+++ b/gobject/meson.build -@@ -71,6 +71,15 @@ libgobject = library('gobject-2.0', - dependencies : [libintl, libffi_dep, libglib_dep], - c_args : ['-DG_LOG_DOMAIN="GLib-GObject"', '-DGOBJECT_COMPILATION'] + glib_hidden_visibility_args) - -+pkg.generate(libraries : libgobject, -+ requires : ['glib-2.0'], -+ version : glib_version, -+ install_dir : glib_pkgconfigreldir, -+ filebase : 'gobject-2.0', -+ name : 'GObject', -+ description : 'GLib Type, Object, Parameter and Signal Library', -+) -+ - libgobject_dep = declare_dependency(link_with : libgobject, - include_directories : gobjectinc) - -diff --git a/gthread/meson.build b/gthread/meson.build -index 8d4696d29..3787dba3b 100644 ---- a/gthread/meson.build -+++ b/gthread/meson.build -@@ -19,3 +19,12 @@ libgthread = library('gthread-2.0', - install : true, - dependencies : [libglib_dep], - c_args : ['-DG_LOG_DOMAIN="GThread"' ] + glib_hidden_visibility_args) -+ -+pkg.generate(libraries : [libgthread, thread_dep], -+ requires : ['glib-2.0'], -+ version : glib_version, -+ install_dir : glib_pkgconfigreldir, -+ filebase : 'gthread-2.0', -+ name : 'GThread', -+ description : 'Thread support for GLib', -+) -diff --git a/meson.build b/meson.build -index 8f3cb91a1..543f91704 100644 ---- a/meson.build -+++ b/meson.build -@@ -1,6 +1,6 @@ - project('glib', 'c', 'cpp', - version : '2.56.1', -- meson_version : '>= 0.44.0', -+ meson_version : '>= 0.45.0', - default_options : [ - 'warning_level=1', - 'c_std=gnu89' -@@ -1679,8 +1679,8 @@ if libmount_dep.length() != 0 - endif - glib_conf.set('GIO_MODULE_DIR', glib_giomodulesdir) - # FIXME: Missing: --# @G_MODULE_LIBS@ @COCOA_LIBS@ @CARBON_LIBS@ @G_LIBS_EXTRA@ --# @PCRE_REQUIRES@ @GLIB_EXTRA_CFLAGS@ @G_THREAD_CFLAGS@ -+# @COCOA_LIBS@ @CARBON_LIBS@ @G_LIBS_EXTRA@ @GLIB_EXTRA_CFLAGS@ -+# @G_MODULE_LDFLAGS@ - - # Tracing: dtrace - want_dtrace = get_option('dtrace') -@@ -1726,6 +1726,7 @@ if want_systemtap and enable_dtrace - endif - - -+pkg = import('pkgconfig') - windows = import('windows') - subdir('glib') - subdir('gobject') -@@ -1737,30 +1738,6 @@ if xgettext.found() - endif - subdir('tests') - --# Configure and install pkg-config files --pc_files = [ -- 'gobject-2.0.pc', -- 'glib-2.0.pc', -- 'gthread-2.0.pc', -- 'gmodule-2.0.pc', -- 'gmodule-export-2.0.pc', -- 'gmodule-no-export-2.0.pc', -- 'gio-2.0.pc', --] --if host_system == 'windows' -- pc_files += ['gio-windows-2.0.pc'] --else -- pc_files += ['gio-unix-2.0.pc'] --endif -- --foreach pc : pc_files -- configure_file(input : pc + '.in', -- install : true, -- install_dir : glib_pkgconfigreldir, -- output : pc, -- configuration : glib_conf) --endforeach -- - # NOTE: We skip glib-zip.in because the filenames it assumes don't match ours - - # Install glib-gettextize executable, if a UNIX-style shell is found --- -2.17.0 - - -From 31427ef282de6700e8a4aec354048a77f98b0c53 Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Thu, 4 Jan 2018 15:55:59 -0500 -Subject: [PATCH 09/24] Meson: Add carbon and cocoa flags into glib and gio pc - files - -https://bugzilla.gnome.org/show_bug.cgi?id=788773 ---- - gio/meson.build | 1 + - glib/meson.build | 3 ++- - meson.build | 14 +++++--------- - 3 files changed, 8 insertions(+), 10 deletions(-) - -diff --git a/gio/meson.build b/gio/meson.build -index ca544d93c..9e663d6ef 100644 ---- a/gio/meson.build -+++ b/gio/meson.build -@@ -810,6 +810,7 @@ if giomodulesdir == '' - endif - - pkg.generate(libraries : libgio, -+ libraries_private : [osx_ldflags], - requires : ['glib-2.0', 'gobject-2.0'], - variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')), - 'giomoduledir=' + giomodulesdir, -diff --git a/glib/meson.build b/glib/meson.build -index 3b4caf8ce..9d186201d 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -234,7 +234,7 @@ libglib = library('glib-2.0', - soversion : soversion, - install : true, - # intl.lib is not compatible with SAFESEH -- link_args : platform_ldflags + noseh_link_args, -+ link_args : noseh_link_args, - include_directories : configinc, - link_with : [charset_lib, gnulib_lib], - dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps, -@@ -250,6 +250,7 @@ libglib_dep = declare_dependency( - include_directories : [configinc, glibinc]) - - pkg.generate(libraries : libglib, -+ libraries_private : [osx_ldflags], - subdirs : ['glib-2.0'], - extra_cflags : ['-I${libdir}/glib-2.0/include'], - variables : ['bindir=' + join_paths('${prefix}', get_option('bindir')), -diff --git a/meson.build b/meson.build -index 543f91704..357dd0322 100644 ---- a/meson.build -+++ b/meson.build -@@ -494,7 +494,7 @@ if host_system == 'linux' - endif - endif - --platform_ldflags=[] -+osx_ldflags = [] - - # Mac OS X Carbon support - glib_have_carbon = cc.compiles('''#include <Carbon/Carbon.h> -@@ -505,14 +505,11 @@ glib_have_os_x_9_or_later = false - - if glib_have_carbon - glib_conf.set('HAVE_CARBON', true) -- CARBON_LIBS='-Wl,-framework,Carbon' # FIXME: propagate to .pc files as well -- platform_ldflags += [CARBON_LIBS] -+ osx_ldflags += '-Wl,-framework,Carbon' - glib_have_os_x_9_or_later = cc.compiles('''#include <AvailabilityMacros.h> - #if MAC_OS_X_VERSION_MIN_REQUIRED < 1090 - #error Compiling for minimum OS X version before 10.9 - #endif''', name : 'OS X 9 or later') --else -- CARBON_LIBS='' - endif - - # Mac OS X Cocoa support -@@ -524,12 +521,11 @@ glib_have_cocoa = cc.compiles('''#include <Cocoa/Cocoa.h> - - if glib_have_cocoa - glib_conf.set('HAVE_COCOA', true) -- COCOA_LIBS='-Wl,-framework,Foundation -Wl,-framework,AppKit' # FIXME: propagate to .pc files as well -- platform_ldflags += [COCOA_LIBS] --else -- COCOA_LIBS='' -+ osx_ldflags += '-Wl,-framework,Foundation -Wl,-framework,AppKit' - endif - -+add_project_link_arguments(osx_ldflags, language : 'c') -+ - # Check for futex(2) - if cc.links('''#include <linux/futex.h> - #include <sys/syscall.h> --- -2.17.0 - - -From 6bb223ea27ec7a2d5e9dfd041e0b0489ef492770 Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Fri, 6 Apr 2018 13:46:15 -0400 -Subject: [PATCH 10/24] Meson: Use cc.compute_int() instead of running our own - code - -When cross compiling we cannot run code, and meson has code to compute -int values without executing code. - -https://bugzilla.gnome.org/show_bug.cgi?id=794898 ---- - meson.build | 73 +++++++++++++++++++---------------------------------- - 1 file changed, 26 insertions(+), 47 deletions(-) - -diff --git a/meson.build b/meson.build -index 357dd0322..f9af7070e 100644 ---- a/meson.build -+++ b/meson.build -@@ -1281,54 +1281,43 @@ endif - has_winsock2 = cc.has_header('winsock2.h') - - if has_syspoll and has_systypes -- templ = '''#include<sys/poll.h> --#include<sys/types.h> --#include<stdio.h> --int main(int argc, char **argv) { -- printf("%d\n", (int)@0@); -- return 0; --}''' -+ poll_includes = ''' -+ #include<sys/poll.h> -+ #include<sys/types.h>''' - elif has_winsock2 -- templ = '''#define _WIN32_WINNT 0x0600 --#include <stdio.h> --#include <winsock2.h> --int main(int argc, char **argv) { -- printf("%d\n", (int)@0@); -- return 0; --}''' -+ poll_includes = ''' -+ #define _WIN32_WINNT 0x0600 -+ #include <winsock2.h>''' - else - # FIXME? - error('FIX POLL* defines') - endif - --value_POLLIN = cc.run(templ.format('POLLIN'), name : 'POLLIN value').stdout().strip() --value_POLLOUT = cc.run(templ.format('POLLOUT'), name : 'POLLOUT value').stdout().strip() --value_POLLPRI = cc.run(templ.format('POLLPRI'), name : 'POLLPRI value').stdout().strip() --value_POLLERR = cc.run(templ.format('POLLERR'), name : 'POLLERR value').stdout().strip() --value_POLLHUP = cc.run(templ.format('POLLHUP'), name : 'POLLHUP value').stdout().strip() --value_POLLNVAL = cc.run(templ.format('POLLNVAL'), name : 'POLLNVAL value').stdout().strip() -- --glibconfig_conf.set('g_pollin', value_POLLIN) --glibconfig_conf.set('g_pollout', value_POLLOUT) --glibconfig_conf.set('g_pollpri', value_POLLPRI) --glibconfig_conf.set('g_pollerr', value_POLLERR) --glibconfig_conf.set('g_pollhup', value_POLLHUP) --glibconfig_conf.set('g_pollnval', value_POLLNVAL) -+poll_defines = [ -+ [ 'POLLIN', 'g_pollin' ], -+ [ 'POLLOUT', 'g_pollout' ], -+ [ 'POLLPRI', 'g_pollpri' ], -+ [ 'POLLERR', 'g_pollerr' ], -+ [ 'POLLHUP', 'g_pollhup' ], -+ [ 'POLLNVAL', 'g_pollnval' ], -+] -+foreach d : poll_defines -+ val = cc.compute_int(d[0], prefix: poll_includes) -+ glibconfig_conf.set(d[1], val) -+endforeach - - # Internet address families - # FIXME: what about Cygwin (G_WITH_CYGWIN) - if host_system == 'windows' -- glib_inet_includes= ''' --#include <winsock2.h> --''' -+ inet_includes = ''' -+ #include <winsock2.h>''' - else -- glib_inet_includes=''' --#include <sys/types.h> --#include <sys/socket.h> --''' -+ inet_includes = ''' -+ #include <sys/types.h> -+ #include <sys/socket.h>''' - endif - --net_defines = [ -+inet_defines = [ - [ 'AF_UNIX', 'g_af_unix' ], - [ 'AF_INET', 'g_af_inet' ], - [ 'AF_INET6', 'g_af_inet6' ], -@@ -1336,18 +1325,8 @@ net_defines = [ - [ 'MSG_PEEK', 'g_msg_peek' ], - [ 'MSG_DONTROUTE', 'g_msg_dontroute' ], - ] --foreach d : net_defines -- templ = '''@0@ --#include <stdio.h> --int main(int argc, char **argv) { -- printf("%d\n", (int)@1@); -- return 0; --}''' -- # FIXME: fix for cross-compilation -- if not meson.has_exe_wrapper() -- error('Fix sys define detection for cross build') -- endif -- val = cc.run(templ.format(glib_inet_includes, d[0]), name : d[0] + ' value').stdout().strip() -+foreach d : inet_defines -+ val = cc.compute_int(d[0], prefix: inet_includes) - glibconfig_conf.set(d[1], val) - endforeach - --- -2.17.0 - - -From fea853d2b1f0a31f486314a31f969d5e37f2cc0b Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Mon, 2 Apr 2018 23:01:25 -0400 -Subject: [PATCH 11/24] Meson: Get results from cross file properties if cannot - run code - -When cross compiling and not exe wrapper has been defined cc.run() raise -an exception. Avoid this by taking the value from [properties] in the -cross file and provide sensible default if the variable is not defined. - -https://bugzilla.gnome.org/show_bug.cgi?id=794898 ---- - meson.build | 53 ++++++++++++++++++++++++++++++++--------------------- - 1 file changed, 32 insertions(+), 21 deletions(-) - -diff --git a/meson.build b/meson.build -index f9af7070e..44ebf5ca6 100644 ---- a/meson.build -+++ b/meson.build -@@ -10,6 +10,8 @@ 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() -+ - if cc.get_id() == 'msvc' - # Ignore several spurious warnings for things glib does very commonly - # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it -@@ -673,10 +675,15 @@ main(void) - exit(1); - }''' - -- rres = cc.run(vsnprintf_c99_test_code, name : 'C99 vsnprintf') -- if rres.compiled() and rres.returncode() == 0 -- glib_conf.set('HAVE_C99_VSNPRINTF', 1) -- have_good_vsnprintf = true -+ if cc_can_run -+ rres = cc.run(vsnprintf_c99_test_code, name : 'C99 vsnprintf') -+ if rres.compiled() and rres.returncode() == 0 -+ glib_conf.set('HAVE_C99_VSNPRINTF', 1) -+ have_good_vsnprintf = true -+ endif -+ else -+ have_good_vsnprintf = meson.get_cross_property('have_c99_vsnprintf', false) -+ glib_conf.set('HAVE_C99_VSNPRINTF', have_good_vsnprintf) - endif - - snprintf_c99_test_code = ''' -@@ -715,10 +722,15 @@ main(void) - exit(1); - }''' - -- rres = cc.run(snprintf_c99_test_code, name : 'C99 snprintf') -- if rres.compiled() and rres.returncode() == 0 -- glib_conf.set('HAVE_C99_SNPRINTF', 1) -- have_good_snprintf = true -+ if cc_can_run -+ rres = cc.run(snprintf_c99_test_code, name : 'C99 snprintf') -+ if rres.compiled() and rres.returncode() == 0 -+ glib_conf.set('HAVE_C99_SNPRINTF', 1) -+ have_good_snprintf = true -+ endif -+ else -+ have_good_snprintf = meson.get_cross_property('have_c99_snprintf', false) -+ glib_conf.set('HAVE_C99_SNPRINTF', have_good_snprintf) - endif - endif - -@@ -1219,16 +1231,13 @@ va_list_val_copy_prog = ''' - return 0; - }''' - --# We do this in two steps so if compilation fails already it looks less alarming --glib_va_val_copy = false --if cc.compiles(va_list_val_copy_prog, name : 'va_lists can be copied as values') -- # FIXME: what to do when cross-compiling? -- if cc.run(va_list_val_copy_prog, name : 'va_lists can be copied as values').returncode() == 0 -- glib_va_val_copy = true -- endif -+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.returncode() == 0 -+else -+ glib_va_val_copy = meson.get_cross_property('va_val_copy', true) - endif - if not glib_va_val_copy -- glib_va_val_copy = false - glib_vacopy = glib_vacopy + '\n#define G_VA_COPY_AS_ARRAY 1' - glib_conf.set('G_VA_COPY_AS_ARRAY', 1) - endif -@@ -1414,7 +1423,6 @@ else - endif - endif - --# FIXME: how to do this when cross-compiling? - # FIXME: we should make it print the result and always return 0, so that - # the output in meson shows up as green - stack_grows_check_prog = ''' -@@ -1432,13 +1440,16 @@ stack_grows_check_prog = ''' - f (100); - return b > a ? 0 : 1; - }''' --stack_grows_run_result = cc.run(stack_grows_check_prog, name : 'stack grows check') --if stack_grows_run_result.compiled() and stack_grows_run_result.returncode() == 0 -- glibconfig_conf.set('G_HAVE_GROWING_STACK', 1) -+ -+if cc_can_run -+ rres = cc.run(stack_grows_check_prog, name : 'stack grows check') -+ growing_stack = rres.returncode() == 0 - else -- glibconfig_conf.set('G_HAVE_GROWING_STACK', 0) -+ growing_stack = meson.get_cross_property('growing_stack', false) - endif - -+glibconfig_conf.set('G_HAVE_GROWING_STACK', growing_stack) -+ - # Tests for iconv - # - # USE_LIBICONV_GNU: Using GNU libiconv --- -2.17.0 - - -From bbdf3549b708135595e9ebd5e37368f8e898dc89 Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Wed, 28 Mar 2018 21:37:38 -0400 -Subject: [PATCH 12/24] Meson: Define G_ENABLE_DEBUG and friends - -https://bugzilla.gnome.org/show_bug.cgi?id=794790 ---- - meson.build | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/meson.build b/meson.build -index 44ebf5ca6..0f43cb6b9 100644 ---- a/meson.build -+++ b/meson.build -@@ -2,6 +2,7 @@ project('glib', 'c', 'cpp', - version : '2.56.1', - meson_version : '>= 0.45.0', - default_options : [ -+ 'buildtype=debugoptimized', - 'warning_level=1', - 'c_std=gnu89' - ] -@@ -149,6 +150,15 @@ glibconfig_conf.set('glib_os', glib_os) - # for dependencies that don't normally come with pkg-config files for Visual Studio builds - buildtype = get_option('buildtype') - -+glib_debug_cflags = [] -+if buildtype.startswith('debug') -+ glib_debug_cflags += ['-DG_ENABLE_DEBUG'] -+elif buildtype == 'release' -+ glib_debug_cflags += ['-DG_DISABLE_CAST_CHECKS'] -+endif -+ -+add_project_arguments(glib_debug_cflags, language: 'c') -+ - # check for header files - - headers = [ --- -2.17.0 - - -From 78f517328bc7646ab9d4d71584f1ba832b127fa3 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= - =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com> -Date: Sat, 31 Mar 2018 13:59:55 +0000 -Subject: [PATCH 13/24] Force W32-specific POLL* constant values in meson - -The winsock2-using test does work perfectly, however this is a new -thing that didn't exist in autotools-based builds of glib in the past. -Autotools builds used the generic case where values were just defined -to some agreed-upon numbers, and this is what all autotools-glib -binaries and binaries built against autotools-glib (since these -values go into public glibconfig.h header) use. At least one value, -G_POLLIN, is different, thus breaking ABI if some binaries are -built with autotools and the others are built with meson. - -Force meson buildscript to use the same G_POLL* constant values -for Windows builds that autotools builds use. - -https://bugzilla.gnome.org/show_bug.cgi?id=794687 ---- - meson.build | 33 +++++++++++++++++++++++---------- - 1 file changed, 23 insertions(+), 10 deletions(-) - -diff --git a/meson.build b/meson.build -index 0f43cb6b9..375537afc 100644 ---- a/meson.build -+++ b/meson.build -@@ -1313,17 +1313,30 @@ else - endif - - poll_defines = [ -- [ 'POLLIN', 'g_pollin' ], -- [ 'POLLOUT', 'g_pollout' ], -- [ 'POLLPRI', 'g_pollpri' ], -- [ 'POLLERR', 'g_pollerr' ], -- [ 'POLLHUP', 'g_pollhup' ], -- [ 'POLLNVAL', 'g_pollnval' ], -+ [ 'POLLIN', 'g_pollin', 1 ], -+ [ 'POLLOUT', 'g_pollout', 4 ], -+ [ 'POLLPRI', 'g_pollpri', 2 ], -+ [ 'POLLERR', 'g_pollerr', 8 ], -+ [ 'POLLHUP', 'g_pollhup', 16 ], -+ [ 'POLLNVAL', 'g_pollnval', 32 ], - ] --foreach d : poll_defines -- val = cc.compute_int(d[0], prefix: poll_includes) -- glibconfig_conf.set(d[1], val) --endforeach -+ -+if has_syspoll and has_systypes -+ foreach d : poll_defines -+ val = cc.compute_int(d[0], prefix: poll_includes) -+ glibconfig_conf.set(d[1], val) -+ endforeach -+elif has_winsock2 -+ # Due to a missed bug in configure.ac the poll test -+ # never succeeded on Windows and used some pre-defined -+ # values as a fallback. Keep using them to maintain -+ # ABI compatibility with autotools builds of glibs -+ # and with *any* glib-using code compiled against them, -+ # since these values end up in a public header glibconfig.h. -+ foreach d : poll_defines -+ glibconfig_conf.set(d[1], d[2]) -+ endforeach -+endif - - # Internet address families - # FIXME: what about Cygwin (G_WITH_CYGWIN) --- -2.17.0 - - -From 41cbd73be8a00863d083415f1f210f934ce86c38 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= - =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com> -Date: Tue, 10 Apr 2018 22:46:53 +0000 -Subject: [PATCH 14/24] Link gdatetime test to libintl - -gdatetime testcase uses glib (which uses libintl), but *alsi* calls -libintl functions on its own, as part of the testing process. -Therefore it must be linked to libintl like any other program that -uses it. - -https://bugzilla.gnome.org/show_bug.cgi?id=794556 ---- - glib/tests/meson.build | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/glib/tests/meson.build b/glib/tests/meson.build -index 4ac3620b8..7df9b23ee 100644 ---- a/glib/tests/meson.build -+++ b/glib/tests/meson.build -@@ -110,6 +110,9 @@ foreach test_name : glib_tests - if test_name == 'regex' - deps += [pcre] - endif -+ if test_name == 'gdatetime' -+ deps += [libintl] -+ endif - exe = executable(test_name, '@0@.c'.format(test_name), - c_args : ['-DPCRE_STATIC'] + test_cargs, - dependencies : deps, --- -2.17.0 - - -From 0cfaf08db805f225af44f0cd0631402e23dd697d Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Mon, 7 May 2018 15:07:47 +0530 -Subject: [PATCH 15/24] config.h.meson: Add some missing #mesondefines - -The compiler checks were being completely ignored. ---- - config.h.meson | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/config.h.meson b/config.h.meson -index 57e1ef5fb..b780a3e36 100644 ---- a/config.h.meson -+++ b/config.h.meson -@@ -226,6 +226,12 @@ - /* Define to 1 if you have the `kqueue' function. */ - #mesondefine HAVE_KQUEUE - -+/* Check for nl_langinfo and abbreviated alternative month names */ -+#mesondefine HAVE_LANGINFO_ABALTMON -+ -+/* Check for nl_langinfo and alternative month names */ -+#mesondefine HAVE_LANGINFO_ALTMON -+ - /* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ - #mesondefine HAVE_LANGINFO_CODESET - -@@ -629,6 +635,9 @@ - /* Define if you have the 'wchar_t' type. */ - #mesondefine HAVE_WCHAR_T - -+/* Define if you Have wcrtomb() */ -+#mesondefine HAVE_WCRTOMB -+ - /* Define to 1 if you have the `wcslen' function. */ - #mesondefine HAVE_WCSLEN - --- -2.17.0 - - -From 984a843463efd75aa5afb4f3f74c342e55a7f94a Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Mon, 7 May 2018 15:08:51 +0530 -Subject: [PATCH 16/24] meson: Add name for atomic test so it shows up in - configure - ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 375537afc..39e5f33ed 100644 ---- a/meson.build -+++ b/meson.build -@@ -1387,7 +1387,7 @@ atomictest = '''void func() { - __sync_bool_compare_and_swap (&atomic, 2, 3); - } - ''' --if cc.compiles(atomictest) -+if cc.compiles(atomictest, name : 'atomic ops') - glibconfig_conf.set('G_ATOMIC_LOCK_FREE', true) - else - if host_machine.cpu_family() == 'x86' and cc.compiles(atomictest, args : '-march=i486') --- -2.17.0 - - -From 8d826d1e9bcb8bd21ef34e532191df39365a1e01 Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Mon, 7 May 2018 15:19:36 +0530 -Subject: [PATCH 17/24] meson: Fix checks for posix_memalign and stpcpy - -The 'no-builtin' checks were just plain wrong. For accurate detection of -functions, use has_function with a header in the prefix. This fixes -posix_memalign detection on Android and on MinGW. - -This also allows cross-files to override the result by setting -`has_function_stpcpy = false`, etc in [extra properties] ---- - meson.build | 12 ++++++++++-- - 1 file changed, 10 insertions(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index 39e5f33ed..f4bf5b89b 100644 ---- a/meson.build -+++ b/meson.build -@@ -310,7 +310,6 @@ endif - functions = [ - 'alloca', - 'mmap', -- 'posix_memalign', - 'memalign', - 'valloc', - 'fsync', -@@ -322,7 +321,6 @@ functions = [ - 'lstat', - 'strsignal', - 'vsnprintf', -- 'stpcpy', - 'poll', - 'vasprintf', - 'setenv', -@@ -413,6 +411,16 @@ foreach f : functions - endif - endforeach - -+# Check that stpcpy() is usable; must use header -+if cc.has_function('stpcpy', prefix : '#include <string.h>') -+ glib_conf.set('HAVE_STPCPY', 1) -+endif -+ -+# Check that posix_memalign() is usable; must use header -+if cc.has_function('posix_memalign', prefix : '#include <stdlib.h>') -+ glib_conf.set('HAVE_POSIX_MEMALIGN', 1) -+endif -+ - # Check whether strerror_r returns char * - if have_func_strerror_r - if cc.compiles('''#define _GNU_SOURCE --- -2.17.0 - - -From 299cfad74bb6114984a7b546eced45665e1f905f Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Wed, 9 May 2018 17:13:34 +0530 -Subject: [PATCH 18/24] meson: Fix atomic ops check - -It should link, not just compile. This is what configure does too. - -Also, we always have it on MSVC (already upstream in a separate commit) ---- - meson.build | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/meson.build b/meson.build -index f4bf5b89b..1fc8f339d 100644 ---- a/meson.build -+++ b/meson.build -@@ -1395,10 +1395,10 @@ atomictest = '''void func() { - __sync_bool_compare_and_swap (&atomic, 2, 3); - } - ''' --if cc.compiles(atomictest, name : 'atomic ops') -+if cc.get_id() == 'msvc' or cc.links(atomictest, name : 'atomic ops') - glibconfig_conf.set('G_ATOMIC_LOCK_FREE', true) - else -- if host_machine.cpu_family() == 'x86' and cc.compiles(atomictest, args : '-march=i486') -+ if host_machine.cpu_family() == 'x86' and cc.links(atomictest, args : '-march=i486') - error('GLib must be built with -march=i486 or later.') - endif - glibconfig_conf.set('G_ATOMIC_LOCK_FREE', false) --- -2.17.0 - - -From c44d4eaa205797751c75f2c87433ce97647b3b5c Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Sun, 13 May 2018 19:22:51 -0400 -Subject: [PATCH 19/24] Meson: libintl is a public dependency of glib-2.0 - -On non-glibc platforms gettext is provided by extra libintl dependency. -We wrongly thought libintl is an internal dependency and applications -needs to explicitly link on it, but turns out that breaks many -applications and with autotools the .pc generated actually has -lintl in -public "Libs:". - -https://bugzilla.gnome.org/show_bug.cgi?id=796085 ---- - gio/meson.build | 16 ++++++++-------- - gio/tests/meson.build | 1 - - glib/meson.build | 12 ++++++------ - gobject/meson.build | 5 +++-- - 4 files changed, 17 insertions(+), 17 deletions(-) - -diff --git a/gio/meson.build b/gio/meson.build -index 9e663d6ef..c02170eaf 100644 ---- a/gio/meson.build -+++ b/gio/meson.build -@@ -796,7 +796,7 @@ libgio = library('gio-2.0', - link_with : internal_deps, - #libgio_2_0_la_LDFLAGS = $(GLIB_LINK_FLAGS)', - # '$(gio_win32_res_ldflag)', -- dependencies : [libintl, libz_dep, libdl_dep, libmount_dep, libglib_dep, -+ dependencies : [libz_dep, libdl_dep, libmount_dep, libglib_dep, - libgobject_dep, libgmodule_dep, selinux_dep, xattr_dep, - platform_deps, network_libs], - c_args : gio_c_args, -@@ -896,13 +896,13 @@ executable('gio', gio_tool_sources, - c_args : gio_c_args, - # intl.lib is not compatible with SAFESEH - link_args : noseh_link_args, -- dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) -+ dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) - - executable('gresource', 'gresource-tool.c', - install : true, - # intl.lib is not compatible with SAFESEH - link_args : noseh_link_args, -- dependencies : [libelf, libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) -+ dependencies : [libelf, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) - - executable('gio-querymodules', 'gio-querymodules.c', 'giomodule-priv.c', - install : true, -@@ -916,7 +916,7 @@ glib_compile_schemas = executable('glib-compile-schemas', - install : true, - # intl.lib is not compatible with SAFESEH - link_args : noseh_link_args, -- dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) -+ dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) - - glib_compile_resources = executable('glib-compile-resources', - [gconstructor_as_data_h, 'gvdb/gvdb-builder.c', 'glib-compile-resources.c'], -@@ -924,14 +924,14 @@ glib_compile_resources = executable('glib-compile-resources', - c_args : gio_c_args, - # intl.lib is not compatible with SAFESEH - link_args : noseh_link_args, -- dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) -+ dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) - - executable('gsettings', 'gsettings-tool.c', - install : true, - c_args : gio_c_args, - # intl.lib is not compatible with SAFESEH - link_args : noseh_link_args, -- dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) -+ dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) - install_data('gschema.dtd', - install_dir : join_paths(get_option('datadir'), 'glib-2.0/schemas')) - -@@ -943,7 +943,7 @@ executable('gdbus', 'gdbus-tool.c', - c_args : gio_c_args, - # intl.lib is not compatible with SAFESEH - link_args : noseh_link_args, -- dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) -+ dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) - - if host_system != 'windows' - executable('gapplication', 'gapplication-tool.c', -@@ -951,7 +951,7 @@ if host_system != 'windows' - c_args : gio_c_args, - # intl.lib is not compatible with SAFESEH - link_args : noseh_link_args, -- dependencies : [libintl, libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) -+ dependencies : [libgio_dep, libgobject_dep, libgmodule_dep, libglib_dep]) - endif - - if enable_systemtap -diff --git a/gio/tests/meson.build b/gio/tests/meson.build -index 5aceb7c26..f66b9ed22 100644 ---- a/gio/tests/meson.build -+++ b/gio/tests/meson.build -@@ -3,7 +3,6 @@ common_gio_tests_deps = [ - libgmodule_dep, - libgobject_dep, - libgio_dep, -- libintl - ] - - subdir('gdbus-object-manager-example') -diff --git a/glib/meson.build b/glib/meson.build -index 9d186201d..ea9bf41ce 100644 ---- a/glib/meson.build -+++ b/glib/meson.build -@@ -245,11 +245,11 @@ libglib_dep = declare_dependency( - link_with : libglib, - # thread_dep doesn't get pulled in from libglib atm, - # see https://github.com/mesonbuild/meson/issues/1426 -- dependencies : [thread_dep], -+ dependencies : [thread_dep, libintl], - # We sadly need to export configinc here because everyone includes <glib/*.h> - include_directories : [configinc, glibinc]) - --pkg.generate(libraries : libglib, -+pkg.generate(libraries : [libglib, libintl], - libraries_private : [osx_ldflags], - subdirs : ['glib-2.0'], - extra_cflags : ['-I${libdir}/glib-2.0/include'], -@@ -271,23 +271,23 @@ if host_system == 'windows' - install : true, - gui_app : true, - include_directories : configinc, -- dependencies : [libintl, libglib_dep]) -+ dependencies : [libglib_dep]) - executable('gspawn-win32-helper-console', 'gspawn-win32-helper.c', - install : true, - c_args : ['-DHELPER_CONSOLE'], - include_directories : configinc, -- dependencies : [libintl, libglib_dep]) -+ dependencies : [libglib_dep]) - else - executable('gspawn-win64-helper', 'gspawn-win32-helper.c', - install : true, - gui_app : true, - include_directories : configinc, -- dependencies : [libintl, libglib_dep]) -+ dependencies : [libglib_dep]) - executable('gspawn-win64-helper-console', 'gspawn-win32-helper.c', - install : true, - c_args : ['-DHELPER_CONSOLE'], - include_directories : configinc, -- dependencies : [libintl, libglib_dep]) -+ dependencies : [libglib_dep]) - endif - else - gtester = executable('gtester', 'gtester.c', -diff --git a/gobject/meson.build b/gobject/meson.build -index 98e306d7f..1bf0e005d 100644 ---- a/gobject/meson.build -+++ b/gobject/meson.build -@@ -68,8 +68,9 @@ libgobject = library('gobject-2.0', - soversion : soversion, - install : true, - include_directories : [configinc], -- dependencies : [libintl, libffi_dep, libglib_dep], -- c_args : ['-DG_LOG_DOMAIN="GLib-GObject"', '-DGOBJECT_COMPILATION'] + glib_hidden_visibility_args) -+ dependencies : [libffi_dep, libglib_dep], -+ c_args : ['-DG_LOG_DOMAIN="GLib-GObject"', '-DGOBJECT_COMPILATION'] + glib_hidden_visibility_args, -+) - - pkg.generate(libraries : libgobject, - requires : ['glib-2.0'], --- -2.17.0 - - -From a40fc3d549736d35d2af354e16f50ef85aee0304 Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Wed, 16 May 2018 14:38:20 +0530 -Subject: [PATCH 20/24] Revert "build: meson: add warning flags" - -This reverts commit 9d24c8b223ec4253e3c6a2e14001de61fa993dbb. - -Breaks build with clang on macOS ---- - meson.build | 21 --------------------- - 1 file changed, 21 deletions(-) - -diff --git a/meson.build b/meson.build -index 1fc8f339d..4c2daede2 100644 ---- a/meson.build -+++ b/meson.build -@@ -281,27 +281,6 @@ foreach m : struct_members - endif - endforeach - --# Compiler flags --if cc.get_id() == 'gcc' or cc.get_id() == 'clang' -- test_c_args = [ -- '-Wall', -- '-Wduplicated-branches', -- '-Wstrict-prototypes', -- '-Werror=declaration-after-statement', -- '-Werror=format=2', -- '-Werror=format-security', -- '-Werror=implicit-function-declaration', -- '-Werror=init-self', -- '-Werror=missing-include-dirs', -- '-Werror=missing-prototypes', -- '-Werror=pointer-arith', -- ] --else -- test_c_args = [] --endif -- --add_project_arguments(cc.get_supported_arguments(test_c_args), language: 'c') -- - # Windows Support (Vista+) - if host_system == 'windows' - glib_conf.set('_WIN32_WINNT', '0x0601') --- -2.17.0 - - -From 6e522714ba2f08fd3705d6cb5302f5e6d56c4868 Mon Sep 17 00:00:00 2001 -From: Philip Withnall <withnall@endlessm.com> -Date: Wed, 16 May 2018 12:16:17 +0100 -Subject: [PATCH 21/24] build: Fix test for G_ATOMIC_LOCK_FREE in meson.build - -Commit 3e96523e6b did not entirely fix the test, as the compiled test -code did not have a main() function, so failed to link with: - - /usr/lib/gcc/x86_64-redhat-linux/7/../../../../lib64/crt1.o: In function `_start': -(.text+0x20): undefined reference to `main' -collect2: error: ld returned 1 exit status - -This caused an invalid mixtures of builtin and non-builtin atomics/locks -to be used, which caused deadlocks in a number of tests. - -Fix the atomic ops test in meson.build, and the unit tests all start -working again. - -Signed-off-by: Philip Withnall <withnall@endlessm.com> - -https://bugzilla.gnome.org/show_bug.cgi?id=796164 ---- - meson.build | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 4c2daede2..608d2c426 100644 ---- a/meson.build -+++ b/meson.build -@@ -1369,9 +1369,10 @@ glibconfig_conf.set('G_ATOMIC_OP_MEMORY_BARRIER_NEEDED', glib_memory_barrier_nee - # to abort and advise the user to fix their CFLAGS. It's better to do - # that then to silently fall back on emulated atomic ops just because - # the user had the wrong build environment. --atomictest = '''void func() { -+atomictest = '''int main() { - volatile int atomic = 2; - __sync_bool_compare_and_swap (&atomic, 2, 3); -+ return 0; - } - ''' - if cc.get_id() == 'msvc' or cc.links(atomictest, name : 'atomic ops') --- -2.17.0 - - -From 979a5635a5fa2cd4066230d81e226a8dccc4df4c Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Wed, 16 May 2018 14:26:11 +0530 -Subject: [PATCH 22/24] meson: Fix error message for iconv detection - ---- - meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/meson.build b/meson.build -index 608d2c426..11ae73919 100644 ---- a/meson.build -+++ b/meson.build -@@ -1496,7 +1496,7 @@ else - endif - - if not found_iconv -- error('No iconv() implementation found in C library or libiconv') -+ error('iconv implementation "@0@" not found'.format(iconv_opt)) - endif - - endif --- -2.17.0 - - -From 8ce9fd057fe865115c46ee27bdc239989ffc274e Mon Sep 17 00:00:00 2001 -From: Nirbheek Chauhan <nirbheek@centricular.com> -Date: Sun, 6 May 2018 15:29:09 +0530 -Subject: [PATCH 23/24] gwin32: Fix detection of MinGW32 vs MinGW-w64 - -__MINGW32__ is defined on all MinGW variants including MinGW-w64. -__MINGW64_VERSION_MAJOR is only defined on MinGW-w64. - -This difference is important because on MinGW-w64 we must #include -winternl.h because including ntdef.h results in compiler errors -about symbol redefinition, and the header warns that it is deprecated -and may be removed in the future. - -https://bugzilla.gnome.org/show_bug.cgi?id=795849 ---- - glib/gwin32.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/glib/gwin32.c b/glib/gwin32.c -index cc6da5f99..a176514b1 100644 ---- a/glib/gwin32.c -+++ b/glib/gwin32.c -@@ -59,8 +59,8 @@ - #ifdef _MSC_VER - #pragma comment (lib, "ntoskrnl.lib") - #endif --#elif defined (__MINGW32__) --/* mingw-w64, not MinGW, has winternl.h */ -+#elif defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR) -+/* mingw-w64 must use winternl.h, but not MinGW */ - #include <ntdef.h> - #else - #include <winternl.h> --- -2.17.0 - - -From 66c34c6ec2dcf60dab876659e0019b3f153fa1ea Mon Sep 17 00:00:00 2001 -From: Xavier Claessens <xavier.claessens@collabora.com> -Date: Fri, 20 Apr 2018 12:10:18 -0400 -Subject: [PATCH 24/24] Tests: gsubprocess: Do not use stdin/stdout variables - -https://bugzilla.gnome.org/show_bug.cgi?id=795406 ---- - gio/tests/gsubprocess.c | 54 ++++++++++++++++++++--------------------- - 1 file changed, 27 insertions(+), 27 deletions(-) - -diff --git a/gio/tests/gsubprocess.c b/gio/tests/gsubprocess.c -index ad65a1df7..ac7051d6d 100644 ---- a/gio/tests/gsubprocess.c -+++ b/gio/tests/gsubprocess.c -@@ -333,7 +333,7 @@ test_echo1 (void) - GError **error = &local_error; - GSubprocess *proc; - GPtrArray *args; -- GInputStream *stdout; -+ GInputStream *stdout_stream; - gchar *result; - - args = get_test_subprocess_args ("echo", "hello", "world!", NULL); -@@ -341,9 +341,9 @@ test_echo1 (void) - g_ptr_array_free (args, TRUE); - g_assert_no_error (local_error); - -- stdout = g_subprocess_get_stdout_pipe (proc); -+ stdout_stream = g_subprocess_get_stdout_pipe (proc); - -- result = splice_to_string (stdout, error); -+ result = splice_to_string (stdout_stream, error); - g_assert_no_error (local_error); - - g_assert_cmpstr (result, ==, "hello" LINEEND "world!" LINEEND); -@@ -360,7 +360,7 @@ test_echo_merged (void) - GError **error = &local_error; - GSubprocess *proc; - GPtrArray *args; -- GInputStream *stdout; -+ GInputStream *stdout_stream; - gchar *result; - - args = get_test_subprocess_args ("echo-stdout-and-stderr", "merge", "this", NULL); -@@ -370,8 +370,8 @@ test_echo_merged (void) - g_ptr_array_free (args, TRUE); - g_assert_no_error (local_error); - -- stdout = g_subprocess_get_stdout_pipe (proc); -- result = splice_to_string (stdout, error); -+ stdout_stream = g_subprocess_get_stdout_pipe (proc); -+ result = splice_to_string (stdout_stream, error); - g_assert_no_error (local_error); - - g_assert_cmpstr (result, ==, "merge\nmerge\nthis\nthis\n"); -@@ -1087,7 +1087,7 @@ test_env (void) - GSubprocessLauncher *launcher; - GSubprocess *proc; - GPtrArray *args; -- GInputStream *stdout; -+ GInputStream *stdout_stream; - gchar *result; - gchar *envp[] = { "ONE=1", "TWO=1", "THREE=3", "FOUR=1", NULL }; - gchar **split; -@@ -1106,9 +1106,9 @@ test_env (void) - g_ptr_array_free (args, TRUE); - g_assert_no_error (local_error); - -- stdout = g_subprocess_get_stdout_pipe (proc); -+ stdout_stream = g_subprocess_get_stdout_pipe (proc); - -- result = splice_to_string (stdout, error); -+ result = splice_to_string (stdout_stream, error); - split = g_strsplit (result, "\n", -1); - g_assert_cmpstr (g_environ_getenv (split, "ONE"), ==, "1"); - g_assert_cmpstr (g_environ_getenv (split, "TWO"), ==, "2"); -@@ -1131,7 +1131,7 @@ test_env_inherit (void) - GSubprocessLauncher *launcher; - GSubprocess *proc; - GPtrArray *args; -- GInputStream *stdout; -+ GInputStream *stdout_stream; - gchar *result; - gchar **split; - -@@ -1153,9 +1153,9 @@ test_env_inherit (void) - g_ptr_array_free (args, TRUE); - g_assert_no_error (local_error); - -- stdout = g_subprocess_get_stdout_pipe (proc); -+ stdout_stream = g_subprocess_get_stdout_pipe (proc); - -- result = splice_to_string (stdout, error); -+ result = splice_to_string (stdout_stream, error); - split = g_strsplit (result, "\n", -1); - g_assert_null (g_environ_getenv (split, "TEST_ENV_INHERIT1")); - g_assert_cmpstr (g_environ_getenv (split, "TEST_ENV_INHERIT2"), ==, "2"); -@@ -1175,7 +1175,7 @@ test_cwd (void) - GSubprocessLauncher *launcher; - GSubprocess *proc; - GPtrArray *args; -- GInputStream *stdout; -+ GInputStream *stdout_stream; - gchar *result; - const char *basename; - -@@ -1188,9 +1188,9 @@ test_cwd (void) - g_ptr_array_free (args, TRUE); - g_assert_no_error (local_error); - -- stdout = g_subprocess_get_stdout_pipe (proc); -+ stdout_stream = g_subprocess_get_stdout_pipe (proc); - -- result = splice_to_string (stdout, error); -+ result = splice_to_string (stdout_stream, error); - - basename = g_strrstr (result, "/"); - g_assert (basename != NULL); -@@ -1211,7 +1211,7 @@ test_stdout_file (void) - GPtrArray *args; - GFile *tmpfile; - GFileIOStream *iostream; -- GOutputStream *stdin; -+ GOutputStream *stdin_stream; - const char *test_data = "this is some test data\n"; - char *tmp_contents; - char *tmp_file_path; -@@ -1229,12 +1229,12 @@ test_stdout_file (void) - g_ptr_array_free (args, TRUE); - g_assert_no_error (local_error); - -- stdin = g_subprocess_get_stdin_pipe (proc); -+ stdin_stream = g_subprocess_get_stdin_pipe (proc); - -- g_output_stream_write_all (stdin, test_data, strlen (test_data), NULL, NULL, error); -+ g_output_stream_write_all (stdin_stream, test_data, strlen (test_data), NULL, NULL, error); - g_assert_no_error (local_error); - -- g_output_stream_close (stdin, NULL, error); -+ g_output_stream_close (stdin_stream, NULL, error); - g_assert_no_error (local_error); - - g_subprocess_wait_check (proc, NULL, error); -@@ -1264,7 +1264,7 @@ test_stdout_fd (void) - GFile *tmpfile; - GFileIOStream *iostream; - GFileDescriptorBased *descriptor_stream; -- GOutputStream *stdin; -+ GOutputStream *stdin_stream; - const char *test_data = "this is some test data\n"; - char *tmp_contents; - -@@ -1281,12 +1281,12 @@ test_stdout_fd (void) - - g_clear_object (&iostream); - -- stdin = g_subprocess_get_stdin_pipe (proc); -+ stdin_stream = g_subprocess_get_stdin_pipe (proc); - -- g_output_stream_write_all (stdin, test_data, strlen (test_data), NULL, NULL, error); -+ g_output_stream_write_all (stdin_stream, test_data, strlen (test_data), NULL, NULL, error); - g_assert_no_error (local_error); - -- g_output_stream_close (stdin, NULL, error); -+ g_output_stream_close (stdin_stream, NULL, error); - g_assert_no_error (local_error); - - g_subprocess_wait_check (proc, NULL, error); -@@ -1320,7 +1320,7 @@ test_child_setup (void) - GPtrArray *args; - GFile *tmpfile; - GFileIOStream *iostream; -- GOutputStream *stdin; -+ GOutputStream *stdin_stream; - const char *test_data = "this is some test data\n"; - char *tmp_contents; - int fd; -@@ -1339,12 +1339,12 @@ test_child_setup (void) - - g_clear_object (&iostream); - -- stdin = g_subprocess_get_stdin_pipe (proc); -+ stdin_stream = g_subprocess_get_stdin_pipe (proc); - -- g_output_stream_write_all (stdin, test_data, strlen (test_data), NULL, NULL, error); -+ g_output_stream_write_all (stdin_stream, test_data, strlen (test_data), NULL, NULL, error); - g_assert_no_error (local_error); - -- g_output_stream_close (stdin, NULL, error); -+ g_output_stream_close (stdin_stream, NULL, error); - g_assert_no_error (local_error); - - g_subprocess_wait_check (proc, NULL, error); --- -2.17.0 - |