summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-06-26 13:20:07 +0200
committerSebastian Dröge <sebastian@centricular.com>2014-06-26 13:20:07 +0200
commit7415ca6cd818f44f8f28a114ad31f7413458e0b0 (patch)
tree532d6707cd9fe12a68abf5251c931fd955b729b6
parenta0d19522c15d35fe02874250d0032e71da4b96f0 (diff)
pango: Fix initialization of pango on Android
Without this e.g. initializing the pango plugin will deadlock.
-rw-r--r--recipes/pango.recipe1
-rw-r--r--recipes/pango/0001-pango-Don-t-fail-to-initialize-if-LC_CTYPE-is-not-se.patch37
2 files changed, 38 insertions, 0 deletions
diff --git a/recipes/pango.recipe b/recipes/pango.recipe
index a2dee4ea..d02fca68 100644
--- a/recipes/pango.recipe
+++ b/recipes/pango.recipe
@@ -11,6 +11,7 @@ class Recipe(recipe.Recipe):
licenses = [License.LGPLv2Plus]
configure_options = '--with-included-modules --enable-static --disable-gtk-doc'
deps = ['cairo', 'fontconfig', 'freetype', 'gtk-doc-lite', 'harfbuzz']
+ patches = ['pango/0001-pango-Don-t-fail-to-initialize-if-LC_CTYPE-is-not-se.patch']
files_libs = ['libpangocairo-1.0', 'libpango-1.0', 'libpangoft2-1.0']
files_bins = ['pango-querymodules', 'pango-view']
diff --git a/recipes/pango/0001-pango-Don-t-fail-to-initialize-if-LC_CTYPE-is-not-se.patch b/recipes/pango/0001-pango-Don-t-fail-to-initialize-if-LC_CTYPE-is-not-se.patch
new file mode 100644
index 00000000..6077f7f6
--- /dev/null
+++ b/recipes/pango/0001-pango-Don-t-fail-to-initialize-if-LC_CTYPE-is-not-se.patch
@@ -0,0 +1,37 @@
+From e737458d9294c960d9b16438c06b09ca601ffb96 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
+Date: Thu, 26 Jun 2014 13:15:38 +0200
+Subject: [PATCH] pango: Don't fail to initialize if LC_CTYPE is not set
+
+g_once_init_leave() does not work on NULL, and just returns... and
+all future calls to g_once_init_enter() will block forever.
+
+Happens on Android, so let's just fall back to the C locale if there's
+nothing else we can do.
+---
+ pango/pango-language.c | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/pango/pango-language.c b/pango/pango-language.c
+index 15d5fb6..e9c9d1f 100644
+--- a/pango/pango-language.c
++++ b/pango/pango-language.c
+@@ -219,7 +219,14 @@ _pango_get_lc_ctype (void)
+
+ return g_strdup (ret);
+ #else
+- return g_strdup (setlocale (LC_CTYPE, NULL));
++ {
++ gchar *lc_ctype = setlocale (LC_CTYPE, NULL);
++
++ if (lc_ctype)
++ return g_strdup (lc_ctype);
++ else
++ return g_strdup ("C");
++ }
+ #endif
+ }
+
+--
+2.0.0
+