about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libiconv
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/libiconv
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libiconv')
-rw-r--r--nixpkgs/pkgs/development/libraries/libiconv/default.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh8
2 files changed, 65 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libiconv/default.nix b/nixpkgs/pkgs/development/libraries/libiconv/default.nix
new file mode 100644
index 000000000000..92b6ec43d406
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiconv/default.nix
@@ -0,0 +1,57 @@
+{ fetchurl, stdenv, lib
+, enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt
+, enableShared ? !stdenv.hostPlatform.useAndroidPrebuilt
+}:
+
+# assert !stdenv.hostPlatform.isLinux || stdenv.hostPlatform != stdenv.buildPlatform; # TODO: improve on cross
+
+stdenv.mkDerivation rec {
+  name = "libiconv-${version}";
+  version = "1.15";
+
+  src = fetchurl {
+    url = "mirror://gnu/libiconv/${name}.tar.gz";
+    sha256 = "0y1ij745r4p48mxq84rax40p10ln7fc7m243p8k8sia519i3dxfc";
+  };
+
+  setupHooks = [
+    ../../../build-support/setup-hooks/role.bash
+    ./setup-hook.sh
+  ];
+
+  postPatch =
+    lib.optionalString ((stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc)
+      ''
+        sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h
+      ''
+    + lib.optionalString (!enableShared) ''
+      sed -i -e '/preload/d' Makefile.in
+    '';
+
+  configureFlags = [
+    (lib.enableFeature enableStatic "static")
+    (lib.enableFeature enableShared "shared")
+  ] ++ lib.optional stdenv.isFreeBSD "--with-pic";
+
+  meta = {
+    description = "An iconv(3) implementation";
+
+    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.
+    '';
+
+    homepage = https://www.gnu.org/software/libiconv/;
+    license = lib.licenses.lgpl2Plus;
+
+    maintainers = [ ];
+
+    # This library is not needed on GNU platforms.
+    hydraPlatforms = with lib.platforms; cygwin ++ darwin ++ freebsd;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh b/nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh
new file mode 100644
index 000000000000..f89361a62998
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh
@@ -0,0 +1,8 @@
+# libiconv must be listed in load flags on non-Glibc
+# it doesn't hurt to have it in Glibc either though
+
+# See pkgs/build-support/setup-hooks/role.bash
+if [ -z "$dontAddExtraLibs" ]; then
+    getHostRole
+    export NIX_${role_pre}LDFLAGS+=" -liconv"
+fi