1{ fetchurl, stdenv, lib
2, buildPlatform, hostPlatform
3, enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt
4}:
5
6# assert !stdenv.isLinux || hostPlatform != buildPlatform; # TODO: improve on cross
7
8stdenv.mkDerivation rec {
9 name = "libiconv-${version}";
10 version = "1.15";
11
12 src = fetchurl {
13 url = "mirror://gnu/libiconv/${name}.tar.gz";
14 sha256 = "0y1ij745r4p48mxq84rax40p10ln7fc7m243p8k8sia519i3dxfc";
15 };
16
17 postPatch =
18 lib.optionalString ((hostPlatform != buildPlatform && hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc)
19 ''
20 sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h
21 '';
22
23 configureFlags = lib.optional stdenv.isFreeBSD "--with-pic"
24 ++ lib.optional enableStatic "--enable-static";
25
26 meta = {
27 description = "An iconv(3) implementation";
28
29 longDescription = ''
30 Some programs, like mailers and web browsers, must be able to convert
31 between a given text encoding and the user's encoding. Other programs
32 internally store strings in Unicode, to facilitate internal processing,
33 and need to convert between internal string representation (Unicode)
34 and external string representation (a traditional encoding) when they
35 are doing I/O. GNU libiconv is a conversion library for both kinds of
36 applications.
37 '';
38
39 homepage = http://www.gnu.org/software/libiconv/;
40 license = lib.licenses.lgpl2Plus;
41
42 maintainers = [ ];
43
44 # This library is not needed on GNU platforms.
45 hydraPlatforms = with lib.platforms; cygwin ++ darwin ++ freebsd;
46 };
47}