From f7541bb70ca4f11b7fbfb762c119d50b707b1af9 Mon Sep 17 00:00:00 2001 From: wiz Date: Thu, 14 Nov 2019 11:40:30 +0000 Subject: [PATCH] glib2: update to 2.62.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Overview of changes in GLib 2.62.1 ================================== * Fix regression in g_file_copy() when passing `G_FILE_COPY_TARGET_DEFAULT_PERMS` flag; the destination permissions would be private rather than following the process’ umask (!1142) * Several `GDateTime` parsing fixes (!1127) * Always build the tests if installed-tests are enabled, so that the tests can actually be installed (!1141) * Bugs fixed: - #174 g_file_copy always preserves permissions, even if G_FILE_COPY_ALL_METADATA flag is not set - #1865 g_variant_get_data_as_bytes fails after serializing a variant - #1875 Segfault and Overflow in __gio_xdg_cache_mime_type_subclass() with Wps-Office installed - #1887 glib 2.62.0 breaks loading dylibs as modules - #1888 2.62: docs build on Windows broken - !1021 docs: Remove priv pointers from the tutorial example - !1094 Backport to 2.62: gmodule: use dl implementation on macOS - !1101 Backport !1092 “Fix doc build on Windows” to glib-2-62 - !1102 Backport !1080 “tests: Fix skipping mkdir-with-parents-permission test” to glib-2-62 - !1103 Backport !1085 “xdgmime: Prevent infinite loops from badly-formed MIME registrations” to glib-2-62 - !1127 Backport !1125 and !1115 GDateTime parsing fixes to glib-2-62 - !1128 Backport !1043 “gvariant: Handle empty serialisations in get_child_value()” to glib-2-62 - !1140 [2.62] g_file_info_get_modification_date_time: Calculate in integer domain - !1141 [2.62] Always build tests if we enabled installed-tests - !1142 Backport !1134 Fix for file copy permissions to glib-2-62 * Translation updates: - Danish - Italian - Panjabi - Serbian - Turkish Overview of changes in GLib 2.62.0 ================================== * Fix new `GFileInfo` APIs to work when `G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC` was not queried (!1087) * Bugs fixed: - #487 Add valgrind test runs to CI - !1084 garray: Fix reference to GLIB_SIZEOF_INT - !1086 glib.supp: make gobject_init() calloc also of the possible kind - !1087 fileinfo: ignore USEC if not available * Translation updates: - Friulian - Portuguese (Brazil) Overview of changes in GLib 2.61.3 ================================== * Support setting thread name on BSD systems (#1761) * Install previously-uninstalled headers for public `GNativeSocketAddress` object (#1854) * Very initial support for Windows apps (UWP) (!1057) * Add various new valgrind suppressions to `glib.supp` (#1879, !1075) * Bugs fixed: - #83 Optimisation for g_nearest_pow() in garray.c - #512 GSignal: accumulator function not called to accumulate G_SIGNAL_RUN_CLEANUP object handler return values - #873 allow NULL arguments to parse_strv - #905 Patches from static analysis run on 2.40 - #1057 goption: add sanity check to input parameters - #1309 GSettings object stops emitting "changed" signal on g_settings_reset after call to g_settings_delay - #1620 GDBus criticals from GVfs with GLib master - #1761 Setting thread-name on BSD systems - #1803 GDK_SCALE=X is not respected when using "gio open" - #1819 Invalid characters in Open Location dialog crashes GIMP - #1852 Regression: g_mkdir_with_parents() returns 0 on failure - #1854 glib/gio: GNativeSocketAddress headers not installed. - #1860 g_clear_handle_id does not trigger GLIB_VERSION_MAX_ALLOWED warning - #1863 Potential invalid writes on g_utf8_strreverse - #1867 A couple of en_GBisms - #1870 GSettingsBackend watches not thread-safe - #1879 Incomplete valgrind suppressions - 16 KiB leak reported by valgrind from loading libglib-2.0.so - #1880 glib/gbacktrace.c: If dup2 happened to return -1, don't call dup2 with same value - #1881 GIO_USE_VOLUME_MONITOR and GIO_USE_FILE_MONITOR do not work as documented - !1002 Remove mentions of mailing lists from the documentation - !1011 gapplication: Fix a leaking GRemoteActionGroup member - !1015 Post-release version bump - !1016 gnetworkmonitornm fixups - !1017 Improve ISO 8601 parsing by GDateTime - !1023 g_object_get_property: Improve documentation for use of G_VALUE_INIT - !1026 gutf8: Assert that written memory stays in bounds - !1027 gfileutils: Fix error propagation for other than ENOENT - !1031 meson: build gnulib if printf isn't good enough - !1032 meson: small printf check cleanups - !1033 win32: don't assume the format specifier for the stdlib printf/scanf like functions - !1034 glib/tests/fileutils: Add a reproducer for #1852 - !1036 cond test: Don't make assumptions about struct sigaction member order - !1037 Meson: Override glib-compile-resources/schemas - !1044 Relax use of g_test_bug() to not require g_test_bug_base() to be called first - !1049 minor typos in the documentation - !1050 tests: Fix a pragma warning on FreeBSD - !1054 gerror: Add a docs paragraph about not displaying errors verbatim in UI - !1057 Some (probably) easy uwp patches - !1059 Update win32 readme, add myself to codeowners - !1066 libffi.wrap: Meson port has moved to FDO gitlab - !1068 gsubprocesslauncher.c: fix documentation - !1071 meson: Move libdl_dep to the top level - !1074 Adjust README formatting - !1075 glib.supp: add suppression for g_type_class_ref() * Translation updates: - Basque - Catalan - Czech - English (United Kingdom) - French - Galician - German - Hungarian - Indonesian - Korean - Lithuanian - Polish - Romanian - Spanish - Swedish Overview of changes in GLib 2.61.2 ================================== * Add various new array functions (#236, #269, #373) - `g_array_copy()` - `g_ptr_array_copy()` - `g_ptr_array_extend()` - `g_ptr_array_extend_and_steal()` - `g_array_binary_search()` * Add `g_assert_finalize_object()` helper function for writing tests (#488) * Rework how D-Bus connections are closed/unreffed when `g_test_dbus_down()` is called. Tests which leak a `GDBusConnection` may now time out and abort, rather than silently leaking. (#787) * Add a deprecation macro for GLib macros, and use it; third-party uses of long-deprecated GLib macros may now start causing warnings. (#1060) * Deprecate `GTime` and `GTimeVal`, and various functions which use them. Use `GDateTime` and `guint64` UNIX timestamps instead. (#1438) * Stop using `G_DISABLE_DEPRECATED` to allow disabling deprecation warnings; third-party code should now be using `GLIB_VERSION_{MIN_REQUIRED, MAX_ALLOWED}` to control symbol usage (!871) * Improve support for running `ninja test` when GLib is built statically (#1648) * Improve `GNetworkMonitor` detection of offline states (#1788) * Fix build failure on macOS related to missing `_g_content_type_get_mime_dirs` function (#1791) * Add various installed utilities’ paths to `gio-2.0.pc` (#1796) * Fix keyfile `GSettings` backend and portal (especially relevant to any version of GLib included in a flatpak runtime) (#1822, !985) * More IPv6 ‘Happy Eyeballs’ fixes in `GNetworkAddress` (!865) * Fix CVE-2019-12450, wide permissions of files when copying using GIO (!876) * Bump the Meson dependency from 0.48.0 to 0.49.2; we won’t depend on anything higher than this for a while, as Debian 10 ships 0.49 (!924) * Various test fixes for Windows (!930, !931) * Initial support for Universal Windows Platform (UWP): certification, and use of packaged libraries (!951) * Add experimental clang-cl support on Windows, allowing `g_autoptr()` support on Windows (!979) * Bugs fixed: - #77 G_STDIO_NO_WRAP_ON_UNIX wraps - #236 Add a function to copy an array - #269 Additional convenience functions for g_ptr_array - #373 GArray could use a binary search function - #436 running tests leaves lots of coredumps - #453 find-enclosing-mount docs confusing - #488 Add g_object_assert_last_unref() helper macro to detect object leaks in tests - #590 A reader lock can be obtained even if a writer is already waiting for a lock - #638 g_atexit is defined when not declared - #737 Initialize GValue in g_object_get_property() - #787 gtestdbus: Properly close server connections - #804 gdbusproxy prefixes unstripped error - #870 Fix and enhance GDatetime for Windows - #872 ucs4 functions have wrong return transfer - #887 gdusmessage.c mishandles bounds of GDBusMessageType and related enums - #894 gvalue: Avoid expensive checks where possible - #940 Docs for g_socket_listener_set_backlog are not very helpful - #943 G_DEFINE_TYPE_WITH_PRIVATE docs not helpful - #1018 Allow guid key in dbus addresses - #1060 Add deprecation macro for macros - #1169 Tools can display gibberish messages from translations - #1270 g_get_charset always returns 8-bit codepage on Windows, crippling UTF-8 output - #1438 Deprecate GTimeVal- and GTime-based APIs - #1635 g_socket_join_multicast_group iface parameter fails on win32/64 - #1648 2.58.2: Assorted asserts fail in Arch Linux when built statically - #1729 g_content_type_guess segfaults when passed an empty data buffer on Mac OS - #1788 GNetworkMonitor claims I am offline - #1790 documentation on g_file_info_get_attribute_as_string - #1791 _g_content_type_get_mime_dirs missing from libgio-2.0.0.dylib on MacOS - #1792 glib-genmarshal generated valist marshal does not respect static scope for some types - #1793 glib-genmarshal generates wrong code for va marshaler for VARIANT type - #1794 API Proposal: g_timer_is_active - #1796 Add gio-querymodules variable to pkg-config file - #1797 glib/tests/win32 test failing on 64-bit Visual Studio builds - #1798 /contenttype/tree reliably fails on FreeBSD since !863 - #1807 g_dbus_server_new_sync() documentation references nonexistent function - #1808 Stopping a GDBusServer should clean up Unix socket paths (if not abstract) and nonce-tcp nonce files - #1811 Introspection info for g_unichar_compose's 3rd arg should be OUT - #1822 keyfile gsettings backend not loading - #1823 Documentation for disabling selinux is incorrect - #1825 GKeyFileSettingsBackend created without filename construct property and unchecked assertion - #1828 Small typo in gio manpage - #1837 Specify for each (optional) parameter, whether it is OUT or INOUT - #1838 Reword documentation for G_DECLARE_FINAL_TYPE - #1847 Setting GLIB_VERSION_{MIN_REQUIRED, MAX_ALLOWED} to before 2.56 triggers warnings - !533 docs: Document pitfall of deprecation pragmas - !563 ci: Add scan-build job in a new ‘analysis’ pipeline stage - !678 glib-compile-schemas: Improve translatable strings - !817 gdate: Officially mark GTime as deprecated - !851 gsettings: Document that lists are returned in no defined order - !853 gobject: Fix apostrophe usage in a few small bits of documentation - !859 gobject: Add a g_assert_finalize_object() macro - !863 gunicollate/cygwin: Don't use __STDC_ISO_10646__ for wchar_t related checks - !865 gnetworkaddress: fix "happy eyeballs" logic - !867 Post-release version bump - !871 Drop G_DISABLE_DEPRECATED - !873 Use atomic reference counting for GSource - !874 Clamp number of vectors to IOV_MAX / UIO_MAXIOV for GOutputStream writev()... - !875 CI/msys2: disable coverage reporting, lcov doesn't support gcc9 yet - !876 CVE-2019-12450: gfile: Limit access to files when copying - !877 gio: specify proper c_marshaller and va_marshallers - !883 tests: Fix small race in GSubprocess tests - !884 garcbox.c: Fix typo atomit => atomic - !885 goption: Clarify G_OPTION_ARG_FILENAME documentation - !889 Include for FIONREAD - !901 gmain: Clarify that g_source_destroy() doesn’t drop a reference - !904 Add glib-genmarshal tests and fix some valist marshaller bugs - !906 property action: Add state hints - !908 Improve testfilemonitor test repeatability and debuggability - !909 D-Bus auth mechanism improvements - !914 ci: Run scan-build in a different build directory - !915 docs: fix typo on arrays examples in gvariant-text - !917 docs: Fix name of IRC channel in CONTRIBUTING.md - !919 glib/tests/refcount.c: Fix tests on non-GCC-isque compilers - !920 gmacros: Only use deprecated attributes on enumerators with GCC ≥ 6.5 - !923 Check if compiler symbols are defined before using them - !924 Bump the required version of Meson - !930 glib/tests/convert.c: Skip tests that aren't meaningful for Windows - !931 glib/tests/fileutils.c: Fix stdio Wrapper Test on Windows - !934 build: Increase the slow test timeout to 180s - !935 Ignore */__pycache__/* directories - !937 Fix module tests on Visual Studio builds - !939 gstdio: minor cleanups - !941 list model: Expand items-changed docs - !944 gutils: Don't limit the length of the host name to 99 - !945 Avoid overrunning stack at the end of the varargs. - !947 gobject/tests/signals.c: Fix tests on Windows - !948 GObject: Fix mkenums.py and genmarshal.py tests on Windows - !950 ci: Enable CI on FreeBSD 12 - !951 Preliminary patches for Universal Windows Platform support - !952 gio: Make minor docs improvements - !953 g_utf8_normalize: Doc comment return missing nullable annotation - !954 Fix the ISO 15924 code for Manichaean - !955 gmacros: Use _Static_assert when C11 is available - !958 gthread: fix minor errno problem in GCond - !961 gmain: Fix g_main_context_prepare priority annotation - !962 gmacros: Use _Static_assert only for non-expr static assert - !964 gmacros.h: Use static_assert on MSVC if possible - !968 Fix typo in request handle - !970 gdatetime: Unset LC_ALL for the test as well - !971 docs.c: Forward link from g_auto* → G_DEFINE_AUTO* - !973 doc: fix typo in gio/gresource.c - !979 Experimental clang-cl support - !980 gmacros.h: Add better support for clang-cl - !981 gio: fix typo in g_settings_reset documentation - !982 Various doc fixes - !985 Keyfile portal fixes - !987 gio/tests: Remove code and comments referring to libtool - !991 fix atomic detection on older gcc versions - !992 docs: Add example to g_test_summary() documentation - !994 gio: Fix minor docs mistakes - !996 Small array test fixes - !997 gdbusaddress: Add missing transfer annotation - !1007 Resubmission of !832 “Try to create the complete path right away and fall back” - !1009 gapplication: remove inactivity_timeout source on finalize * Translation updates: - Hungarian - Indonesian - Portuguese (Brazil) - Spanish Overview of changes in GLib 2.61.1 ================================== * `g_unichar_isxdigit()` and `g_unichar_xdigit_value()` now handle full-width characters (U+FF21–U+FF26 and U+FF41–U+FF46) (#58) * Deprecate `gtester` utility and its test reporting format and enable TAP output by default instead — the `--tap` option to tests is now a no-op (#1441, #1619) * Add `g_test_summary()` to allow test authors to programmatically summarise what each unit test in a test suite does (#1450) * Upgrade to Unicode Character Database v12.1 (#1713, !822) * More IPv6 Happy Eyeballs fixes to `GNetworkAddress` and `GSocketClient` (#1747, #1771, #1774) * Fix valgrind and gdb support for the new `GHashTable` changes (#1749, #1780) * Fix GTask wait times growing faster than the number of task threads (#1683) * Change `GApplication` to ignore `-psn_*` arguments on the macOS command line, as they are irrelevant (#1784) * Add `g_autoqueue()` helper macros, similar to `g_autolist()` (!474) * Add pre-allocated link helpers for `GList` and `GQueue`: - `g_list_insert_before_link()` - `g_queue_insert_before_link()` - `g_queue_insert_after_link()` * Improve network availability detection with NetworkManager to treat lower levels of connectivity as having reduced availability (!781) * Add `g_clear_signal_handler()` to allow disconnecting from a `GObject` signal and clearing the signal handler ID to zero in a single call (!819) * Add `g_autoptr()` support for `GRWLock` (!825) * Define `G_OS_UNIX`, not `G_OS_WIN32`, when GLib is built agains Cygwin (!862) * Bugs fixed: - #29 GScanner: should explicitly document modifiable fields (value, next_value, ...) - #58 g_unichar_isxdigit() and g_unichar_xdigit_value() should deal with full-width a-fA-F - #106 Boxed types should be documented better - #135 g_unichar_totitle(0) returns 0x00001F88 instead of 0 - #429 g_format_size() is broken on Windows - #1441 Deprecate gtester - #1450 Add API for tests to describe what they're checking - #1619 GTest should have a way to default to TAP - #1683 GTask: task_wait_time is increased constantly when the number of running thread is greather than 10 - #1713 Upgrade to Unicode Character Database v12 - #1739 meson build failure libdl - #1747 Critical in g_socket_client_async_connect_complete - #1749 New GHashTable implementation confuses valgrind - #1753 Remove memory leaks from gio/test/resolver.c - #1755 Please revert #535 gmacros: Try to use the standard __func__ first in G_STRFUNC - #1759 test_month_names: assertion failed - #1760 Document for g_resolver_lookup_records why it returns a list of list of gchar*. - #1763 tests: -p runs tests in the reverse of the specified order - #1768 g_strlcat(): Possible buffer overflow in implementation - #1771 GNetworkAddressAddressEnumerator unsafely modifies cache in GNetworkAddress - #1774 Leaks in gsocketclient.c connection code - #1776 glib/date test fails - #1780 GDB pretty-printer for GHashTable no longer works - #1782 Error in documentation for cross-compile. - #1784 MacOS adds a -psn_X_XXXXXX parameter to the command line - !474 Add g_autoqueue - !476 Add pre-allocated link helpers for GList and GQueue - !556 gtestutils: Make --tap compatible with -p and --GTestSkipCount - !732 gsocket: Clarify in docs that `flags` arguments can be platform specific - !766 W32: swap special g_get_prgname() for platform_get_argv0() - !774 Only build tests if certain conditions are met. - !780 Add copyright and licensing terms to test report generator - !781 gnetworkmonitornm: Fix network available detection - !782 build: Fix check for RTLD_NEXT - !785 Remove monitor test - !787 build: Remove */.gitignore files - !791 glib/gconstructor.h: Include stdlib.h for MSVC builds - !792 general: Remove a few unhelpful references to ‘master’ - !795 gdesktopappinfo: Add support for MATE and Xfce4 terminals - !802 gio: tests, don't check for libdl on OpenBSD - !806 Get to 100% coverage on GQueue tests - !808 Update the Docker images used for CI - !809 Modified version of !784 — Adding tests cases for a better coverage of glib/tests/strfuncs.c - !813 gappinfo: Add precondition checks to GAppLaunchContext env methods - !814 gschema.dtd: Add target attribute to alias - !819 Clear signal handler - !820 ci: Keep JUnit report script working on Debian stable - !821 Various minor cleanups to autoptrs - !822 glib: Update Unicode Character Database to version 12.1.0 - !825 Add autoptr support for GRWLock - !831 build: (Long time after) post-release version bump - !835 Fix typo in German translation - !836 Document the best practices for binding GInitiallyUnowned - !862 build: define G_OS_UNIX, not G_OS_WIN32 under cygwin * Translation updates: - Basque - Catalan - German - Indonesian - Spanish Overview of changes in GLib 2.61.0 ================================== * Changes to `iconv` configure options, including the default iconv implementation on macOS — distributors may need to check their configure scripts (#1557) * Build fixes when building GLib with `G_DISABLE_ASSERT` defined (#1708) * Fix documentation for `gdbus-tool wait` to use correct units (#1737) * Improvements to symlink handling on Windows (!269) * Add exception handling for crashes on Windows (!582) * Set `G_WITH_CYGWIN` again when GLib is built on Cygwin (this was a regression from the autotools build) (!736) * Use `GCocoaNotificationBackend` by default on macOS, rather than `GGtkNotificationBackend` (!745) * Use Windows symbol visibility when GLib is built on Cygwin, as PE binaries are subject to W32 visibility mechanics — this affects the definition of `_GLIB_EXTERN` (!752) * Add coloured output support to `gdbus introspect` (!761) * Bugs fixed: - #682 docs: advise not to use non-literal strings as qdata keys - #1177 gparted crashes due to g_quark_from_static_string used in global initialization - #1258 the buffer written to by g_input_stream_read is not marked as an out parameter - #1557 By default glib tries to use libc instead of native iconv on OSX - #1566 Meld Windows shows error on startup "There was a problem starting c:\Program" - #1614 GIO tests fail on FreeBSD CI with: Unexpected error from C library during 'pthread_mutex_lock': Invalid argument - #1708 Building GLib with G_DISABLE_ASSERT fails - #1709 GResource generation test incompatible with stable LLVM on Linux - #1710 Crash in g_cancellable_cancel - #1712 gdbus-proxy test is flaky - #1724 unconditional check in fuzzing/meson.build - #1725 gosxappinfo.h is not installed on macOS - #1727 Cannot use trash folder with an NFS mount using automount / autofs - #1728 GSocket does not support ENOTSOCK - #1732 Win32: lookup_by_name_async segfaults for not available domains - #1737 gdbus-tool wait command timeout argument incorrect unit reference - !67 glib: update internal gnulib from upstream - !269 Win32 symlink code refactoring - !493 tests: Check that cancelling g_file_replace don't overwrite existing file - !582 Basic W32 exception handling for glib - !680 Fix warnings glib - !690 Fix thread safety issues - !694 gvariant-parser: Fix pattern coalesce of M and * - !706 Fix data races in task test and gmenumodel test - !709 Bump release version for 2.62 series - !710 socket: Fix annotation for flags in g_socket_receive_message - !712 gwin32: Fix comment for g_win32_veh_handler - !716 Various minor documentation fixes - !717 Improve formatting of GCC attribute documentation - !718 GSocketClient - Free last error if a connection attempt fails and on retry the... - !719 Handle an UNKNOWN NetworkManager connectivity as NONE - !721 codegen: Fix use of uninitialised variable - !723 Provide examples for GNUC attribute macros - !724 meson: do a build-time check for strlcpy before attempting runtime check - !728 gsocket: Remove (type) annotation from flags arguments - !730 Improve gdbus-address parsing tests - !735 docs: Use the right g_autoptr function when using an auxiliary function - !736 Set G_WITH_CYGWIN again - !737 gresolver: Don’t use gai_strerror() on Windows, as it isn’t threadsafe - !741 Fix use-after-free triggered by gnome-session-binary - !745 gcocoanotificationbackend: give more priority than the gtk one - !749 gio: Add missing autocleanup definition for GSettingsSchema{Key,Source} - !750 Check for RTLD_NEXT - !752 Use W32 visibility for Cygwin - !754 Check for /proc/self/cmdline - !757 Fix gnulib build on older Visual Studio builds - !760 Properly ensure the cocoa notification backend type - !761 RFC: gdbus-tool: Add --color option for introspect - !762 gutils: Add (nullable) annotation to g_get_prgname() - !765 gslice: Use a convenience macro - !769 ci: Generate a cover report for the test suite - !772 tests: Check that option-argv0 test succeeds on Linux - !776 tests: Only run --external-data test on GNU ld/objcopy - !779 Fix 2.62 documentation symbols * Translation updates: - Dutch --- devel/glib2/Makefile | 4 +- devel/glib2/Makefile.common | 4 +- devel/glib2/PLIST | 17 +- devel/glib2/distinfo | 25 +- .../patch-gio_gdbus-2.0_codegen_meson.build | 24 +- .../patch-gio_inotify_inotify-kernel.c | 12 +- devel/glib2/patches/patch-gio_meson.build | 12 +- devel/glib2/patches/patch-glib_ghash.c | 873 ------------------ devel/glib2/patches/patch-glib_meson.build | 16 +- devel/glib2/patches/patch-gobject_meson.build | 7 +- devel/glib2/patches/patch-meson.build | 80 +- devel/glib2/patches/patch-meson_options.txt | 13 +- 12 files changed, 71 insertions(+), 1016 deletions(-) delete mode 100644 devel/glib2/patches/patch-glib_ghash.c diff --git a/devel/glib2/Makefile b/devel/glib2/Makefile index 21a9660e1d16..b5ec3d819c30 100644 --- a/devel/glib2/Makefile +++ b/devel/glib2/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.262 2019/10/29 09:22:24 adam Exp $ +# $NetBSD: Makefile,v 1.263 2019/11/14 11:40:30 wiz Exp $ .include "Makefile.common" @@ -11,6 +11,8 @@ MESON_ARGS+= -Dinstalled_tests=false # Avoid linux dependency on libmount-dev MESON_ARGS+= -Dlibmount=false +MAKE_ENV+= LD_LIBRARY_PATH=${WRKSRC}/output/gio:${WRKSRC}/output/glib:${WRKSRC}/output/gobject:${WRKSRC}/output/gmodule + LDFLAGS.SunOS+= -lintl -lnsl REPLACE_PYTHON+= gio/gio-querymodules-wrapper.py diff --git a/devel/glib2/Makefile.common b/devel/glib2/Makefile.common index 58a008f06c5c..81a8ba7f75ac 100644 --- a/devel/glib2/Makefile.common +++ b/devel/glib2/Makefile.common @@ -1,9 +1,9 @@ -# $NetBSD: Makefile.common,v 1.73 2019/10/29 09:22:24 adam Exp $ +# $NetBSD: Makefile.common,v 1.74 2019/11/14 11:40:30 wiz Exp $ # used by devel/gdbus-codegen/Makefile # used by devel/glib2/Makefile # used by devel/glib2-tools/Makefile -DISTNAME= glib-2.60.7 +DISTNAME= glib-2.62.1 PKGNAME= ${DISTNAME:S/glib/glib2/} MASTER_SITES= ${MASTER_SITE_GNOME:=sources/glib/${PKGVERSION_NOREV:R}/} EXTRACT_SUFX= .tar.xz diff --git a/devel/glib2/PLIST b/devel/glib2/PLIST index a91b6a6dad3d..a79b4ca986ac 100644 --- a/devel/glib2/PLIST +++ b/devel/glib2/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.107 2019/10/29 09:22:24 adam Exp $ +@comment $NetBSD: PLIST,v 1.108 2019/11/14 11:40:30 wiz Exp $ ${PLIST.nococoa}bin/gapplication bin/gdbus bin/gio @@ -107,6 +107,7 @@ include/glib-2.0/gio/gmenuexporter.h include/glib-2.0/gio/gmenumodel.h include/glib-2.0/gio/gmount.h include/glib-2.0/gio/gmountoperation.h +include/glib-2.0/gio/gnativesocketaddress.h include/glib-2.0/gio/gnativevolumemonitor.h include/glib-2.0/gio/gnetworkaddress.h include/glib-2.0/gio/gnetworking.h @@ -281,19 +282,19 @@ ${PLIST.fam}lib/gio/modules/libgiofam.so lib/glib-2.0/include/glibconfig.h lib/libgio-2.0.so lib/libgio-2.0.so.0 -lib/libgio-2.0.so.0.6000.7 +lib/libgio-2.0.so.0.6200.1 lib/libglib-2.0.so lib/libglib-2.0.so.0 -lib/libglib-2.0.so.0.6000.7 +lib/libglib-2.0.so.0.6200.1 lib/libgmodule-2.0.so lib/libgmodule-2.0.so.0 -lib/libgmodule-2.0.so.0.6000.7 +lib/libgmodule-2.0.so.0.6200.1 lib/libgobject-2.0.so lib/libgobject-2.0.so.0 -lib/libgobject-2.0.so.0.6000.7 +lib/libgobject-2.0.so.0.6200.1 lib/libgthread-2.0.so lib/libgthread-2.0.so.0 -lib/libgthread-2.0.so.0.6000.7 +lib/libgthread-2.0.so.0.6200.1 lib/pkgconfig/gio-2.0.pc lib/pkgconfig/gio-unix-2.0.pc lib/pkgconfig/glib-2.0.pc @@ -305,8 +306,8 @@ lib/pkgconfig/gthread-2.0.pc share/aclocal/glib-2.0.m4 share/aclocal/glib-gettext.m4 share/aclocal/gsettings.m4 -share/gdb/auto-load${LOCALBASE}/lib/libglib-2.0.so.0.6000.7-gdb.py -share/gdb/auto-load${LOCALBASE}/lib/libgobject-2.0.so.0.6000.7-gdb.py +share/gdb/auto-load${LOCALBASE}/lib/libglib-2.0.so.0.6200.1-gdb.py +share/gdb/auto-load${LOCALBASE}/lib/libgobject-2.0.so.0.6200.1-gdb.py share/gettext/its/gschema.its share/gettext/its/gschema.loc share/glib-2.0/gdb/glib_gdb.py diff --git a/devel/glib2/distinfo b/devel/glib2/distinfo index 85e288f2abd5..6a145dc9dc75 100644 --- a/devel/glib2/distinfo +++ b/devel/glib2/distinfo @@ -1,25 +1,24 @@ -$NetBSD: distinfo,v 1.255 2019/10/29 09:22:24 adam Exp $ +$NetBSD: distinfo,v 1.256 2019/11/14 11:40:30 wiz Exp $ -SHA1 (glib-2.60.7.tar.xz) = d0b21a9358ef03e9e90bcb8beb878cab21bec4f2 -RMD160 (glib-2.60.7.tar.xz) = 099608f6af4ce4a75fa24673b10f344829831be8 -SHA512 (glib-2.60.7.tar.xz) = d56d805a5abf6f7aeb8bf5be06b60ad049177ee23f78eacef4ce2ea88a8be49966a95e48fed17c752649f6e80937fd0ebc8f959709f623ec1f2f43ffd42d078a -Size (glib-2.60.7.tar.xz) = 4590568 bytes +SHA1 (glib-2.62.1.tar.xz) = d0e1991859b5b8053ef784aac15e9792cc2e7ff4 +RMD160 (glib-2.62.1.tar.xz) = 2a1d8f629eeecd646c04e035922161b308a85ec8 +SHA512 (glib-2.62.1.tar.xz) = 098e59d0da4cdd282156c2941c52127d33f1749802b23901efd6b760db99f6944b5cef445d76660a159ad4b912bc9d03dbf8c24b7f15b28e9770f37ca082a57c +Size (glib-2.62.1.tar.xz) = 4681716 bytes SHA1 (patch-gio_gcredentialsprivate.h) = dab92e07f8357a7dc1a569e37f65f9b199aee281 -SHA1 (patch-gio_gdbus-2.0_codegen_meson.build) = 21c806f1a9884000b6a1683bc2fd1276b3c3544f +SHA1 (patch-gio_gdbus-2.0_codegen_meson.build) = ec8ce89da08059ebf953d84a1dca5a2b380349f4 SHA1 (patch-gio_giomodule.c) = d704699b2f457a08fff9219fe697e5fd2cc582ed SHA1 (patch-gio_gresource-tool.c) = ad0e59f48f5f98ea66be568dbe2e5a5d1ac602fc SHA1 (patch-gio_gunixcredentialsmessage.c) = c13119ddd6262db7c03e53857e987f0c495d3312 SHA1 (patch-gio_gunixmounts.c) = 13af07fffe898457edd0d8db4296a60fccba913d -SHA1 (patch-gio_inotify_inotify-kernel.c) = 24deec33a1ad5e3c1a4f2d1397440d26b0f23b84 -SHA1 (patch-gio_meson.build) = 7eb21bd0a0af539f13459f2aeb5e32624ceb93f2 +SHA1 (patch-gio_inotify_inotify-kernel.c) = 78544b4c32ef3b44e8721b1c07407f46a9e8c8a4 +SHA1 (patch-gio_meson.build) = c2bda4943f8580706ec45760604ed1bdf63d1c6f SHA1 (patch-gio_tests_gdbus-export.c) = 59d85ca079d02b52e33153c7d2ac1cc48c26707a SHA1 (patch-glib_gatomic.c) = 875ad9c828dcf2add356d4988d14fb4f1985aef8 SHA1 (patch-glib_gatomic.h) = 21294cac483c3379198283c54fe6e24af3e630b1 -SHA1 (patch-glib_ghash.c) = 938135c3a71199e61d1cd1dffa6e1d63864150d6 SHA1 (patch-glib_glibconfig.h.in) = 1964b5fb15317e681dad426d4862e3f48c4274f7 SHA1 (patch-glib_gmain.c) = 2ab4b59e438d9f764bee62e0c1fa8bbd231b6e8d SHA1 (patch-glib_gtypes.h) = a659b770c55a8071a6e6afd8a9fccdf723e086e6 -SHA1 (patch-glib_meson.build) = 6cb2d8eb2d19ef1290df2adde5675b36bf037b22 +SHA1 (patch-glib_meson.build) = f7990bc0a37c0d14437c7bbd44b1e60dd1f8245e SHA1 (patch-glib_tests_hash.c) = e928b22926ad917a7a201882a5105b25533554ae SHA1 (patch-gmodule_gmodule-ar.c) = e382a0ada232e083d51cbede7f689a50ebeff4d8 SHA1 (patch-gmodule_gmodule-dl.c) = b678a04debbc79ebb67d91db7716990658e76da4 @@ -27,6 +26,6 @@ SHA1 (patch-gmodule_gmodule-dyld.c) = 5adf62970d9cff22d451307aaa0b00d975dab138 SHA1 (patch-gmodule_gmodule-win32.c) = 477a861f8590a62c3dbc0aa4ad728cc86ebb34dd SHA1 (patch-gmodule_gmodule.c) = 55c5f9d16e3517f3fdc04d40922f50d9c66b0b9a SHA1 (patch-gobject_glib-mkenums.in) = c177cf9b1ea81542665240678f47f68351a3760d -SHA1 (patch-gobject_meson.build) = 3cf17f5a60b2b15e62ad9287a6660e1c7e8af0d9 -SHA1 (patch-meson.build) = 7b734de6bcc2dd78d8b028ba107d15bf89a3ac36 -SHA1 (patch-meson_options.txt) = 23e215e44190a2e701b83e280ce235cf117e14ac +SHA1 (patch-gobject_meson.build) = 412b65558aa4cf9648ee84a57ad6dfcc988b1a1d +SHA1 (patch-meson.build) = 2f72a332c23063c8654d47af79593eb4cc6a8c4d +SHA1 (patch-meson_options.txt) = 7f633fbbfa9d9b2d958365891ffb9e4094d7dd54 diff --git a/devel/glib2/patches/patch-gio_gdbus-2.0_codegen_meson.build b/devel/glib2/patches/patch-gio_gdbus-2.0_codegen_meson.build index 87005f256f64..01e64fccef30 100644 --- a/devel/glib2/patches/patch-gio_gdbus-2.0_codegen_meson.build +++ b/devel/glib2/patches/patch-gio_gdbus-2.0_codegen_meson.build @@ -1,33 +1,29 @@ -$NetBSD: patch-gio_gdbus-2.0_codegen_meson.build,v 1.1 2019/06/03 09:53:50 prlw1 Exp $ +$NetBSD: patch-gio_gdbus-2.0_codegen_meson.build,v 1.2 2019/11/14 11:40:30 wiz Exp $ Leave gdbus-2.0/codegen sudirectory to devel/gdbus-codegen package. ---- gio/gdbus-2.0/codegen/meson.build.orig 2019-04-15 10:54:04.000000000 +0000 +--- gio/gdbus-2.0/codegen/meson.build.orig 2019-10-04 11:44:23.000000000 +0000 +++ gio/gdbus-2.0/codegen/meson.build -@@ -16,7 +16,7 @@ gdbus_codegen_conf.set('DATADIR', glib_d - # Install gdbus-codegen executable +@@ -17,6 +17,7 @@ gdbus_codegen_conf.set('DATADIR', glib_d gdbus_codegen = configure_file(input : 'gdbus-codegen.in', output : 'gdbus-codegen', -- install : true, -+ install : false, install_dir : get_option('bindir'), ++ install : false, configuration : gdbus_codegen_conf ) -@@ -28,7 +28,7 @@ codegen_dir = join_paths(get_option('dat - gdbus_codegen_built_files = [] + # Provide tools for others when we're a subproject and they use the Meson GNOME module +@@ -28,6 +29,7 @@ gdbus_codegen_built_files = [] gdbus_codegen_built_files += configure_file(input : 'config.py.in', output : 'config.py', -- install : true, -+ install : false, install_dir : codegen_dir, ++ install : false, configuration : gdbus_codegen_conf) -@@ -36,7 +36,7 @@ foreach f : gdbus_codegen_files - # Copy these into the builddir so that gdbus-codegen can be used uninstalled + foreach f : gdbus_codegen_files +@@ -35,5 +37,6 @@ foreach f : gdbus_codegen_files # and then install it too so that it can be used after installation gdbus_codegen_built_files += configure_file(input : f, output : f, -- install : true, -+ install : false, install_dir : codegen_dir, ++ install : false, copy : true) endforeach diff --git a/devel/glib2/patches/patch-gio_inotify_inotify-kernel.c b/devel/glib2/patches/patch-gio_inotify_inotify-kernel.c index 6ec2cbfb1273..b5857131b93f 100644 --- a/devel/glib2/patches/patch-gio_inotify_inotify-kernel.c +++ b/devel/glib2/patches/patch-gio_inotify_inotify-kernel.c @@ -1,16 +1,16 @@ -$NetBSD: patch-gio_inotify_inotify-kernel.c,v 1.4 2019/06/04 10:24:21 maya Exp $ +$NetBSD: patch-gio_inotify_inotify-kernel.c,v 1.5 2019/11/14 11:40:30 wiz Exp $ Use _XOPEN_NAME_MAX in lieu of NAME_MAX for SunOS. Include for FIONREAD on SunOS. https://gitlab.gnome.org/GNOME/glib/merge_requests/889 ---- gio/inotify/inotify-kernel.c.orig 2016-02-23 22:25:36.000000000 +0000 +--- gio/inotify/inotify-kernel.c.orig 2019-10-04 11:44:23.000000000 +0000 +++ gio/inotify/inotify-kernel.c -@@ -30,11 +30,17 @@ - #include - #include "inotify-kernel.h" - #include +@@ -33,11 +33,17 @@ + #ifdef HAVE_SYS_FILIO_H + #include + #endif +#ifdef HAVE_SYS_FILIO_H +#include +#endif diff --git a/devel/glib2/patches/patch-gio_meson.build b/devel/glib2/patches/patch-gio_meson.build index 18badd3f59f6..e3887055f7fc 100644 --- a/devel/glib2/patches/patch-gio_meson.build +++ b/devel/glib2/patches/patch-gio_meson.build @@ -1,11 +1,10 @@ -$NetBSD: patch-gio_meson.build,v 1.6 2019/10/29 09:22:24 adam Exp $ +$NetBSD: patch-gio_meson.build,v 1.7 2019/11/14 11:40:30 wiz Exp $ -Don't build tests, as have strong dependency on libdl. Disable inotify on SunOS. ---- gio/meson.build.orig 2019-06-10 17:47:20.000000000 +0000 +--- gio/meson.build.orig 2019-10-04 11:44:23.000000000 +0000 +++ gio/meson.build -@@ -758,7 +759,7 @@ gioenumtypes_c = custom_target('gioenumt +@@ -760,7 +760,7 @@ gioenumtypes_c = custom_target('gioenumt gioenumtypes_dep = declare_dependency(sources : [gioenumtypes_h, glib_enumtypes_h]) # inotify @@ -14,8 +13,3 @@ Disable inotify on SunOS. subdir('inotify') internal_deps += [ inotify_lib ] internal_objects += [inotify_lib.extract_all_objects()] -@@ -994,4 +995,3 @@ if enable_systemtap - endif - - subdir('fam') --subdir('tests') diff --git a/devel/glib2/patches/patch-glib_ghash.c b/devel/glib2/patches/patch-glib_ghash.c deleted file mode 100644 index 73a2c69ffed6..000000000000 --- a/devel/glib2/patches/patch-glib_ghash.c +++ /dev/null @@ -1,873 +0,0 @@ -$NetBSD: patch-glib_ghash.c,v 1.1 2019/06/21 20:21:00 prlw1 Exp $ - -Revert GHashTable improvements -https://gitlab.gnome.org/GNOME/glib/merge_requests/208 - -to fix PR pkg/54310 - ---- glib/ghash.c.orig 2019-06-10 17:47:20.000000000 +0000 -+++ glib/ghash.c -@@ -38,26 +38,6 @@ - #include "gtestutils.h" - #include "gslice.h" - #include "grefcount.h" --#include "gvalgrind.h" -- --/* The following #pragma is here so we can do this... -- * -- * #ifndef USE_SMALL_ARRAYS -- * is_big = TRUE; -- * #endif -- * return is_big ? *(((gpointer *) a) + index) : GUINT_TO_POINTER (*(((guint *) a) + index)); -- * -- * ...instead of this... -- * -- * #ifndef USE_SMALL_ARRAYS -- * return *(((gpointer *) a) + index); -- * #else -- * return is_big ? *(((gpointer *) a) + index) : GUINT_TO_POINTER (*(((guint *) a) + index)); -- * #endif -- * -- * ...and still compile successfully when -Werror=duplicated-branches is passed. */ -- --#pragma GCC diagnostic ignored "-Wduplicated-branches" - - /** - * SECTION:hash_tables -@@ -233,18 +213,6 @@ - #define HASH_IS_TOMBSTONE(h_) ((h_) == TOMBSTONE_HASH_VALUE) - #define HASH_IS_REAL(h_) ((h_) >= 2) - --/* If int is smaller than void * on our arch, we start out with -- * int-sized keys and values and resize to pointer-sized entries as -- * needed. This saves a good amount of memory when the HT is being -- * used with e.g. GUINT_TO_POINTER(). */ -- --#define BIG_ENTRY_SIZE (SIZEOF_VOID_P) --#define SMALL_ENTRY_SIZE (SIZEOF_INT) -- --#if SMALL_ENTRY_SIZE < BIG_ENTRY_SIZE --# define USE_SMALL_ARRAYS --#endif -- - struct _GHashTable - { - gint size; -@@ -253,12 +221,9 @@ struct _GHashTable - gint nnodes; - gint noccupied; /* nnodes + tombstones */ - -- guint have_big_keys : 1; -- guint have_big_values : 1; -- -- gpointer keys; -+ gpointer *keys; - guint *hashes; -- gpointer values; -+ gpointer *values; - - GHashFunc hash_func; - GEqualFunc key_equal_func; -@@ -332,15 +297,19 @@ static const gint prime_mod [] = - static void - g_hash_table_set_shift (GHashTable *hash_table, gint shift) - { -+ gint i; -+ guint mask = 0; -+ - hash_table->size = 1 << shift; - hash_table->mod = prime_mod [shift]; - -- /* hash_table->size is always a power of two, so we can calculate the mask -- * by simply subtracting 1 from it. The leading assertion ensures that -- * we're really dealing with a power of two. */ -+ for (i = 0; i < shift; i++) -+ { -+ mask <<= 1; -+ mask |= 1; -+ } - -- g_assert ((hash_table->size & (hash_table->size - 1)) == 0); -- hash_table->mask = hash_table->size - 1; -+ hash_table->mask = mask; - } - - static gint -@@ -365,67 +334,6 @@ g_hash_table_set_shift_from_size (GHashT - g_hash_table_set_shift (hash_table, shift); - } - --static inline gpointer --g_hash_table_realloc_key_or_value_array (gpointer a, guint size, G_GNUC_UNUSED gboolean is_big) --{ --#ifdef USE_SMALL_ARRAYS -- return g_realloc (a, size * (is_big ? BIG_ENTRY_SIZE : SMALL_ENTRY_SIZE)); --#else -- return g_renew (gpointer, a, size); --#endif --} -- --static inline gpointer --g_hash_table_fetch_key_or_value (gpointer a, guint index, gboolean is_big) --{ --#ifndef USE_SMALL_ARRAYS -- is_big = TRUE; --#endif -- return is_big ? *(((gpointer *) a) + index) : GUINT_TO_POINTER (*(((guint *) a) + index)); --} -- --static inline void --g_hash_table_assign_key_or_value (gpointer a, guint index, gboolean is_big, gpointer v) --{ --#ifndef USE_SMALL_ARRAYS -- is_big = TRUE; --#endif -- if (is_big) -- *(((gpointer *) a) + index) = v; -- else -- *(((guint *) a) + index) = GPOINTER_TO_UINT (v); --} -- --static inline gpointer --g_hash_table_evict_key_or_value (gpointer a, guint index, gboolean is_big, gpointer v) --{ --#ifndef USE_SMALL_ARRAYS -- is_big = TRUE; --#endif -- if (is_big) -- { -- gpointer r = *(((gpointer *) a) + index); -- *(((gpointer *) a) + index) = v; -- return r; -- } -- else -- { -- gpointer r = GUINT_TO_POINTER (*(((guint *) a) + index)); -- *(((guint *) a) + index) = GPOINTER_TO_UINT (v); -- return r; -- } --} -- --static inline guint --g_hash_table_hash_to_index (GHashTable *hash_table, guint hash) --{ -- /* Multiply the hash by a small prime before applying the modulo. This -- * prevents the table from becoming densely packed, even with a poor hash -- * function. A densely packed table would have poor performance on -- * workloads with many failed lookups or a high degree of churn. */ -- return (hash * 11) % hash_table->mod; --} -- - /* - * g_hash_table_lookup_node: - * @hash_table: our #GHashTable -@@ -474,7 +382,7 @@ g_hash_table_lookup_node (GHashTable - - *hash_return = hash_value; - -- node_index = g_hash_table_hash_to_index (hash_table, hash_value); -+ node_index = hash_value % hash_table->mod; - node_hash = hash_table->hashes[node_index]; - - while (!HASH_IS_UNUSED (node_hash)) -@@ -485,7 +393,7 @@ g_hash_table_lookup_node (GHashTable - */ - if (node_hash == hash_value) - { -- gpointer node_key = g_hash_table_fetch_key_or_value (hash_table->keys, node_index, hash_table->have_big_keys); -+ gpointer node_key = hash_table->keys[node_index]; - - if (hash_table->key_equal_func) - { -@@ -535,15 +443,15 @@ g_hash_table_remove_node (GHashTable * - gpointer key; - gpointer value; - -- key = g_hash_table_fetch_key_or_value (hash_table->keys, i, hash_table->have_big_keys); -- value = g_hash_table_fetch_key_or_value (hash_table->values, i, hash_table->have_big_values); -+ key = hash_table->keys[i]; -+ value = hash_table->values[i]; - - /* Erect tombstone */ - hash_table->hashes[i] = TOMBSTONE_HASH_VALUE; - - /* Be GC friendly */ -- g_hash_table_assign_key_or_value (hash_table->keys, i, hash_table->have_big_keys, NULL); -- g_hash_table_assign_key_or_value (hash_table->values, i, hash_table->have_big_values, NULL); -+ hash_table->keys[i] = NULL; -+ hash_table->values[i] = NULL; - - hash_table->nnodes--; - -@@ -556,58 +464,15 @@ g_hash_table_remove_node (GHashTable * - } - - /* -- * g_hash_table_setup_storage: -- * @hash_table: our #GHashTable -- * -- * Initialise the hash table size, mask, mod, and arrays. -- */ --static void --g_hash_table_setup_storage (GHashTable *hash_table) --{ -- gboolean small; -- -- /* We want to use small arrays only if: -- * - we are running on a system where that makes sense (64 bit); and -- * - we are not running under valgrind. -- */ -- small = FALSE; -- --#ifdef USE_SMALL_ARRAYS -- small = TRUE; -- --# ifdef ENABLE_VALGRIND -- if (RUNNING_ON_VALGRIND) -- small = FALSE; --# endif --#endif -- -- g_hash_table_set_shift (hash_table, HASH_TABLE_MIN_SHIFT); -- -- hash_table->have_big_keys = !small; -- hash_table->have_big_values = !small; -- -- hash_table->keys = g_hash_table_realloc_key_or_value_array (NULL, hash_table->size, hash_table->have_big_keys); -- hash_table->values = hash_table->keys; -- hash_table->hashes = g_new0 (guint, hash_table->size); --} -- --/* - * g_hash_table_remove_all_nodes: - * @hash_table: our #GHashTable - * @notify: %TRUE if the destroy notify handlers are to be called - * -- * Removes all nodes from the table. -+ * Removes all nodes from the table. Since this may be a precursor to -+ * freeing the table entirely, no resize is performed. - * - * If @notify is %TRUE then the destroy notify functions are called - * for the key and value of the hash node. -- * -- * Since this may be a precursor to freeing the table entirely, we'd -- * ideally perform no resize, and we can indeed avoid that in some -- * cases. However: in the case that we'll be making callbacks to user -- * code (via destroy notifies) we need to consider that the user code -- * might call back into the table again. In this case, we setup a new -- * set of arrays so that any callers will see an empty (but valid) -- * table. - */ - static void - g_hash_table_remove_all_nodes (GHashTable *hash_table, -@@ -621,8 +486,6 @@ g_hash_table_remove_all_nodes (GHashTabl - gpointer *old_keys; - gpointer *old_values; - guint *old_hashes; -- gboolean old_have_big_keys; -- gboolean old_have_big_values; - - /* If the hash table is already empty, there is nothing to be done. */ - if (hash_table->nnodes == 0) -@@ -631,7 +494,6 @@ g_hash_table_remove_all_nodes (GHashTabl - hash_table->nnodes = 0; - hash_table->noccupied = 0; - -- /* Easy case: no callbacks, so we just zero out the arrays */ - if (!notify || - (hash_table->key_destroy_func == NULL && - hash_table->value_destroy_func == NULL)) -@@ -639,65 +501,49 @@ g_hash_table_remove_all_nodes (GHashTabl - if (!destruction) - { - memset (hash_table->hashes, 0, hash_table->size * sizeof (guint)); -- --#ifdef USE_SMALL_ARRAYS -- memset (hash_table->keys, 0, hash_table->size * (hash_table->have_big_keys ? BIG_ENTRY_SIZE : SMALL_ENTRY_SIZE)); -- memset (hash_table->values, 0, hash_table->size * (hash_table->have_big_values ? BIG_ENTRY_SIZE : SMALL_ENTRY_SIZE)); --#else - memset (hash_table->keys, 0, hash_table->size * sizeof (gpointer)); - memset (hash_table->values, 0, hash_table->size * sizeof (gpointer)); --#endif - } - - return; - } - -- /* Hard case: we need to do user callbacks. There are two -- * possibilities here: -- * -- * 1) there are no outstanding references on the table and therefore -- * nobody should be calling into it again (destroying == true) -- * -- * 2) there are outstanding references, and there may be future -- * calls into the table, either after we return, or from the destroy -- * notifies that we're about to do (destroying == false) -- * -- * We handle both cases by taking the current state of the table into -- * local variables and replacing it with something else: in the "no -- * outstanding references" cases we replace it with a bunch of -- * null/zero values so that any access to the table will fail. In the -- * "may receive future calls" case, we reinitialise the struct to -- * appear like a newly-created empty table. -- * -- * In both cases, we take over the references for the current state, -- * freeing them below. -- */ -+ /* Keep the old storage space around to iterate over it. */ - old_size = hash_table->size; -- old_have_big_keys = hash_table->have_big_keys; -- old_have_big_values = hash_table->have_big_values; -- old_keys = g_steal_pointer (&hash_table->keys); -- old_values = g_steal_pointer (&hash_table->values); -- old_hashes = g_steal_pointer (&hash_table->hashes); -- -+ old_keys = hash_table->keys; -+ old_values = hash_table->values; -+ old_hashes = hash_table->hashes; -+ -+ /* Now create a new storage space; If the table is destroyed we can use the -+ * shortcut of not creating a new storage. This saves the allocation at the -+ * cost of not allowing any recursive access. -+ * However, the application doesn't own any reference anymore, so access -+ * is not allowed. If accesses are done, then either an assert or crash -+ * *will* happen. */ -+ g_hash_table_set_shift (hash_table, HASH_TABLE_MIN_SHIFT); - if (!destruction) -- /* Any accesses will see an empty table */ -- g_hash_table_setup_storage (hash_table); -+ { -+ hash_table->keys = g_new0 (gpointer, hash_table->size); -+ hash_table->values = hash_table->keys; -+ hash_table->hashes = g_new0 (guint, hash_table->size); -+ } - else -- /* Will cause a quick crash on any attempted access */ -- hash_table->size = hash_table->mod = hash_table->mask = 0; -+ { -+ hash_table->keys = NULL; -+ hash_table->values = NULL; -+ hash_table->hashes = NULL; -+ } - -- /* Now do the actual destroy notifies */ - for (i = 0; i < old_size; i++) - { - if (HASH_IS_REAL (old_hashes[i])) - { -- key = g_hash_table_fetch_key_or_value (old_keys, i, old_have_big_keys); -- value = g_hash_table_fetch_key_or_value (old_values, i, old_have_big_values); -+ key = old_keys[i]; -+ value = old_values[i]; - - old_hashes[i] = UNUSED_HASH_VALUE; -- -- g_hash_table_assign_key_or_value (old_keys, i, old_have_big_keys, NULL); -- g_hash_table_assign_key_or_value (old_values, i, old_have_big_values, NULL); -+ old_keys[i] = NULL; -+ old_values[i] = NULL; - - if (hash_table->key_destroy_func != NULL) - hash_table->key_destroy_func (key); -@@ -715,125 +561,6 @@ g_hash_table_remove_all_nodes (GHashTabl - g_free (old_hashes); - } - --static void --realloc_arrays (GHashTable *hash_table, gboolean is_a_set) --{ -- hash_table->hashes = g_renew (guint, hash_table->hashes, hash_table->size); -- hash_table->keys = g_hash_table_realloc_key_or_value_array (hash_table->keys, hash_table->size, hash_table->have_big_keys); -- -- if (is_a_set) -- hash_table->values = hash_table->keys; -- else -- hash_table->values = g_hash_table_realloc_key_or_value_array (hash_table->values, hash_table->size, hash_table->have_big_values); --} -- --/* When resizing the table in place, we use a temporary bit array to keep -- * track of which entries have been assigned a proper location in the new -- * table layout. -- * -- * Each bit corresponds to a bucket. A bit is set if an entry was assigned -- * its corresponding location during the resize and thus should not be -- * evicted. The array starts out cleared to zero. */ -- --static inline gboolean --get_status_bit (const guint32 *bitmap, guint index) --{ -- return (bitmap[index / 32] >> (index % 32)) & 1; --} -- --static inline void --set_status_bit (guint32 *bitmap, guint index) --{ -- bitmap[index / 32] |= 1U << (index % 32); --} -- --/* By calling dedicated resize functions for sets and maps, we avoid 2x -- * test-and-branch per key in the inner loop. This yields a small -- * performance improvement at the cost of a bit of macro gunk. */ -- --#define DEFINE_RESIZE_FUNC(fname) \ --static void fname (GHashTable *hash_table, guint old_size, guint32 *reallocated_buckets_bitmap) \ --{ \ -- guint i; \ -- \ -- for (i = 0; i < old_size; i++) \ -- { \ -- guint node_hash = hash_table->hashes[i]; \ -- gpointer key, value G_GNUC_UNUSED; \ -- \ -- if (!HASH_IS_REAL (node_hash)) \ -- { \ -- /* Clear tombstones */ \ -- hash_table->hashes[i] = UNUSED_HASH_VALUE; \ -- continue; \ -- } \ -- \ -- /* Skip entries relocated through eviction */ \ -- if (get_status_bit (reallocated_buckets_bitmap, i)) \ -- continue; \ -- \ -- hash_table->hashes[i] = UNUSED_HASH_VALUE; \ -- EVICT_KEYVAL (hash_table, i, NULL, NULL, key, value); \ -- \ -- for (;;) \ -- { \ -- guint hash_val; \ -- guint replaced_hash; \ -- guint step = 0; \ -- \ -- hash_val = g_hash_table_hash_to_index (hash_table, node_hash); \ -- \ -- while (get_status_bit (reallocated_buckets_bitmap, hash_val)) \ -- { \ -- step++; \ -- hash_val += step; \ -- hash_val &= hash_table->mask; \ -- } \ -- \ -- set_status_bit (reallocated_buckets_bitmap, hash_val); \ -- \ -- replaced_hash = hash_table->hashes[hash_val]; \ -- hash_table->hashes[hash_val] = node_hash; \ -- if (!HASH_IS_REAL (replaced_hash)) \ -- { \ -- ASSIGN_KEYVAL (hash_table, hash_val, key, value); \ -- break; \ -- } \ -- \ -- node_hash = replaced_hash; \ -- EVICT_KEYVAL (hash_table, hash_val, key, value, key, value); \ -- } \ -- } \ --} -- --#define ASSIGN_KEYVAL(ht, index, key, value) G_STMT_START{ \ -- g_hash_table_assign_key_or_value ((ht)->keys, (index), (ht)->have_big_keys, (key)); \ -- g_hash_table_assign_key_or_value ((ht)->values, (index), (ht)->have_big_values, (value)); \ -- }G_STMT_END -- --#define EVICT_KEYVAL(ht, index, key, value, outkey, outvalue) G_STMT_START{ \ -- (outkey) = g_hash_table_evict_key_or_value ((ht)->keys, (index), (ht)->have_big_keys, (key)); \ -- (outvalue) = g_hash_table_evict_key_or_value ((ht)->values, (index), (ht)->have_big_values, (value)); \ -- }G_STMT_END -- --DEFINE_RESIZE_FUNC (resize_map) -- --#undef ASSIGN_KEYVAL --#undef EVICT_KEYVAL -- --#define ASSIGN_KEYVAL(ht, index, key, value) G_STMT_START{ \ -- g_hash_table_assign_key_or_value ((ht)->keys, (index), (ht)->have_big_keys, (key)); \ -- }G_STMT_END -- --#define EVICT_KEYVAL(ht, index, key, value, outkey, outvalue) G_STMT_START{ \ -- (outkey) = g_hash_table_evict_key_or_value ((ht)->keys, (index), (ht)->have_big_keys, (key)); \ -- }G_STMT_END -- --DEFINE_RESIZE_FUNC (resize_set) -- --#undef ASSIGN_KEYVAL --#undef EVICT_KEYVAL -- - /* - * g_hash_table_resize: - * @hash_table: our #GHashTable -@@ -850,47 +577,54 @@ DEFINE_RESIZE_FUNC (resize_set) - static void - g_hash_table_resize (GHashTable *hash_table) - { -- guint32 *reallocated_buckets_bitmap; -- guint old_size; -- gboolean is_a_set; -+ gpointer *new_keys; -+ gpointer *new_values; -+ guint *new_hashes; -+ gint old_size; -+ gint i; - - old_size = hash_table->size; -- is_a_set = hash_table->keys == hash_table->values; -- -- /* The outer checks in g_hash_table_maybe_resize() will only consider -- * cleanup/resize when the load factor goes below .25 (1/4, ignoring -- * tombstones) or above .9375 (15/16, including tombstones). -- * -- * Once this happens, tombstones will always be cleaned out. If our -- * load sans tombstones is greater than .75 (1/1.333, see below), we'll -- * take this opportunity to grow the table too. -- * -- * Immediately after growing, the load factor will be in the range -- * .375 .. .469. After shrinking, it will be exactly .5. */ -+ g_hash_table_set_shift_from_size (hash_table, hash_table->nnodes * 2); - -- g_hash_table_set_shift_from_size (hash_table, hash_table->nnodes * 1.333); -+ new_keys = g_new0 (gpointer, hash_table->size); -+ if (hash_table->keys == hash_table->values) -+ new_values = new_keys; -+ else -+ new_values = g_new0 (gpointer, hash_table->size); -+ new_hashes = g_new0 (guint, hash_table->size); - -- if (hash_table->size > old_size) -+ for (i = 0; i < old_size; i++) - { -- realloc_arrays (hash_table, is_a_set); -- memset (&hash_table->hashes[old_size], 0, (hash_table->size - old_size) * sizeof (guint)); -+ guint node_hash = hash_table->hashes[i]; -+ guint hash_val; -+ guint step = 0; - -- reallocated_buckets_bitmap = g_new0 (guint32, (hash_table->size + 31) / 32); -- } -- else -- { -- reallocated_buckets_bitmap = g_new0 (guint32, (old_size + 31) / 32); -+ if (!HASH_IS_REAL (node_hash)) -+ continue; -+ -+ hash_val = node_hash % hash_table->mod; -+ -+ while (!HASH_IS_UNUSED (new_hashes[hash_val])) -+ { -+ step++; -+ hash_val += step; -+ hash_val &= hash_table->mask; -+ } -+ -+ new_hashes[hash_val] = hash_table->hashes[i]; -+ new_keys[hash_val] = hash_table->keys[i]; -+ new_values[hash_val] = hash_table->values[i]; - } - -- if (is_a_set) -- resize_set (hash_table, old_size, reallocated_buckets_bitmap); -- else -- resize_map (hash_table, old_size, reallocated_buckets_bitmap); -+ if (hash_table->keys != hash_table->values) -+ g_free (hash_table->values); - -- g_free (reallocated_buckets_bitmap); -+ g_free (hash_table->keys); -+ g_free (hash_table->hashes); - -- if (hash_table->size < old_size) -- realloc_arrays (hash_table, is_a_set); -+ hash_table->keys = new_keys; -+ hash_table->values = new_values; -+ hash_table->hashes = new_hashes; - - hash_table->noccupied = hash_table->nnodes; - } -@@ -915,94 +649,6 @@ g_hash_table_maybe_resize (GHashTable *h - g_hash_table_resize (hash_table); - } - --#ifdef USE_SMALL_ARRAYS -- --static inline gboolean --entry_is_big (gpointer v) --{ -- return (((guintptr) v) >> ((BIG_ENTRY_SIZE - SMALL_ENTRY_SIZE) * 8)) != 0; --} -- --static inline gboolean --g_hash_table_maybe_make_big_keys_or_values (gpointer *a_p, gpointer v, gint ht_size) --{ -- if (entry_is_big (v)) -- { -- guint *a = (guint *) *a_p; -- gpointer *a_new; -- gint i; -- -- a_new = g_new (gpointer, ht_size); -- -- for (i = 0; i < ht_size; i++) -- { -- a_new[i] = GUINT_TO_POINTER (a[i]); -- } -- -- g_free (a); -- *a_p = a_new; -- return TRUE; -- } -- -- return FALSE; --} -- --#endif -- --static inline void --g_hash_table_ensure_keyval_fits (GHashTable *hash_table, gpointer key, gpointer value) --{ -- gboolean is_a_set = (hash_table->keys == hash_table->values); -- --#ifdef USE_SMALL_ARRAYS -- -- /* Convert from set to map? */ -- if (is_a_set) -- { -- if (hash_table->have_big_keys) -- { -- if (key != value) -- hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size); -- /* Keys and values are both big now, so no need for further checks */ -- return; -- } -- else -- { -- if (key != value) -- { -- hash_table->values = g_memdup (hash_table->keys, sizeof (guint) * hash_table->size); -- is_a_set = FALSE; -- } -- } -- } -- -- /* Make keys big? */ -- if (!hash_table->have_big_keys) -- { -- hash_table->have_big_keys = g_hash_table_maybe_make_big_keys_or_values (&hash_table->keys, key, hash_table->size); -- -- if (is_a_set) -- { -- hash_table->values = hash_table->keys; -- hash_table->have_big_values = hash_table->have_big_keys; -- } -- } -- -- /* Make values big? */ -- if (!is_a_set && !hash_table->have_big_values) -- { -- hash_table->have_big_values = g_hash_table_maybe_make_big_keys_or_values (&hash_table->values, value, hash_table->size); -- } -- --#else -- -- /* Just split if necessary */ -- if (is_a_set && key != value) -- hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size); -- --#endif --} -- - /** - * g_hash_table_new: - * @hash_func: a function to create a hash value from a key -@@ -1069,6 +715,7 @@ g_hash_table_new_full (GHashFunc ha - GHashTable *hash_table; - - hash_table = g_slice_new (GHashTable); -+ g_hash_table_set_shift (hash_table, HASH_TABLE_MIN_SHIFT); - g_atomic_ref_count_init (&hash_table->ref_count); - hash_table->nnodes = 0; - hash_table->noccupied = 0; -@@ -1079,8 +726,9 @@ g_hash_table_new_full (GHashFunc ha - #endif - hash_table->key_destroy_func = key_destroy_func; - hash_table->value_destroy_func = value_destroy_func; -- -- g_hash_table_setup_storage (hash_table); -+ hash_table->keys = g_new0 (gpointer, hash_table->size); -+ hash_table->values = hash_table->keys; -+ hash_table->hashes = g_new0 (guint, hash_table->size); - - return hash_table; - } -@@ -1164,9 +812,9 @@ g_hash_table_iter_next (GHashTableIter * - while (!HASH_IS_REAL (ri->hash_table->hashes[position])); - - if (key != NULL) -- *key = g_hash_table_fetch_key_or_value (ri->hash_table->keys, position, ri->hash_table->have_big_keys); -+ *key = ri->hash_table->keys[position]; - if (value != NULL) -- *value = g_hash_table_fetch_key_or_value (ri->hash_table->values, position, ri->hash_table->have_big_values); -+ *value = ri->hash_table->values[position]; - - ri->position = position; - return TRUE; -@@ -1269,7 +917,6 @@ g_hash_table_insert_node (GHashTable *ha - gboolean already_exists; - guint old_hash; - gpointer key_to_free = NULL; -- gpointer key_to_keep = NULL; - gpointer value_to_free = NULL; - - old_hash = hash_table->hashes[node_index]; -@@ -1299,31 +946,31 @@ g_hash_table_insert_node (GHashTable *ha - * because we might change the value in the event that the two - * arrays are shared. - */ -- value_to_free = g_hash_table_fetch_key_or_value (hash_table->values, node_index, hash_table->have_big_values); -+ value_to_free = hash_table->values[node_index]; - - if (keep_new_key) - { -- key_to_free = g_hash_table_fetch_key_or_value (hash_table->keys, node_index, hash_table->have_big_keys); -- key_to_keep = new_key; -+ key_to_free = hash_table->keys[node_index]; -+ hash_table->keys[node_index] = new_key; - } - else -- { -- key_to_free = new_key; -- key_to_keep = g_hash_table_fetch_key_or_value (hash_table->keys, node_index, hash_table->have_big_keys); -- } -+ key_to_free = new_key; - } - else - { - hash_table->hashes[node_index] = key_hash; -- key_to_keep = new_key; -+ hash_table->keys[node_index] = new_key; - } - -- /* Resize key/value arrays and split table as necessary */ -- g_hash_table_ensure_keyval_fits (hash_table, key_to_keep, new_value); -- g_hash_table_assign_key_or_value (hash_table->keys, node_index, hash_table->have_big_keys, key_to_keep); -+ /* Step two: check if the value that we are about to write to the -+ * table is the same as the key in the same position. If it's not, -+ * split the table. -+ */ -+ if (G_UNLIKELY (hash_table->keys == hash_table->values && hash_table->keys[node_index] != new_value)) -+ hash_table->values = g_memdup (hash_table->keys, sizeof (gpointer) * hash_table->size); - - /* Step 3: Actually do the write */ -- g_hash_table_assign_key_or_value (hash_table->values, node_index, hash_table->have_big_values, new_value); -+ hash_table->values[node_index] = new_value; - - /* Now, the bookkeeping... */ - if (!already_exists) -@@ -1385,8 +1032,7 @@ g_hash_table_iter_replace (GHashTableIte - g_return_if_fail (ri->position < ri->hash_table->size); - - node_hash = ri->hash_table->hashes[ri->position]; -- -- key = g_hash_table_fetch_key_or_value (ri->hash_table->keys, ri->position, ri->hash_table->have_big_keys); -+ key = ri->hash_table->keys[ri->position]; - - g_hash_table_insert_node (ri->hash_table, ri->position, node_hash, key, value, TRUE, TRUE); - -@@ -1507,7 +1153,7 @@ g_hash_table_lookup (GHashTable *hash - node_index = g_hash_table_lookup_node (hash_table, key, &node_hash); - - return HASH_IS_REAL (hash_table->hashes[node_index]) -- ? g_hash_table_fetch_key_or_value (hash_table->values, node_index, hash_table->have_big_values) -+ ? hash_table->values[node_index] - : NULL; - } - -@@ -1554,10 +1200,10 @@ g_hash_table_lookup_extended (GHashTable - } - - if (orig_key) -- *orig_key = g_hash_table_fetch_key_or_value (hash_table->keys, node_index, hash_table->have_big_keys); -+ *orig_key = hash_table->keys[node_index]; - - if (value) -- *value = g_hash_table_fetch_key_or_value (hash_table->values, node_index, hash_table->have_big_values); -+ *value = hash_table->values[node_index]; - - return TRUE; - } -@@ -1828,16 +1474,10 @@ g_hash_table_steal_extended (GHashTable - } - - if (stolen_key != NULL) -- { -- *stolen_key = g_hash_table_fetch_key_or_value (hash_table->keys, node_index, hash_table->have_big_keys); -- g_hash_table_assign_key_or_value (hash_table->keys, node_index, hash_table->have_big_keys, NULL); -- } -+ *stolen_key = g_steal_pointer (&hash_table->keys[node_index]); - - if (stolen_value != NULL) -- { -- *stolen_value = g_hash_table_fetch_key_or_value (hash_table->values, node_index, hash_table->have_big_values); -- g_hash_table_assign_key_or_value (hash_table->values, node_index, hash_table->have_big_values, NULL); -- } -+ *stolen_value = g_steal_pointer (&hash_table->values[node_index]); - - g_hash_table_remove_node (hash_table, node_index, FALSE); - g_hash_table_maybe_resize (hash_table); -@@ -1931,8 +1571,8 @@ g_hash_table_foreach_remove_or_steal (GH - for (i = 0; i < hash_table->size; i++) - { - guint node_hash = hash_table->hashes[i]; -- gpointer node_key = g_hash_table_fetch_key_or_value (hash_table->keys, i, hash_table->have_big_keys); -- gpointer node_value = g_hash_table_fetch_key_or_value (hash_table->values, i, hash_table->have_big_values); -+ gpointer node_key = hash_table->keys[i]; -+ gpointer node_value = hash_table->values[i]; - - if (HASH_IS_REAL (node_hash) && - (* func) (node_key, node_value, user_data)) -@@ -2047,8 +1687,8 @@ g_hash_table_foreach (GHashTable *hash_t - for (i = 0; i < hash_table->size; i++) - { - guint node_hash = hash_table->hashes[i]; -- gpointer node_key = g_hash_table_fetch_key_or_value (hash_table->keys, i, hash_table->have_big_keys); -- gpointer node_value = g_hash_table_fetch_key_or_value (hash_table->values, i, hash_table->have_big_values); -+ gpointer node_key = hash_table->keys[i]; -+ gpointer node_value = hash_table->values[i]; - - if (HASH_IS_REAL (node_hash)) - (* func) (node_key, node_value, user_data); -@@ -2108,8 +1748,8 @@ g_hash_table_find (GHashTable *hash_tabl - for (i = 0; i < hash_table->size; i++) - { - guint node_hash = hash_table->hashes[i]; -- gpointer node_key = g_hash_table_fetch_key_or_value (hash_table->keys, i, hash_table->have_big_keys); -- gpointer node_value = g_hash_table_fetch_key_or_value (hash_table->values, i, hash_table->have_big_values); -+ gpointer node_key = hash_table->keys[i]; -+ gpointer node_value = hash_table->values[i]; - - if (HASH_IS_REAL (node_hash)) - match = predicate (node_key, node_value, user_data); -@@ -2171,7 +1811,7 @@ g_hash_table_get_keys (GHashTable *hash_ - for (i = 0; i < hash_table->size; i++) - { - if (HASH_IS_REAL (hash_table->hashes[i])) -- retval = g_list_prepend (retval, g_hash_table_fetch_key_or_value (hash_table->keys, i, hash_table->have_big_keys)); -+ retval = g_list_prepend (retval, hash_table->keys[i]); - } - - return retval; -@@ -2216,7 +1856,7 @@ g_hash_table_get_keys_as_array (GHashTab - for (i = 0; i < hash_table->size; i++) - { - if (HASH_IS_REAL (hash_table->hashes[i])) -- result[j++] = g_hash_table_fetch_key_or_value (hash_table->keys, i, hash_table->have_big_keys); -+ result[j++] = hash_table->keys[i]; - } - g_assert_cmpint (j, ==, hash_table->nnodes); - result[j] = NULL; -@@ -2257,7 +1897,7 @@ g_hash_table_get_values (GHashTable *has - for (i = 0; i < hash_table->size; i++) - { - if (HASH_IS_REAL (hash_table->hashes[i])) -- retval = g_list_prepend (retval, g_hash_table_fetch_key_or_value (hash_table->values, i, hash_table->have_big_values)); -+ retval = g_list_prepend (retval, hash_table->values[i]); - } - - return retval; diff --git a/devel/glib2/patches/patch-glib_meson.build b/devel/glib2/patches/patch-glib_meson.build index c0577c8b71b6..ec2677bdc3f9 100644 --- a/devel/glib2/patches/patch-glib_meson.build +++ b/devel/glib2/patches/patch-glib_meson.build @@ -1,13 +1,12 @@ -$NetBSD: patch-glib_meson.build,v 1.4 2019/10/29 09:22:24 adam Exp $ +$NetBSD: patch-glib_meson.build,v 1.5 2019/11/14 11:40:30 wiz Exp $ - On Darwin, allow building without Cocoa. - Don't bother with gtester as it's slated for deprecation anyway: https://gitlab.gnome.org/GNOME/glib/issues/1441 -- Don't build tests ---- glib/meson.build.orig 2019-07-24 10:52:04.000000000 +0000 +--- glib/meson.build.orig 2019-10-04 11:44:24.000000000 +0000 +++ glib/meson.build -@@ -230,7 +230,7 @@ else +@@ -316,7 +316,7 @@ else platform_deps = [] endif @@ -16,13 +15,14 @@ $NetBSD: patch-glib_meson.build,v 1.4 2019/10/29 09:22:24 adam Exp $ glib_sources += files('gosxutils.m') endif -@@ -324,24 +324,8 @@ if host_system == 'windows' +@@ -410,25 +410,8 @@ if host_system == 'windows' include_directories : configinc, dependencies : [libglib_dep]) endif -else - gtester = executable('gtester', 'gtester.c', - install : true, +- c_args : ['-UG_DISABLE_ASSERT'], - include_directories : configinc, - dependencies : [libglib_dep]) endif @@ -41,9 +41,3 @@ $NetBSD: patch-glib_meson.build,v 1.4 2019/10/29 09:22:24 adam Exp $ install_data('glib_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb')) gdb_conf = configuration_data() -@@ -370,5 +354,3 @@ if enable_systemtap - install_dir : tapset_install_dir, - install : true) - endif -- --subdir('tests') diff --git a/devel/glib2/patches/patch-gobject_meson.build b/devel/glib2/patches/patch-gobject_meson.build index 0336927e72c2..17acef177b05 100644 --- a/devel/glib2/patches/patch-gobject_meson.build +++ b/devel/glib2/patches/patch-gobject_meson.build @@ -1,14 +1,13 @@ -$NetBSD: patch-gobject_meson.build,v 1.4 2019/10/29 09:22:24 adam Exp $ +$NetBSD: patch-gobject_meson.build,v 1.5 2019/11/14 11:40:30 wiz Exp $ Leave glib-genmarshal and glib-mkenums to devel/glib2-tools. ---- gobject/meson.build.orig 2019-06-10 17:47:20.000000000 +0000 +--- gobject/meson.build.orig 2019-10-04 11:44:24.000000000 +0000 +++ gobject/meson.build -@@ -75,7 +75,7 @@ foreach tool: python_tools +@@ -75,6 +75,7 @@ foreach tool: python_tools input : tool + '.in', output : tool, configuration : python_tools_conf, -- install : true, + install : false, install_dir : glib_bindir, ) diff --git a/devel/glib2/patches/patch-meson.build b/devel/glib2/patches/patch-meson.build index e8fb0c4619cf..47cb22e103b0 100644 --- a/devel/glib2/patches/patch-meson.build +++ b/devel/glib2/patches/patch-meson.build @@ -1,4 +1,4 @@ -$NetBSD: patch-meson.build,v 1.6 2019/10/29 09:22:24 adam Exp $ +$NetBSD: patch-meson.build,v 1.7 2019/11/14 11:40:30 wiz Exp $ - On Darwin, optionally use Cocoa (needed for X11 users). @@ -12,15 +12,9 @@ $NetBSD: patch-meson.build,v 1.6 2019/10/29 09:22:24 adam Exp $ - Define a newer POSIX, as we build this package with -std=gnu99 -- auto-detect GNU iconv, even if no arguments are passed. - (by checking if iconv.h might in fact be a gnu one) - -- Ignore __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 as is already done - for android and linux. PR pkg/54298 - ---- meson.build.orig 2019-07-24 10:52:04.000000000 +0000 +--- meson.build.orig 2019-10-04 11:44:24.000000000 +0000 +++ meson.build -@@ -643,6 +643,7 @@ if host_system == 'darwin' +@@ -677,6 +677,7 @@ if host_system == 'darwin' #error "Detected GNUstep, not Cocoa" #endif''', name : 'Mac OS X Cocoa support') @@ -28,61 +22,7 @@ $NetBSD: patch-meson.build,v 1.6 2019/10/29 09:22:24 adam Exp $ if glib_have_cocoa glib_conf.set('HAVE_COCOA', true) -@@ -1570,28 +1571,15 @@ atomictest = '''int main() { - } - ''' - --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 --''' -- - # We know that we can always use real ("lock free") atomic operations with MSVC - if cc.get_id() == 'msvc' or cc.links(atomictest, name : 'atomic ops') -- have_atomic_lock_free = true -- if (host_system == 'android' or host_system == 'linux') and not cc.compiles(atomicdefine, name : 'atomic ops define') -- # When building for armv5 on Linux, gcc 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 -+ glibconfig_conf.set('G_ATOMIC_LOCK_FREE', true) - 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 === - -@@ -1696,14 +1684,14 @@ else - found_iconv = false - if iconv_opt == 'libc' - if cc.has_function('iconv_open') -- libiconv = [] -- found_iconv = true -- endif -- elif iconv_opt == 'gnu' -- if cc.has_header_symbol('iconv.h', 'libiconv_open') -- glib_conf.set('USE_LIBICONV_GNU', true) -- libiconv = [cc.find_library('iconv')] -- found_iconv = true -+ if cc.has_header_symbol('iconv.h', 'libiconv_open') -+ glib_conf.set('USE_LIBICONV_GNU', true) -+ libiconv = [cc.find_library('iconv')] -+ found_iconv = true -+ else -+ libiconv = [] -+ found_iconv = true -+ endif - endif - elif iconv_opt == 'native' - if cc.has_header_symbol('iconv.h', 'iconv_open') -@@ -1785,7 +1773,7 @@ endif +@@ -1838,7 +1839,7 @@ endif # proxy-libintl subproject. # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible # implementations. This could be extended if issues are found in some platforms. @@ -91,7 +31,7 @@ $NetBSD: patch-meson.build,v 1.6 2019/10/29 09:22:24 adam Exp $ libintl = [] have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset') else -@@ -1836,16 +1824,15 @@ if host_system != 'windows' and get_opti +@@ -1889,16 +1890,15 @@ if host_system != 'windows' and get_opti if cc.has_function('getxattr') and cc.has_header('sys/xattr.h') glib_conf.set('HAVE_SYS_XATTR_H', 1) glib_conf_prefix = glib_conf_prefix + '#define @0@ 1\n'.format('HAVE_SYS_XATTR_H') @@ -110,9 +50,9 @@ $NetBSD: patch-meson.build,v 1.6 2019/10/29 09:22:24 adam Exp $ if cc.compiles(glib_conf_prefix + ''' #include #ifdef HAVE_SYS_TYPES_H -@@ -1886,9 +1873,11 @@ elif meson.get_cross_property('have_strl - glib_conf.set('HAVE_STRLCPY', 1) - endif +@@ -1992,9 +1992,11 @@ endif + + glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline) -python = import('python').find_installation('python3') -# used for '#!/usr/bin/env ' @@ -125,7 +65,7 @@ $NetBSD: patch-meson.build,v 1.6 2019/10/29 09:22:24 adam Exp $ python_version = python.language_version() python_version_req = '>=3.4' -@@ -1897,7 +1886,7 @@ if not python_version.version_compare(py +@@ -2003,7 +2005,7 @@ if not python_version.version_compare(py endif # Determine which user environment-dependent files that we want to install @@ -134,7 +74,7 @@ $NetBSD: patch-meson.build,v 1.6 2019/10/29 09:22:24 adam Exp $ have_sh = find_program('sh', required : false).found() # For glib-gettextize # Some installed tests require a custom environment -@@ -1906,7 +1895,7 @@ env_program = find_program('env', requir +@@ -2012,7 +2014,7 @@ env_program = find_program('env', requir # FIXME: How to detect Solaris? https://github.com/mesonbuild/meson/issues/1578 if host_system == 'sunos' glib_conf.set('_XOPEN_SOURCE_EXTENDED', 1) diff --git a/devel/glib2/patches/patch-meson_options.txt b/devel/glib2/patches/patch-meson_options.txt index 5bf61e4b263d..536a54799a62 100644 --- a/devel/glib2/patches/patch-meson_options.txt +++ b/devel/glib2/patches/patch-meson_options.txt @@ -1,15 +1,18 @@ -$NetBSD: patch-meson_options.txt,v 1.1 2019/10/29 09:22:24 adam Exp $ +$NetBSD: patch-meson_options.txt,v 1.2 2019/11/14 11:40:30 wiz Exp $ Add use_cocoa option. ---- meson_options.txt.orig 2019-08-03 12:15:12.000000000 +0000 +--- meson_options.txt.orig 2019-10-04 11:44:24.000000000 +0000 +++ meson_options.txt -@@ -89,3 +89,8 @@ option('nls', - value : 'auto', +@@ -90,6 +90,11 @@ option('nls', yield: true, description : 'Enable native language support (translations)') -+ + +option('use_cocoa', + type : 'boolean', + value : false, + description : 'Use Cocoa on macOS') ++ + option('oss_fuzz', + type : 'feature', + value : 'disabled',