diff options
author | Sam James <sam@gentoo.org> | 2020-11-30 02:57:02 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2020-11-30 02:57:02 +0000 |
commit | 24276d89d7c30abb460e786497fe7d50605bcdf7 (patch) | |
tree | 707993aed62b8c08f86172998cb9028e8bafa3a9 | |
parent | eclass/toolchain: sync with gx86 (diff) | |
download | prefix-24276d89d7c30abb460e786497fe7d50605bcdf7.tar.gz prefix-24276d89d7c30abb460e786497fe7d50605bcdf7.tar.bz2 prefix-24276d89d7c30abb460e786497fe7d50605bcdf7.zip |
sys-devel/gettext: fix Darwin build on 0.21
Package-Manager: Portage-3.0.9, Repoman-3.0.2
RepoMan-Options: --force
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | sys-devel/gettext/files/gettext-0.21-no-setlocale.patch | 190 | ||||
-rw-r--r-- | sys-devel/gettext/gettext-0.21.ebuild | 1 |
2 files changed, 191 insertions, 0 deletions
diff --git a/sys-devel/gettext/files/gettext-0.21-no-setlocale.patch b/sys-devel/gettext/files/gettext-0.21-no-setlocale.patch new file mode 100644 index 0000000000..552bb2ecb7 --- /dev/null +++ b/sys-devel/gettext/files/gettext-0.21-no-setlocale.patch @@ -0,0 +1,190 @@ +Fixes build on Darwin. +Undefined symbols for architecture x86_64: + "_gl_get_setlocale_null_lock", referenced from: + _libgettextpo_setlocale_null_r in libgnu.a(setlocale_null.o) + _libgettextpo_setlocale_null in libgnu.a(setlocale_null.o) +ld: symbol(s) not found for architecture x86_64 +collect2: error: ld returned 1 exit status +---- +From 55bb1134ed4c1c3701a16dc5aeb974be341967d2 Mon Sep 17 00:00:00 2001 +From: Bruno Haible <bruno@clisp.org> +Date: Sun, 4 Oct 2020 23:40:53 +0200 +Subject: [PATCH] build: Assume ANSI C declaration of 'setlocale'. + +* gettext-tools/tests/setlocale.c (setlocale): Assume SETLOCALE_CONST is +'const'. +* gettext-tools/tests/format-c-3-prg.c: Likewise. +* gettext-tools/tests/format-c-4-prg.c: Likewise. +* gettext-tools/tests/plural-1-prg.c: Likewise. +* gettext-tools/tests/tstgettext.c: Likewise. +* gettext-tools/tests/tstngettext.c: Likewise. +* gettext-tools/configure.ac: Don't invoke gt_SETLOCALE. +* gettext-tools/m4/setlocale.m4: Remove file. +* gettext-tools/m4/Makefile.am (EXTRA_DIST): Remove it. +--- + gettext-tools/configure.ac | 1 - + gettext-tools/m4/Makefile.am | 3 +-- + gettext-tools/m4/setlocale.m4 | 31 ------------------------------- + gettext-tools/tests/format-c-3-prg.c | 2 +- + gettext-tools/tests/format-c-4-prg.c | 2 +- + gettext-tools/tests/plural-1-prg.c | 2 +- + gettext-tools/tests/setlocale.c | 4 ++-- + gettext-tools/tests/tstgettext.c | 2 +- + gettext-tools/tests/tstngettext.c | 2 +- + 9 files changed, 8 insertions(+), 41 deletions(-) + delete mode 100644 gettext-tools/m4/setlocale.m4 + +diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac +index c4c3eed..90cd608 100644 +--- a/gettext-tools/configure.ac ++++ b/gettext-tools/configure.ac +@@ -220,7 +220,6 @@ dnl Checks for library functions. + AC_CHECK_FUNCS([select]) + AC_FUNC_VFORK + gt_SIGINFO +-gt_SETLOCALE + + AC_C_BIGENDIAN([endianness=1], [endianness=0], + [echo "AC-C-BIGENDIAN fails to work on your system." | sed -e 's,-,_,g' 1>&2 +diff --git a/gettext-tools/m4/Makefile.am b/gettext-tools/m4/Makefile.am +index 1eabe09..55683aa 100644 +--- a/gettext-tools/m4/Makefile.am ++++ b/gettext-tools/m4/Makefile.am +@@ -1,5 +1,5 @@ + ## Makefile for the gettext-tools/m4 directory of GNU gettext +-## Copyright (C) 2003-2010, 2013, 2017-2019 Free Software Foundation, Inc. ++## Copyright (C) 2003-2010, 2013, 2017-2020 Free Software Foundation, Inc. + ## + ## This program is free software: you can redistribute it and/or modify + ## it under the terms of the GNU General Public License as published by +@@ -44,5 +44,4 @@ EXTRA_DIST = README csharpexec-test.exe \ + exported.m4 \ + hostname.m4 \ + locale-de.m4 \ +-setlocale.m4 \ + siginfo.m4 +diff --git a/gettext-tools/m4/setlocale.m4 b/gettext-tools/m4/setlocale.m4 +deleted file mode 100644 +index 5b8fff0..0000000 +--- a/gettext-tools/m4/setlocale.m4 ++++ /dev/null +@@ -1,31 +0,0 @@ +-# setlocale.m4 serial 4 (gettext-0.18) +-dnl Copyright (C) 2001-2002, 2006, 2009 Free Software Foundation, Inc. +-dnl This file is free software; the Free Software Foundation +-dnl gives unlimited permission to copy and/or distribute it, +-dnl with or without modifications, as long as this notice is preserved. +- +-# Check for setlocale declaration. +- +-AC_DEFUN([gt_SETLOCALE],[ +-AC_MSG_CHECKING([for setlocale declaration]) +-AC_CACHE_VAL(gt_cv_proto_setlocale, [ +-AC_TRY_COMPILE([ +-#include <stdlib.h> +-#include <locale.h> +-extern +-#ifdef __cplusplus +-"C" +-#endif +-#if defined(__STDC__) || defined(__cplusplus) +-char *setlocale (int category, char *locale); +-#else +-char *setlocale(); +-#endif +-], [], gt_cv_proto_setlocale_arg1="", gt_cv_proto_setlocale_arg1="const") +-gt_cv_proto_setlocale="extern char *setlocale (int category, $gt_cv_proto_setlocale_arg1 char *locale);"]) +-gt_cv_proto_setlocale=`echo "[$]gt_cv_proto_setlocale" | tr -s ' ' | sed -e 's/( /(/'` +-AC_MSG_RESULT([ +- $gt_cv_proto_setlocale]) +-AC_DEFINE_UNQUOTED(SETLOCALE_CONST,$gt_cv_proto_setlocale_arg1, +- [Define as const if the declaration of setlocale() needs const.]) +-]) +diff --git a/gettext-tools/tests/format-c-3-prg.c b/gettext-tools/tests/format-c-3-prg.c +index e1ce8ef..804d468 100644 +--- a/gettext-tools/tests/format-c-3-prg.c ++++ b/gettext-tools/tests/format-c-3-prg.c +@@ -42,7 +42,7 @@ + #undef setlocale + #if defined _WIN32 && !defined __CYGWIN__ + # define setlocale fake_setlocale +-extern char *setlocale (int category, SETLOCALE_CONST char *locale); ++extern char *setlocale (int category, const char *locale); + #endif + + #define _(string) gettext (string) +diff --git a/gettext-tools/tests/format-c-4-prg.c b/gettext-tools/tests/format-c-4-prg.c +index 8f796ff..4dac6af 100644 +--- a/gettext-tools/tests/format-c-4-prg.c ++++ b/gettext-tools/tests/format-c-4-prg.c +@@ -42,7 +42,7 @@ + #undef setlocale + #if defined _WIN32 && !defined __CYGWIN__ + # define setlocale fake_setlocale +-extern char *setlocale (int category, SETLOCALE_CONST char *locale); ++extern char *setlocale (int category, const char *locale); + #endif + + #define _(string) gettext (string) +diff --git a/gettext-tools/tests/plural-1-prg.c b/gettext-tools/tests/plural-1-prg.c +index 0df74d2..982ea47 100644 +--- a/gettext-tools/tests/plural-1-prg.c ++++ b/gettext-tools/tests/plural-1-prg.c +@@ -38,7 +38,7 @@ + #undef setlocale + #if defined _WIN32 && !defined __CYGWIN__ + # define setlocale fake_setlocale +-extern char *setlocale (int category, SETLOCALE_CONST char *locale); ++extern char *setlocale (int category, const char *locale); + #endif + + int +diff --git a/gettext-tools/tests/setlocale.c b/gettext-tools/tests/setlocale.c +index e69a694..e48b38c 100644 +--- a/gettext-tools/tests/setlocale.c ++++ b/gettext-tools/tests/setlocale.c +@@ -1,5 +1,5 @@ + /* Fake setlocale - platform independent, for testing purposes. +- Copyright (C) 2001-2002, 2019 Free Software Foundation, Inc. ++ Copyright (C) 2001-2002, 2019-2020 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by +@@ -94,7 +94,7 @@ category_to_name (int category) + actually change the behaviour of locale dependent functions. + Assumes setenv()/putenv() is not called. */ + char * +-setlocale (int category, SETLOCALE_CONST char *locale) ++setlocale (int category, const char *locale) + { + static char C_string[] = "C"; + static char *current_locale = C_string; +diff --git a/gettext-tools/tests/tstgettext.c b/gettext-tools/tests/tstgettext.c +index 71651bb..a855783 100644 +--- a/gettext-tools/tests/tstgettext.c ++++ b/gettext-tools/tests/tstgettext.c +@@ -46,7 +46,7 @@ + #if defined _WIN32 && !defined __CYGWIN__ + # undef setlocale + # define setlocale fake_setlocale +-extern char *setlocale (int category, SETLOCALE_CONST char *locale); ++extern char *setlocale (int category, const char *locale); + #endif + + #define _(str) gettext (str) +diff --git a/gettext-tools/tests/tstngettext.c b/gettext-tools/tests/tstngettext.c +index 8dfeed4..e9ce5c9 100644 +--- a/gettext-tools/tests/tstngettext.c ++++ b/gettext-tools/tests/tstngettext.c +@@ -44,7 +44,7 @@ + #if defined _WIN32 && !defined __CYGWIN__ + # undef setlocale + # define setlocale fake_setlocale +-extern char *setlocale (int category, SETLOCALE_CONST char *locale); ++extern char *setlocale (int category, const char *locale); + #endif + + #define _(str) gettext (str) +-- +1.9.1 + diff --git a/sys-devel/gettext/gettext-0.21.ebuild b/sys-devel/gettext/gettext-0.21.ebuild index 69790191b8..921871be1e 100644 --- a/sys-devel/gettext/gettext-0.21.ebuild +++ b/sys-devel/gettext/gettext-0.21.ebuild @@ -60,6 +60,7 @@ PATCHES=( "${FILESDIR}"/${PN}-0.19.7-disable-libintl.patch #564168 "${FILESDIR}"/${PN}-0.20-parallel_install.patch #685530 "${FILESDIR}"/${PN}-0.21_rc1-avoid_eautomake.patch + "${FILESDIR}"/${P}-no-setlocale.patch ) QA_SONAME_NO_SYMLINK=".*/preloadable_libintl.so" |