2017-06-28 21:14:36 +01:00
|
|
|
{ fetchurl, stdenv, lib
|
2018-02-20 23:23:00 +00:00
|
|
|
, enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt
|
2018-06-23 02:49:41 +01:00
|
|
|
, enableShared ? !stdenv.hostPlatform.useAndroidPrebuilt
|
2017-06-28 21:14:36 +01:00
|
|
|
}:
|
2009-09-19 23:03:24 +01:00
|
|
|
|
2018-08-20 19:43:41 +01: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 13:41:18 +01:00
|
|
|
pname = "libiconv";
|
2019-05-01 07:29:52 +01:00
|
|
|
version = "1.16";
|
2009-09-19 23:03:24 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "mirror://gnu/libiconv/${pname}-${version}.tar.gz";
|
2019-05-01 07:29:52 +01:00
|
|
|
sha256 = "016c57srqr0bza5fxjxfrx6aqxkqy0s3gkhcg7p7fhk5i6sv38g6";
|
2009-09-19 23:03:24 +01:00
|
|
|
};
|
|
|
|
|
2018-05-07 18:07:19 +01: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 19:43:41 +01: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 02:49:41 +01:00
|
|
|
''
|
|
|
|
+ lib.optionalString (!enableShared) ''
|
|
|
|
sed -i -e '/preload/d' Makefile.in
|
|
|
|
'';
|
2016-02-09 14:23:16 +00:00
|
|
|
|
2018-07-03 21:51:30 +01: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 23:03:24 +01:00
|
|
|
meta = {
|
2014-08-24 15:21:08 +01:00
|
|
|
description = "An iconv(3) implementation";
|
2009-09-19 23:03:24 +01: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.
|
|
|
|
'';
|
|
|
|
|
2018-12-01 18:22:13 +00:00
|
|
|
homepage = https://www.gnu.org/software/libiconv/;
|
2015-12-30 08:54:36 +00:00
|
|
|
license = lib.licenses.lgpl2Plus;
|
2009-09-19 23:03:24 +01:00
|
|
|
|
2013-08-16 22:44:33 +01:00
|
|
|
maintainers = [ ];
|
2009-09-19 23:03:24 +01: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 23:03:24 +01:00
|
|
|
};
|
|
|
|
}
|