From a60c23a214f76a1dc87b5f2e0bd661f8d3b95316 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 22 Jun 2022 07:54:27 +0100 Subject: [PATCH] uim: pull upstream fix for -fno-common toolchains Without the change build fails on upstream gcc-10 as: ld: .libs/mach_dep.o:sigscheme/libgcroots/include/private/gc_priv.h:2029: multiple definition of `GCROOTS_jmp_buf'; .libs/mark.o:sigscheme/libgcroots/include/private/gc_priv.h:2029: first defined here --- pkgs/tools/inputmethods/uim/default.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/inputmethods/uim/default.nix b/pkgs/tools/inputmethods/uim/default.nix index 9336d5429c12..e1daecbd10ff 100644 --- a/pkgs/tools/inputmethods/uim/default.nix +++ b/pkgs/tools/inputmethods/uim/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, shared-mime-info +{ lib, stdenv, fetchFromGitHub, fetchpatch, shared-mime-info , autoconf, automake, intltool, libtool, pkg-config, cmake , ruby, librsvg , ncurses, m17n_lib, m17n_db, expat @@ -86,7 +86,21 @@ stdenv.mkDerivation rec { ./autogen.sh ''; - patches = [ ./data-hook.patch ]; + patches = [ + ./data-hook.patch + + # Pull upstream fix for -fno-common toolchains + # https://github.com/uim/libgcroots/pull/4 + (fetchpatch { + name = "libgcroots-fno-common.patch"; + url = "https://github.com/uim/libgcroots/commit/7e39241344ad0663409e836560ae6b5eb231e1fc.patch"; + sha256 = "0iifcl5lk8bvl0cflm47gkymg88aiwzj0gxh2aj3mqlyhvyx78nz"; + # Patch comes from git submodule. Relocate as: + # a/include/private/gc_priv.h -> a/sigscheme/libgcroots/include/private/gc_priv.h + stripLen = 1; + extraPrefix = "sigscheme/libgcroots/"; + }) + ]; configureFlags = [ # configure in maintainer mode or else some pixmaps won't get autogenerated