2017-06-28 20:14:36 +00:00
|
|
|
{ fetchurl, stdenv, lib
|
2020-12-20 06:11:26 +00:00
|
|
|
, enableStatic ? stdenv.hostPlatform.isStatic
|
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
2017-06-28 20:14:36 +00:00
|
|
|
}:
|
2009-09-19 22:03:24 +00:00
|
|
|
|
2018-08-20 18:43:41 +00:00
|
|
|
# assert !stdenv.hostPlatform.isLinux || stdenv.hostPlatform != stdenv.buildPlatform; # TODO: improve on cross
|
2014-11-22 20:13:13 +00:00
|
|
|
|
2012-11-29 13:10:49 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "libiconv";
|
2019-05-01 06:29:52 +00:00
|
|
|
version = "1.16";
|
2009-09-19 22:03:24 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "mirror://gnu/libiconv/${pname}-${version}.tar.gz";
|
2019-05-01 06:29:52 +00:00
|
|
|
sha256 = "016c57srqr0bza5fxjxfrx6aqxkqy0s3gkhcg7p7fhk5i6sv38g6";
|
2009-09-19 22:03:24 +00:00
|
|
|
};
|
|
|
|
|
2018-05-07 17:07:19 +00:00
|
|
|
setupHooks = [
|
|
|
|
../../../build-support/setup-hooks/role.bash
|
|
|
|
./setup-hook.sh
|
|
|
|
];
|
2018-03-14 19:14:46 +00:00
|
|
|
|
2016-02-09 14:23:16 +00:00
|
|
|
postPatch =
|
2018-08-20 18:43:41 +00:00
|
|
|
lib.optionalString ((stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc)
|
2016-02-09 14:23:16 +00:00
|
|
|
''
|
|
|
|
sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h
|
2018-06-23 01:49:41 +00:00
|
|
|
''
|
|
|
|
+ lib.optionalString (!enableShared) ''
|
|
|
|
sed -i -e '/preload/d' Makefile.in
|
|
|
|
'';
|
2016-02-09 14:23:16 +00:00
|
|
|
|
2018-07-03 20:51:30 +00:00
|
|
|
configureFlags = [
|
|
|
|
(lib.enableFeature enableStatic "static")
|
|
|
|
(lib.enableFeature enableShared "shared")
|
|
|
|
] ++ lib.optional stdenv.isFreeBSD "--with-pic";
|
2012-11-29 13:10:49 +00:00
|
|
|
|
2009-09-19 22:03:24 +00:00
|
|
|
meta = {
|
2014-08-24 14:21:08 +00:00
|
|
|
description = "An iconv(3) implementation";
|
2009-09-19 22:03:24 +00: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-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.gnu.org/software/libiconv/";
|
2015-12-30 08:54:36 +00:00
|
|
|
license = lib.licenses.lgpl2Plus;
|
2009-09-19 22:03:24 +00:00
|
|
|
|
2013-08-16 21:44:33 +00:00
|
|
|
maintainers = [ ];
|
2009-09-19 22:03:24 +00:00
|
|
|
|
|
|
|
# This library is not needed on GNU platforms.
|
2015-12-30 08:54:36 +00:00
|
|
|
hydraPlatforms = with lib.platforms; cygwin ++ darwin ++ freebsd;
|
2009-09-19 22:03:24 +00:00
|
|
|
};
|
|
|
|
}
|