git.iko.soy/typeable/nixpkgs
on master help sign in
glib: patch to fix w/musl, quark static ctor order assumptions

From [1] with prefix added, using local copy to avoid dep on fetchpatch. [1] https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/glib/patches/quark_init_on_demand.patch

commit7fa6b340931acaccfa8211f0dd2ef4938e68ea17 authorWill Dietz <w@wdtz.org> dateMon 25 Jun 2018, 09:45 (8 years ago) parent01847b7
2 files changed+34
pkgs/development/libraries/glib/default.nix+1 pkgs/development/libraries/glib/quark_init_on_demand.patch+33
pkgs/development/libraries/glib/default.nix+1
@@ -54,6 +54,7 @@ stdenv.mkDerivation rec {
5454
5555 patches = optional stdenv.isDarwin ./darwin-compilation.patch
5656 ++ optional doCheck ./skip-timer-test.patch
57+ ++ optional stdenv.hostPlatform.isMusl ./quark_init_on_demand.patch
5758 ++ [ ./schema-override-variable.patch ];
5859
5960 outputs = [ "out" "dev" "devdoc" ];
pkgs/development/libraries/glib/quark_init_on_demand.patchnew file+33
@@ -0,0 +1,33 @@
1+--- glib-source/glib/gquark.c 2016-08-17 17:20:47.000000000 +0200
2++++ glib-source/glib/gquark.c 2016-08-30 07:49:13.298234757 +0200
3+@@ -57,6 +57,9 @@
4+ void
5+ g_quark_init (void)
6+ {
7++ if (quark_ht)
8++ return;
9++
10+ g_assert (quark_seq_id == 0);
11+ quark_ht = g_hash_table_new (g_str_hash, g_str_equal);
12+ quarks = g_new (gchar*, QUARK_BLOCK_SIZE);
13+@@ -138,9 +141,12 @@
14+ return 0;
15+
16+ G_LOCK (quark_global);
17++#if !defined(__GLIBC__)
18++ g_quark_init ();
19++#endif
20+ quark = GPOINTER_TO_UINT (g_hash_table_lookup (quark_ht, string));
21+ G_UNLOCK (quark_global);
22+
23+ return quark;
24+ }
25+
26+@@ -280,6 +286,7 @@
27+ GQuark quark;
28+ gchar **quarks_new;
29+
30++ g_quark_init ();
31+ if (quark_seq_id % QUARK_BLOCK_SIZE == 0)
32+ {
33+ quarks_new = g_new (gchar*, quark_seq_id + QUARK_BLOCK_SIZE);