git.iko.soy/typeable/nixpkgs
on master help sign in
libiconv: remove old cygwin hacks
commit260afef6679952fd70e9f2a7a41d54e760b21ca5 authorDavid McFarland <corngood@gmail.com> dateTue 23 May 2017, 10:36 (10 years ago) parent84a4ee5
3 files changed+1−382
pkgs/development/libraries/libiconv/default.nix+1−11 pkgs/development/libraries/libiconv/libiconv-1.14-reloc.patch−269 pkgs/development/libraries/libiconv/libiconv-1.14-wchar.patch−102
pkgs/development/libraries/libiconv/default.nix+1−11
@@ -11,11 +11,6 @@ stdenv.mkDerivation rec {
1111 sha256 = "0y1ij745r4p48mxq84rax40p10ln7fc7m243p8k8sia519i3dxfc";
1212 };
1313
14− patches = lib.optionals stdenv.isCygwin [
15− ./libiconv-1.14-reloc.patch
16− ./libiconv-1.14-wchar.patch
17− ];
18−
1914 postPatch =
2015 lib.optionalString ((stdenv ? cross && stdenv.cross.libc == "msvcrt") || stdenv.cc.nativeLibc)
2116 ''
@@ -23,12 +18,7 @@ stdenv.mkDerivation rec {
2318 '';
2419
2520 configureFlags =
26− # On Cygwin, Libtool produces a `.dll.a', which is not a "real" DLL
27− # (Windows' linker would need to be used somehow to produce an actual
28− # DLL.) Thus, build the static library too, and this is what Gettext
29− # will actually use.
30− lib.optional stdenv.isCygwin "--enable-static"
31− ++ lib.optional stdenv.isFreeBSD "--with-pic";
21+ lib.optional stdenv.isFreeBSD "--with-pic";
3222
3323 crossAttrs = {
3424 # Disable stripping to avoid "libiconv.a: Archive has no index" (MinGW).
pkgs/development/libraries/libiconv/libiconv-1.14-reloc.patchdeleted−269
@@ -1,269 +0,0 @@
1−--- libiconv-1.14/lib/relocatable.c 2011-08-07 13:48:03.000000000 -0400
2−+++ libiconv-1.14/lib/relocatable.c 2011-10-15 03:14:13.195133600 -0400
3−@@ -2,20 +2,18 @@
4− Copyright (C) 2003-2006, 2008-2011 Free Software Foundation, Inc.
5− Written by Bruno Haible <bruno@clisp.org>, 2003.
6−
7−- This program is free software; you can redistribute it and/or modify it
8−- under the terms of the GNU Library General Public License as published
9−- by the Free Software Foundation; either version 2, or (at your option)
10−- any later version.
11−+ This program is free software: you can redistribute it and/or modify
12−+ it under the terms of the GNU Lesser General Public License as published by
13−+ the Free Software Foundation; either version 2.1 of the License, or
14−+ (at your option) any later version.
15−
16− This program is distributed in the hope that it will be useful,
17− but WITHOUT ANY WARRANTY; without even the implied warranty of
18−- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19−- Library General Public License for more details.
20−+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21−+ GNU Lesser General Public License for more details.
22−
23−- You should have received a copy of the GNU Library General Public
24−- License along with this program; if not, write to the Free Software
25−- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
26−- USA. */
27−+ You should have received a copy of the GNU Lesser General Public License
28−+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
29−
30−
31− /* Tell glibc's <stdio.h> to provide a prototype for getline().
32−@@ -87,6 +85,19 @@
33− # define FILE_SYSTEM_PREFIX_LEN(P) 0
34− #endif
35−
36−+/* Whether to enable the more costly support for relocatable libraries.
37−+ It allows libraries to be have been installed with a different original
38−+ prefix than the program. But it is quite costly, especially on Cygwin
39−+ platforms, see below. Therefore we enable it by default only on native
40−+ Win32 platforms. */
41−+#ifndef ENABLE_COSTLY_RELOCATABLE
42−+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
43−+# define ENABLE_COSTLY_RELOCATABLE 1
44−+# else
45−+# define ENABLE_COSTLY_RELOCATABLE 0
46−+# endif
47−+#endif
48−+
49− /* Original installation prefix. */
50− static char *orig_prefix;
51− static size_t orig_prefix_len;
52−@@ -156,7 +167,7 @@
53− #endif
54− }
55−
56−-#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
57−+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
58−
59− /* Convenience function:
60− Computes the current installation prefix, based on the original
61−@@ -286,7 +297,7 @@
62−
63− #endif /* !IN_LIBRARY || PIC */
64−
65−-#if defined PIC && defined INSTALLDIR
66−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
67−
68− /* Full pathname of shared library, or NULL. */
69− static char *shared_library_fullname;
70−@@ -332,7 +343,9 @@
71− #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
72− /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
73− function.
74−- Cygwin >= 1.5 has /proc/self/maps and the getline() function too. */
75−+ Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
76−+ But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
77−+ Cygwin 1.7. */
78− FILE *fp;
79−
80− /* Open the current process' maps file. It describes one VMA per line. */
81−@@ -405,7 +418,7 @@
82− const char *
83− relocate (const char *pathname)
84− {
85−-#if defined PIC && defined INSTALLDIR
86−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
87− static int initialized;
88−
89− /* Initialization code for a shared library. */
90−--- libiconv-1.14/libcharset/lib/relocatable.c 2011-08-07 13:48:03.000000000 -0400
91−+++ libiconv-1.14/libcharset/lib/relocatable.c 2011-10-15 03:14:27.878133600 -0400
92−@@ -2,20 +2,18 @@
93− Copyright (C) 2003-2006, 2008-2011 Free Software Foundation, Inc.
94− Written by Bruno Haible <bruno@clisp.org>, 2003.
95−
96−- This program is free software; you can redistribute it and/or modify it
97−- under the terms of the GNU Library General Public License as published
98−- by the Free Software Foundation; either version 2, or (at your option)
99−- any later version.
100−+ This program is free software: you can redistribute it and/or modify
101−+ it under the terms of the GNU Lesser General Public License as published by
102−+ the Free Software Foundation; either version 2.1 of the License, or
103−+ (at your option) any later version.
104−
105− This program is distributed in the hope that it will be useful,
106− but WITHOUT ANY WARRANTY; without even the implied warranty of
107−- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
108−- Library General Public License for more details.
109−+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
110−+ GNU Lesser General Public License for more details.
111−
112−- You should have received a copy of the GNU Library General Public
113−- License along with this program; if not, write to the Free Software
114−- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
115−- USA. */
116−+ You should have received a copy of the GNU Lesser General Public License
117−+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
118−
119−
120− /* Tell glibc's <stdio.h> to provide a prototype for getline().
121−@@ -87,6 +85,19 @@
122− # define FILE_SYSTEM_PREFIX_LEN(P) 0
123− #endif
124−
125−+/* Whether to enable the more costly support for relocatable libraries.
126−+ It allows libraries to be have been installed with a different original
127−+ prefix than the program. But it is quite costly, especially on Cygwin
128−+ platforms, see below. Therefore we enable it by default only on native
129−+ Win32 platforms. */
130−+#ifndef ENABLE_COSTLY_RELOCATABLE
131−+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
132−+# define ENABLE_COSTLY_RELOCATABLE 1
133−+# else
134−+# define ENABLE_COSTLY_RELOCATABLE 0
135−+# endif
136−+#endif
137−+
138− /* Original installation prefix. */
139− static char *orig_prefix;
140− static size_t orig_prefix_len;
141−@@ -156,7 +167,7 @@
142− #endif
143− }
144−
145−-#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
146−+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
147−
148− /* Convenience function:
149− Computes the current installation prefix, based on the original
150−@@ -286,7 +297,7 @@
151−
152− #endif /* !IN_LIBRARY || PIC */
153−
154−-#if defined PIC && defined INSTALLDIR
155−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
156−
157− /* Full pathname of shared library, or NULL. */
158− static char *shared_library_fullname;
159−@@ -332,7 +343,9 @@
160− #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
161− /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
162− function.
163−- Cygwin >= 1.5 has /proc/self/maps and the getline() function too. */
164−+ Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
165−+ But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
166−+ Cygwin 1.7. */
167− FILE *fp;
168−
169− /* Open the current process' maps file. It describes one VMA per line. */
170−@@ -405,7 +418,7 @@
171− const char *
172− relocate (const char *pathname)
173− {
174−-#if defined PIC && defined INSTALLDIR
175−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
176− static int initialized;
177−
178− /* Initialization code for a shared library. */
179−--- libiconv-1.14/srclib/relocatable.c 2011-08-07 09:42:06.000000000 -0400
180−+++ libiconv-1.14/srclib/relocatable.c 2011-10-15 03:14:37.739133600 -0400
181−@@ -3,16 +3,16 @@
182− Written by Bruno Haible <bruno@clisp.org>, 2003.
183−
184− This program is free software: you can redistribute it and/or modify
185−- it under the terms of the GNU General Public License as published by
186−- the Free Software Foundation; either version 3 of the License, or
187−+ it under the terms of the GNU Lesser General Public License as published by
188−+ the Free Software Foundation; either version 2.1 of the License, or
189− (at your option) any later version.
190−
191− This program is distributed in the hope that it will be useful,
192− but WITHOUT ANY WARRANTY; without even the implied warranty of
193− MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
194−- GNU General Public License for more details.
195−+ GNU Lesser General Public License for more details.
196−
197−- You should have received a copy of the GNU General Public License
198−+ You should have received a copy of the GNU Lesser General Public License
199− along with this program. If not, see <http://www.gnu.org/licenses/>. */
200−
201−
202−@@ -85,6 +85,19 @@
203− # define FILE_SYSTEM_PREFIX_LEN(P) 0
204− #endif
205−
206−+/* Whether to enable the more costly support for relocatable libraries.
207−+ It allows libraries to be have been installed with a different original
208−+ prefix than the program. But it is quite costly, especially on Cygwin
209−+ platforms, see below. Therefore we enable it by default only on native
210−+ Win32 platforms. */
211−+#ifndef ENABLE_COSTLY_RELOCATABLE
212−+# if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
213−+# define ENABLE_COSTLY_RELOCATABLE 1
214−+# else
215−+# define ENABLE_COSTLY_RELOCATABLE 0
216−+# endif
217−+#endif
218−+
219− /* Original installation prefix. */
220− static char *orig_prefix;
221− static size_t orig_prefix_len;
222−@@ -154,7 +167,7 @@
223− #endif
224− }
225−
226−-#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR)
227−+#if !defined IN_LIBRARY || (defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE)
228−
229− /* Convenience function:
230− Computes the current installation prefix, based on the original
231−@@ -284,7 +297,7 @@
232−
233− #endif /* !IN_LIBRARY || PIC */
234−
235−-#if defined PIC && defined INSTALLDIR
236−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
237−
238− /* Full pathname of shared library, or NULL. */
239− static char *shared_library_fullname;
240−@@ -330,7 +343,9 @@
241− #if (defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)) || defined __CYGWIN__
242− /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
243− function.
244−- Cygwin >= 1.5 has /proc/self/maps and the getline() function too. */
245−+ Cygwin >= 1.5 has /proc/self/maps and the getline() function too.
246−+ But it is costly: ca. 0.3 ms on Linux, 3 ms on Cygwin 1.5, and 5 ms on
247−+ Cygwin 1.7. */
248− FILE *fp;
249−
250− /* Open the current process' maps file. It describes one VMA per line. */
251−@@ -403,7 +418,7 @@
252− const char *
253− relocate (const char *pathname)
254− {
255−-#if defined PIC && defined INSTALLDIR
256−+#if defined PIC && defined INSTALLDIR && ENABLE_COSTLY_RELOCATABLE
257− static int initialized;
258−
259− /* Initialization code for a shared library. */
260−--- libiconv-1.14/srcm4/gnulib-comp.m4 2011-08-07 09:42:12.000000000 -0400
261−+++ libiconv-1.14/srcm4/gnulib-comp.m4 2011-08-30 02:40:45.597317000 -0400
262−@@ -164,6 +164,7 @@ gl_UNISTD_MODULE_INDICATOR([readlink])
263− gl_RELOCATABLE([$gl_source_base])
264− if test $RELOCATABLE = yes; then
265− AC_LIBOBJ([progreloc])
266−+ AC_LIBOBJ([relocatable])
267− fi
268− gl_FUNC_READLINK_SEPARATE
269− gl_CANONICALIZE_LGPL_SEPARATE
pkgs/development/libraries/libiconv/libiconv-1.14-wchar.patchdeleted−102
@@ -1,102 +0,0 @@
1−--- libiconv-1.14/libcharset/lib/localcharset.c 2011-02-28 17:43:35.000000000 -0500
2−+++ libiconv-1.14/libcharset/lib/localcharset.c 2011-08-28 00:16:57.238000000 -0400
3−@@ -54,10 +54,6 @@
4− # include <locale.h>
5− # endif
6− # endif
7−-# ifdef __CYGWIN__
8−-# define WIN32_LEAN_AND_MEAN
9−-# include <windows.h>
10−-# endif
11− #elif defined WIN32_NATIVE
12− # define WIN32_LEAN_AND_MEAN
13− # include <windows.h>
14−@@ -124,7 +120,7 @@
15− cp = charset_aliases;
16− if (cp == NULL)
17− {
18−-#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE || defined __CYGWIN__)
19−+#if !(defined DARWIN7 || defined VMS || defined WIN32_NATIVE)
20− const char *dir;
21− const char *base = "charset.alias";
22− char *file_name;
23−@@ -309,7 +305,7 @@
24− "DECKOREAN" "\0" "EUC-KR" "\0";
25− # endif
26−
27−-# if defined WIN32_NATIVE || defined __CYGWIN__
28−+# if defined WIN32_NATIVE
29− /* To avoid the troubles of installing a separate file in the same
30− directory as the DLL and of retrieving the DLL's directory at
31− runtime, simply inline the aliases here. */
32−@@ -365,64 +361,12 @@
33−
34− # if HAVE_LANGINFO_CODESET
35−
36−- /* Most systems support nl_langinfo (CODESET) nowadays. */
37−- codeset = nl_langinfo (CODESET);
38−-
39−-# ifdef __CYGWIN__
40−- /* Cygwin < 1.7 does not have locales. nl_langinfo (CODESET) always
41−- returns "US-ASCII". Return the suffix of the locale name from the
42−- environment variables (if present) or the codepage as a number. */
43−- if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
44−- {
45−- const char *locale;
46−- static char buf[2 + 10 + 1];
47−-
48−- locale = getenv ("LC_ALL");
49−- if (locale == NULL || locale[0] == '\0')
50−- {
51−- locale = getenv ("LC_CTYPE");
52−- if (locale == NULL || locale[0] == '\0')
53−- locale = getenv ("LANG");
54−- }
55−- if (locale != NULL && locale[0] != '\0')
56−- {
57−- /* If the locale name contains an encoding after the dot, return
58−- it. */
59−- const char *dot = strchr (locale, '.');
60−-
61−- if (dot != NULL)
62−- {
63−- const char *modifier;
64−-
65−- dot++;
66−- /* Look for the possible @... trailer and remove it, if any. */
67−- modifier = strchr (dot, '@');
68−- if (modifier == NULL)
69−- return dot;
70−- if (modifier - dot < sizeof (buf))
71−- {
72−- memcpy (buf, dot, modifier - dot);
73−- buf [modifier - dot] = '\0';
74−- return buf;
75−- }
76−- }
77−- }
78−-
79−- /* Woe32 has a function returning the locale's codepage as a number:
80−- GetACP(). This encoding is used by Cygwin, unless the user has set
81−- the environment variable CYGWIN=codepage:oem (which very few people
82−- do).
83−- Output directed to console windows needs to be converted (to
84−- GetOEMCP() if the console is using a raster font, or to
85−- GetConsoleOutputCP() if it is using a TrueType font). Cygwin does
86−- this conversion transparently (see winsup/cygwin/fhandler_console.cc),
87−- converting to GetConsoleOutputCP(). This leads to correct results,
88−- except when SetConsoleOutputCP has been called and a raster font is
89−- in use. */
90−- sprintf (buf, "CP%u", GetACP ());
91−- codeset = buf;
92−- }
93−-# endif
94−+ /* Most systems support nl_langinfo (CODESET) nowadays.
95−+ POSIX allows that the returned pointer may point to a static area that
96−+ may be overwritten by subsequent calls to setlocale or nl_langinfo. */
97−+ static char codeset_buf[64];
98−+ codeset_buf[0] = '\0';
99−+ codeset = strncat (codeset_buf, nl_langinfo (CODESET), sizeof (codeset_buf));
100−
101− # else
102−