1 { fetchurl, stdenv, lib
2 , enableStatic ? stdenv.hostPlatform.isStatic
3 , enableShared ? !stdenv.hostPlatform.isStatic
6 # assert !stdenv.hostPlatform.isLinux || stdenv.hostPlatform != stdenv.buildPlatform; # TODO: improve on cross
8 stdenv.mkDerivation rec {
13 url = "mirror://gnu/libiconv/${pname}-${version}.tar.gz";
14 sha256 = "016c57srqr0bza5fxjxfrx6aqxkqy0s3gkhcg7p7fhk5i6sv38g6";
18 ../../../build-support/setup-hooks/role.bash
23 lib.optionalString ((stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc)
25 sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h
27 + lib.optionalString (!enableShared) ''
28 sed -i -e '/preload/d' Makefile.in
32 (lib.enableFeature enableStatic "static")
33 (lib.enableFeature enableShared "shared")
34 ] ++ lib.optional stdenv.isFreeBSD "--with-pic";
37 description = "An iconv(3) implementation";
40 Some programs, like mailers and web browsers, must be able to convert
41 between a given text encoding and the user's encoding. Other programs
42 internally store strings in Unicode, to facilitate internal processing,
43 and need to convert between internal string representation (Unicode)
44 and external string representation (a traditional encoding) when they
45 are doing I/O. GNU libiconv is a conversion library for both kinds of
49 homepage = "https://www.gnu.org/software/libiconv/";
50 license = lib.licenses.lgpl2Plus;
54 # This library is not needed on GNU platforms.
55 hydraPlatforms = with lib.platforms; cygwin ++ darwin ++ freebsd;