Skip to content

Commit

Permalink
glib: update to 2.82.1
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-pierre committed Oct 8, 2024
1 parent b01f7ac commit f7eacf4
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 26 deletions.
5 changes: 3 additions & 2 deletions thirdparty/glib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ endif()
list(APPEND CFG_CMD COMMAND
${MESON_SETUP} --default-library=static
-Dglib_assert=false
-Dglib_debug=disabled
-Dtests=false
-Dxattr=false
${SOURCE_DIR}
Expand All @@ -32,8 +33,8 @@ list(APPEND INSTALL_CMD COMMAND ${MESON_INSTALL} --tags devel)
list(APPEND INSTALL_CMD COMMAND rm -f ${STAGING_DIR}/lib/pkgconfig/glib-2.0.pc)

external_project(
DOWNLOAD URL 4334211338220a165350d1c4a1597b0e
https://download.gnome.org/sources/glib/2.80/glib-2.80.4.tar.xz
DOWNLOAD URL d101f1acab6805d4d6d3104e9634b8e3
https://download.gnome.org/sources/glib/2.82/glib-2.82.1.tar.xz
PATCH_FILES ${PATCH_FILES}
CONFIGURE_COMMAND ${CFG_CMD}
BUILD_COMMAND ${BUILD_CMD}
Expand Down
21 changes: 6 additions & 15 deletions thirdparty/glib/libglib-only.patch
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
--- i/glib/meson.build
+++ w/glib/meson.build
@@ -462,6 +462,8 @@ pkg.generate(libglib,
@@ -462,6 +462,8 @@
)
meson.override_dependency('glib-2.0', libglib_dep)

+if false
+
# On Windows, glib needs a spawn helper for g_spawn* API
if host_system == 'windows'
if host_machine.cpu_family() == 'x86'
@@ -499,6 +501,8 @@ else
# FIXME: This needs to be added to the `depends` of every invocation of
# glib_compile_resources in the build process. We can drop this when
# https://github.com/mesonbuild/meson/issues/13385 is fixed.
@@ -503,6 +505,8 @@
meson.override_find_program('gtester', gtester)
endif

+endif
+
report_conf = configuration_data()
report_conf.set('GLIB_VERSION', glib_version)
report_conf.set('PYTHON', python_name)
report_conf.set('PYTHON', python.full_path())
--- i/meson.build
+++ w/meson.build
@@ -2214,13 +2214,13 @@ else
Expand All @@ -38,15 +38,6 @@

# First check in libc, fallback to libintl, and as last chance build
# proxy-libintl subproject.
@@ -2422,7 +2422,7 @@ endif

glib_conf.set('HAVE_PROC_SELF_CMDLINE', have_proc_self_cmdline)

-python = import('python').find_installation(modules: ['packaging'])
+python = import('python').find_installation()
# used for '#!/usr/bin/env <name>'
python_name = 'python3'

@@ -2570,25 +2570,19 @@ gnome = import('gnome')

subdir('tools')
Expand Down
14 changes: 7 additions & 7 deletions thirdparty/glib/no_glibc_2.6_or_above_symbols.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
--- i/meson.build
+++ w/meson.build
@@ -692,7 +692,6 @@
@@ -709,7 +709,6 @@ functions = [
'memalign',
'mmap',
'newlocale',
- 'pipe2',
'poll',
'prlimit',
'readlink',
@@ -932,14 +931,6 @@
@@ -945,14 +944,6 @@ else
endif
message('Checking whether to use statfs or statvfs .. ' + stat_func_to_use)

Expand All @@ -23,7 +23,7 @@
osx_ldflags = []
glib_have_os_x_9_or_later = false
glib_have_carbon = false
@@ -1001,16 +992,6 @@
@@ -1014,16 +1005,6 @@ if cc.compiles('''#include <linux/futex.h>
glib_conf.set('HAVE_FUTEX_TIME64', 1)
endif

Expand All @@ -37,10 +37,10 @@
- glib_conf.set('HAVE_EVENTFD', 1)
-endif
-
# Check for pidfd_open(2)
if cc.links('''#include <sys/syscall.h>
#include <sys/wait.h>
@@ -2065,9 +2065,6 @@
# Check for ppoll(2)
if cc.links('''#define _GNU_SOURCE
#include <poll.h>
@@ -2113,9 +2094,6 @@ else
if cc.has_header_symbol('pthread.h', 'pthread_getname_np', prefix : pthread_prefix)
glib_conf.set('HAVE_PTHREAD_GETNAME_NP', 1)
endif
Expand Down
6 changes: 4 additions & 2 deletions thirdparty/sdcv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
list(APPEND PATCH_FILES
# Revert 6e36e7730caf07b6cd0bfa265cdf9b5e31e7acad, because it's
# not helpful in our workflow, and just causes logging noise.
${CMAKE_CURRENT_SOURCE_DIR}/sdcv-no-unknown-dict-warning.patch
sdcv-no-unknown-dict-warning.patch
# Force UTF-8 command line parsing.
${CMAKE_CURRENT_SOURCE_DIR}/sdcv-locale-hack.patch
sdcv-locale-hack.patch
# Fix compilation with newer GLib.
compat_with_newer_glib.patch
)

string(APPEND GLIB2_INCLUDE_DIRS
Expand Down
16 changes: 16 additions & 0 deletions thirdparty/sdcv/compat_with_newer_glib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- i/src/stardict_lib.cpp
+++ w/src/stardict_lib.cpp
@@ -1047,9 +1047,9 @@
}
// Upper the first character and lower others.
if (!bFound) {
- gchar *nextchar = g_utf8_next_char(sWord);
- gchar *firstchar = g_utf8_strup(sWord, nextchar - sWord);
- nextchar = g_utf8_strdown(nextchar, -1);
+ size_t nextchar_pos = g_utf8_next_char(sWord) - sWord;
+ gchar *firstchar = g_utf8_strup(sWord, nextchar_pos);
+ gchar *nextchar = g_utf8_strdown(sWord + nextchar_pos, -1);
casestr = g_strdup_printf("%s%s", firstchar, nextchar);
g_free(firstchar);
g_free(nextchar);

0 comments on commit f7eacf4

Please sign in to comment.