Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: sys-devel/gettext/files/, sys-devel/gettext/
Date: Mon, 30 Nov 2020 03:12:32
Message-Id: 1606705022.24276d89d7c30abb460e786497fe7d50605bcdf7.sam@gentoo
1 commit: 24276d89d7c30abb460e786497fe7d50605bcdf7
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 30 02:57:02 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 30 02:57:02 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=24276d89
7
8 sys-devel/gettext: fix Darwin build on 0.21
9
10 Package-Manager: Portage-3.0.9, Repoman-3.0.2
11 RepoMan-Options: --force
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 .../gettext/files/gettext-0.21-no-setlocale.patch | 190 +++++++++++++++++++++
15 sys-devel/gettext/gettext-0.21.ebuild | 1 +
16 2 files changed, 191 insertions(+)
17
18 diff --git a/sys-devel/gettext/files/gettext-0.21-no-setlocale.patch b/sys-devel/gettext/files/gettext-0.21-no-setlocale.patch
19 new file mode 100644
20 index 0000000000..552bb2ecb7
21 --- /dev/null
22 +++ b/sys-devel/gettext/files/gettext-0.21-no-setlocale.patch
23 @@ -0,0 +1,190 @@
24 +Fixes build on Darwin.
25 +Undefined symbols for architecture x86_64:
26 + "_gl_get_setlocale_null_lock", referenced from:
27 + _libgettextpo_setlocale_null_r in libgnu.a(setlocale_null.o)
28 + _libgettextpo_setlocale_null in libgnu.a(setlocale_null.o)
29 +ld: symbol(s) not found for architecture x86_64
30 +collect2: error: ld returned 1 exit status
31 +----
32 +From 55bb1134ed4c1c3701a16dc5aeb974be341967d2 Mon Sep 17 00:00:00 2001
33 +From: Bruno Haible <bruno@×××××.org>
34 +Date: Sun, 4 Oct 2020 23:40:53 +0200
35 +Subject: [PATCH] build: Assume ANSI C declaration of 'setlocale'.
36 +
37 +* gettext-tools/tests/setlocale.c (setlocale): Assume SETLOCALE_CONST is
38 +'const'.
39 +* gettext-tools/tests/format-c-3-prg.c: Likewise.
40 +* gettext-tools/tests/format-c-4-prg.c: Likewise.
41 +* gettext-tools/tests/plural-1-prg.c: Likewise.
42 +* gettext-tools/tests/tstgettext.c: Likewise.
43 +* gettext-tools/tests/tstngettext.c: Likewise.
44 +* gettext-tools/configure.ac: Don't invoke gt_SETLOCALE.
45 +* gettext-tools/m4/setlocale.m4: Remove file.
46 +* gettext-tools/m4/Makefile.am (EXTRA_DIST): Remove it.
47 +---
48 + gettext-tools/configure.ac | 1 -
49 + gettext-tools/m4/Makefile.am | 3 +--
50 + gettext-tools/m4/setlocale.m4 | 31 -------------------------------
51 + gettext-tools/tests/format-c-3-prg.c | 2 +-
52 + gettext-tools/tests/format-c-4-prg.c | 2 +-
53 + gettext-tools/tests/plural-1-prg.c | 2 +-
54 + gettext-tools/tests/setlocale.c | 4 ++--
55 + gettext-tools/tests/tstgettext.c | 2 +-
56 + gettext-tools/tests/tstngettext.c | 2 +-
57 + 9 files changed, 8 insertions(+), 41 deletions(-)
58 + delete mode 100644 gettext-tools/m4/setlocale.m4
59 +
60 +diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac
61 +index c4c3eed..90cd608 100644
62 +--- a/gettext-tools/configure.ac
63 ++++ b/gettext-tools/configure.ac
64 +@@ -220,7 +220,6 @@ dnl Checks for library functions.
65 + AC_CHECK_FUNCS([select])
66 + AC_FUNC_VFORK
67 + gt_SIGINFO
68 +-gt_SETLOCALE
69 +
70 + AC_C_BIGENDIAN([endianness=1], [endianness=0],
71 + [echo "AC-C-BIGENDIAN fails to work on your system." | sed -e 's,-,_,g' 1>&2
72 +diff --git a/gettext-tools/m4/Makefile.am b/gettext-tools/m4/Makefile.am
73 +index 1eabe09..55683aa 100644
74 +--- a/gettext-tools/m4/Makefile.am
75 ++++ b/gettext-tools/m4/Makefile.am
76 +@@ -1,5 +1,5 @@
77 + ## Makefile for the gettext-tools/m4 directory of GNU gettext
78 +-## Copyright (C) 2003-2010, 2013, 2017-2019 Free Software Foundation, Inc.
79 ++## Copyright (C) 2003-2010, 2013, 2017-2020 Free Software Foundation, Inc.
80 + ##
81 + ## This program is free software: you can redistribute it and/or modify
82 + ## it under the terms of the GNU General Public License as published by
83 +@@ -44,5 +44,4 @@ EXTRA_DIST = README csharpexec-test.exe \
84 + exported.m4 \
85 + hostname.m4 \
86 + locale-de.m4 \
87 +-setlocale.m4 \
88 + siginfo.m4
89 +diff --git a/gettext-tools/m4/setlocale.m4 b/gettext-tools/m4/setlocale.m4
90 +deleted file mode 100644
91 +index 5b8fff0..0000000
92 +--- a/gettext-tools/m4/setlocale.m4
93 ++++ /dev/null
94 +@@ -1,31 +0,0 @@
95 +-# setlocale.m4 serial 4 (gettext-0.18)
96 +-dnl Copyright (C) 2001-2002, 2006, 2009 Free Software Foundation, Inc.
97 +-dnl This file is free software; the Free Software Foundation
98 +-dnl gives unlimited permission to copy and/or distribute it,
99 +-dnl with or without modifications, as long as this notice is preserved.
100 +-
101 +-# Check for setlocale declaration.
102 +-
103 +-AC_DEFUN([gt_SETLOCALE],[
104 +-AC_MSG_CHECKING([for setlocale declaration])
105 +-AC_CACHE_VAL(gt_cv_proto_setlocale, [
106 +-AC_TRY_COMPILE([
107 +-#include <stdlib.h>
108 +-#include <locale.h>
109 +-extern
110 +-#ifdef __cplusplus
111 +-"C"
112 +-#endif
113 +-#if defined(__STDC__) || defined(__cplusplus)
114 +-char *setlocale (int category, char *locale);
115 +-#else
116 +-char *setlocale();
117 +-#endif
118 +-], [], gt_cv_proto_setlocale_arg1="", gt_cv_proto_setlocale_arg1="const")
119 +-gt_cv_proto_setlocale="extern char *setlocale (int category, $gt_cv_proto_setlocale_arg1 char *locale);"])
120 +-gt_cv_proto_setlocale=`echo "[$]gt_cv_proto_setlocale" | tr -s ' ' | sed -e 's/( /(/'`
121 +-AC_MSG_RESULT([
122 +- $gt_cv_proto_setlocale])
123 +-AC_DEFINE_UNQUOTED(SETLOCALE_CONST,$gt_cv_proto_setlocale_arg1,
124 +- [Define as const if the declaration of setlocale() needs const.])
125 +-])
126 +diff --git a/gettext-tools/tests/format-c-3-prg.c b/gettext-tools/tests/format-c-3-prg.c
127 +index e1ce8ef..804d468 100644
128 +--- a/gettext-tools/tests/format-c-3-prg.c
129 ++++ b/gettext-tools/tests/format-c-3-prg.c
130 +@@ -42,7 +42,7 @@
131 + #undef setlocale
132 + #if defined _WIN32 && !defined __CYGWIN__
133 + # define setlocale fake_setlocale
134 +-extern char *setlocale (int category, SETLOCALE_CONST char *locale);
135 ++extern char *setlocale (int category, const char *locale);
136 + #endif
137 +
138 + #define _(string) gettext (string)
139 +diff --git a/gettext-tools/tests/format-c-4-prg.c b/gettext-tools/tests/format-c-4-prg.c
140 +index 8f796ff..4dac6af 100644
141 +--- a/gettext-tools/tests/format-c-4-prg.c
142 ++++ b/gettext-tools/tests/format-c-4-prg.c
143 +@@ -42,7 +42,7 @@
144 + #undef setlocale
145 + #if defined _WIN32 && !defined __CYGWIN__
146 + # define setlocale fake_setlocale
147 +-extern char *setlocale (int category, SETLOCALE_CONST char *locale);
148 ++extern char *setlocale (int category, const char *locale);
149 + #endif
150 +
151 + #define _(string) gettext (string)
152 +diff --git a/gettext-tools/tests/plural-1-prg.c b/gettext-tools/tests/plural-1-prg.c
153 +index 0df74d2..982ea47 100644
154 +--- a/gettext-tools/tests/plural-1-prg.c
155 ++++ b/gettext-tools/tests/plural-1-prg.c
156 +@@ -38,7 +38,7 @@
157 + #undef setlocale
158 + #if defined _WIN32 && !defined __CYGWIN__
159 + # define setlocale fake_setlocale
160 +-extern char *setlocale (int category, SETLOCALE_CONST char *locale);
161 ++extern char *setlocale (int category, const char *locale);
162 + #endif
163 +
164 + int
165 +diff --git a/gettext-tools/tests/setlocale.c b/gettext-tools/tests/setlocale.c
166 +index e69a694..e48b38c 100644
167 +--- a/gettext-tools/tests/setlocale.c
168 ++++ b/gettext-tools/tests/setlocale.c
169 +@@ -1,5 +1,5 @@
170 + /* Fake setlocale - platform independent, for testing purposes.
171 +- Copyright (C) 2001-2002, 2019 Free Software Foundation, Inc.
172 ++ Copyright (C) 2001-2002, 2019-2020 Free Software Foundation, Inc.
173 +
174 + This program is free software: you can redistribute it and/or modify
175 + it under the terms of the GNU General Public License as published by
176 +@@ -94,7 +94,7 @@ category_to_name (int category)
177 + actually change the behaviour of locale dependent functions.
178 + Assumes setenv()/putenv() is not called. */
179 + char *
180 +-setlocale (int category, SETLOCALE_CONST char *locale)
181 ++setlocale (int category, const char *locale)
182 + {
183 + static char C_string[] = "C";
184 + static char *current_locale = C_string;
185 +diff --git a/gettext-tools/tests/tstgettext.c b/gettext-tools/tests/tstgettext.c
186 +index 71651bb..a855783 100644
187 +--- a/gettext-tools/tests/tstgettext.c
188 ++++ b/gettext-tools/tests/tstgettext.c
189 +@@ -46,7 +46,7 @@
190 + #if defined _WIN32 && !defined __CYGWIN__
191 + # undef setlocale
192 + # define setlocale fake_setlocale
193 +-extern char *setlocale (int category, SETLOCALE_CONST char *locale);
194 ++extern char *setlocale (int category, const char *locale);
195 + #endif
196 +
197 + #define _(str) gettext (str)
198 +diff --git a/gettext-tools/tests/tstngettext.c b/gettext-tools/tests/tstngettext.c
199 +index 8dfeed4..e9ce5c9 100644
200 +--- a/gettext-tools/tests/tstngettext.c
201 ++++ b/gettext-tools/tests/tstngettext.c
202 +@@ -44,7 +44,7 @@
203 + #if defined _WIN32 && !defined __CYGWIN__
204 + # undef setlocale
205 + # define setlocale fake_setlocale
206 +-extern char *setlocale (int category, SETLOCALE_CONST char *locale);
207 ++extern char *setlocale (int category, const char *locale);
208 + #endif
209 +
210 + #define _(str) gettext (str)
211 +--
212 +1.9.1
213 +
214
215 diff --git a/sys-devel/gettext/gettext-0.21.ebuild b/sys-devel/gettext/gettext-0.21.ebuild
216 index 69790191b8..921871be1e 100644
217 --- a/sys-devel/gettext/gettext-0.21.ebuild
218 +++ b/sys-devel/gettext/gettext-0.21.ebuild
219 @@ -60,6 +60,7 @@ PATCHES=(
220 "${FILESDIR}"/${PN}-0.19.7-disable-libintl.patch #564168
221 "${FILESDIR}"/${PN}-0.20-parallel_install.patch #685530
222 "${FILESDIR}"/${PN}-0.21_rc1-avoid_eautomake.patch
223 + "${FILESDIR}"/${P}-no-setlocale.patch
224 )
225
226 QA_SONAME_NO_SYMLINK=".*/preloadable_libintl.so"