Skip to content

Commit

Permalink
Fixed glib-static build for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
FrodeSolheim committed Nov 2, 2021
1 parent a8a72d5 commit 759e345
Showing 1 changed file with 61 additions and 1 deletion.
62 changes: 61 additions & 1 deletion fsdeps/dep/glib-static
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fsdeps/dep/libintl-static

PACKAGE=glib-2.66.7
CHECKSUM=09f158769f6f26b31074e15b1ac80ec39b13b53102dfae66cfe826fb2cc65502
REVISION=3
REVISION=4

. fsdeps/dep.sh

Expand Down Expand Up @@ -129,6 +129,66 @@ EOF

fi

if [ $SYSTEM_OS = "macOS" ]; then
patch -p1 <<EOF
--- a/meson.build 2021-02-11 13:24:55.000000000 +0100
+++ b/meson.build 2021-11-02 13:47:12.000000000 +0100
@@ -1998,46 +1998,12 @@
endif
endif
-# First check in libc, fallback to libintl, and as last chance build
-# 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.
libintl_deps = []
-if cc.has_function('ngettext')
- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
-else
- # First just find the bare library.
- libintl = cc.find_library('intl', required : false)
- # The bare library probably won't link without help if it's static.
- if libintl.found() and not cc.has_function('ngettext', dependencies : libintl)
- libintl_iconv = cc.find_library('iconv', required : false)
- # libintl supports different threading APIs, which may not
- # require additional flags, but it defaults to using pthreads if
- # found. Meson's "threads" dependency does not allow you to
- # prefer pthreads. We may not be using pthreads for glib itself
- # either so just link the library to satisfy libintl rather than
- # also defining the macros with the -pthread flag.
- libintl_pthread = cc.find_library('pthread', required : false)
- # Try linking with just libiconv.
- if libintl_iconv.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_iconv])
- libintl_deps += [libintl_iconv]
- # Then also try linking with pthreads.
- elif libintl_iconv.found() and libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_iconv, libintl_pthread])
- libintl_deps += [libintl_iconv, libintl_pthread]
- else
- libintl = disabler()
- endif
- endif
- if not libintl.found()
- libintl = subproject('proxy-libintl').get_variable('intl_dep')
- libintl_deps = [libintl] + libintl_deps
- have_bind_textdomain_codeset = true # proxy-libintl supports it
- else
- libintl_deps = [libintl] + libintl_deps
- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset',
- dependencies : libintl_deps)
- endif
-endif
+libintl = cc.find_library('intl', required : false)
+# libintl_iconv = cc.find_library('iconv', required : false)
+# libintl_deps += [libintl_iconv]
+libintl_deps = [libintl] + libintl_deps
+have_bind_textdomain_codeset = true
glib_conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', have_bind_textdomain_codeset)
EOF
fi

# python3 ../../replace.py \
# gio/tests/meson.build \
# "if not meson.is_cross_build() or meson.has_exe_wrapper()" \
Expand Down

0 comments on commit 759e345

Please sign in to comment.