2017-06-28 13:14:36 -07:00
|
|
|
{ fetchurl, stdenv, lib
|
2020-12-19 22:11:26 -08:00
|
|
|
, enableStatic ? stdenv.hostPlatform.isStatic
|
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
2017-06-28 13:14:36 -07:00
|
|
|
}:
|
2009-09-19 15:03:24 -07:00
|
|
|
|
2018-08-20 11:43:41 -07:00
|
|
|
# assert !stdenv.hostPlatform.isLinux || stdenv.hostPlatform != stdenv.buildPlatform; # TODO: improve on cross
|
2014-11-22 12:13:13 -08:00
|
|
|
|
2012-11-29 05:10:49 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "libiconv";
|
2019-04-30 23:29:52 -07:00
|
|
|
version = "1.16";
|
2009-09-19 15:03:24 -07:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 05:41:18 -07:00
|
|
|
url = "mirror://gnu/libiconv/${pname}-${version}.tar.gz";
|
2019-04-30 23:29:52 -07:00
|
|
|
sha256 = "016c57srqr0bza5fxjxfrx6aqxkqy0s3gkhcg7p7fhk5i6sv38g6";
|
2009-09-19 15:03:24 -07:00
|
|
|
};
|
|
|
|
|
2018-05-07 10:07:19 -07:00
|
|
|
setupHooks = [
|
|
|
|
../../../build-support/setup-hooks/role.bash
|
|
|
|
./setup-hook.sh
|
|
|
|
];
|
2018-03-14 12:14:46 -07:00
|
|
|
|
2016-02-09 06:23:16 -08:00
|
|
|
postPatch =
|
2018-08-20 11:43:41 -07:00
|
|
|
lib.optionalString ((stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc)
|
2016-02-09 06:23:16 -08:00
|
|
|
''
|
|
|
|
sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h
|
2018-06-22 18:49:41 -07:00
|
|
|
''
|
|
|
|
+ lib.optionalString (!enableShared) ''
|
|
|
|
sed -i -e '/preload/d' Makefile.in
|
|
|
|
'';
|
2016-02-09 06:23:16 -08:00
|
|
|
|
2018-07-03 13:51:30 -07:00
|
|
|
configureFlags = [
|
|
|
|
(lib.enableFeature enableStatic "static")
|
|
|
|
(lib.enableFeature enableShared "shared")
|
|
|
|
] ++ lib.optional stdenv.isFreeBSD "--with-pic";
|
2012-11-29 05:10:49 -08:00
|
|
|
|
2009-09-19 15:03:24 -07:00
|
|
|
meta = {
|
2014-08-24 07:21:08 -07:00
|
|
|
description = "An iconv(3) implementation";
|
2009-09-19 15:03:24 -07:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
Some programs, like mailers and web browsers, must be able to convert
|
|
|
|
between a given text encoding and the user's encoding. Other programs
|
|
|
|
internally store strings in Unicode, to facilitate internal processing,
|
|
|
|
and need to convert between internal string representation (Unicode)
|
|
|
|
and external string representation (a traditional encoding) when they
|
|
|
|
are doing I/O. GNU libiconv is a conversion library for both kinds of
|
|
|
|
applications.
|
|
|
|
'';
|
|
|
|
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://www.gnu.org/software/libiconv/";
|
2015-12-30 00:54:36 -08:00
|
|
|
license = lib.licenses.lgpl2Plus;
|
2009-09-19 15:03:24 -07:00
|
|
|
|
2013-08-16 14:44:33 -07:00
|
|
|
maintainers = [ ];
|
2009-09-19 15:03:24 -07:00
|
|
|
|
|
|
|
# This library is not needed on GNU platforms.
|
2015-12-30 00:54:36 -08:00
|
|
|
hydraPlatforms = with lib.platforms; cygwin ++ darwin ++ freebsd;
|
2009-09-19 15:03:24 -07:00
|
|
|
};
|
|
|
|
}
|