From d8a2ae8d01b6839d8e88b9a8e822d4a190409a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 14 Apr 2013 13:27:58 +0200 Subject: [PATCH] some libintl and libiconv cleanups + non-linux fixes --- pkgs/development/compilers/vala/default.nix | 4 ++-- pkgs/development/libraries/cairo/1.12.2.nix | 7 ++----- pkgs/development/libraries/cairo/default.nix | 9 +++------ pkgs/tools/typesetting/docbook2x/default.nix | 4 ++-- pkgs/top-level/all-packages.nix | 14 ++++++-------- 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/pkgs/development/compilers/vala/default.nix b/pkgs/development/compilers/vala/default.nix index 37867b6a36e3..13a0081a2574 100644 --- a/pkgs/development/compilers/vala/default.nix +++ b/pkgs/development/compilers/vala/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, yacc, flex, pkgconfig, glib, xz, libiconvOrEmpty }: +{ stdenv, fetchurl, yacc, flex, pkgconfig, glib, libintlOrEmpty }: stdenv.mkDerivation rec { @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ yacc flex pkgconfig ]; - buildInputs = [ glib ] ++ libiconvOrEmpty; + buildInputs = [ glib ] ++ libintlOrEmpty; meta = { description = "Compiler for the GObject type system"; diff --git a/pkgs/development/libraries/cairo/1.12.2.nix b/pkgs/development/libraries/cairo/1.12.2.nix index 254998b6e7a1..18195017c0fb 100644 --- a/pkgs/development/libraries/cairo/1.12.2.nix +++ b/pkgs/development/libraries/cairo/1.12.2.nix @@ -5,7 +5,7 @@ , gobjectSupport ? true, glib , stdenv, fetchurl, pkgconfig, x11, fontconfig, freetype, xlibs , zlib, libpng, pixman, libxcb ? null, xcbutil ? null -, gettext, libiconvOrEmpty +, libiconvOrEmpty, libintlOrEmpty }: assert postscriptSupport -> zlib != null; @@ -23,10 +23,7 @@ stdenv.mkDerivation rec { buildInputs = [ pkgconfig x11 fontconfig xlibs.libXrender ] ++ stdenv.lib.optionals xcbSupport [ libxcb xcbutil ] - - # On non-GNU systems we need GNU Gettext for libintl. - ++ stdenv.lib.optional (!stdenv.isLinux) gettext - + ++ libintlOrEmpty ++ libiconvOrEmpty; propagatedBuildInputs = diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix index 72ea24c9f8ad..8c9f55426d53 100644 --- a/pkgs/development/libraries/cairo/default.nix +++ b/pkgs/development/libraries/cairo/default.nix @@ -5,7 +5,7 @@ , gobjectSupport ? true, glib , stdenv, fetchurl, pkgconfig, x11, fontconfig, freetype, xlibs , zlib, libpng, pixman, libxcb ? null, xcbutil ? null -, gettext, libiconvOrEmpty +, libiconvOrEmpty, libintlOrEmpty }: assert postscriptSupport -> zlib != null; @@ -21,13 +21,10 @@ stdenv.mkDerivation rec { }; buildInputs = - [ pkgconfig x11 fontconfig ] + [ pkgconfig x11 fontconfig ] ++ stdenv.lib.optional (!stdenv.isDarwin) xlibs.libXrender ++ stdenv.lib.optionals xcbSupport [ libxcb xcbutil ] - - # On non-GNU systems we need GNU Gettext for libintl. - ++ stdenv.lib.optional (!stdenv.isLinux) gettext - + ++ libintlOrEmpty ++ libiconvOrEmpty; propagatedBuildInputs = diff --git a/pkgs/tools/typesetting/docbook2x/default.nix b/pkgs/tools/typesetting/docbook2x/default.nix index 00dbe22aed35..d7d3f6f92a22 100644 --- a/pkgs/tools/typesetting/docbook2x/default.nix +++ b/pkgs/tools/typesetting/docbook2x/default.nix @@ -1,6 +1,6 @@ { fetchurl, stdenv, texinfo, perl , XMLSAX, XMLParser, XMLNamespaceSupport -, groff, libxml2, libxslt, gnused, libiconv, opensp +, groff, libxml2, libxslt, gnused, libiconvOrEmpty, opensp , docbook_xml_dtd_43 , makeWrapper }: @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { buildInputs = [ perl texinfo groff libxml2 libxslt makeWrapper XMLSAX XMLParser XMLNamespaceSupport opensp - ] ++ (if libiconv != null then [libiconv] else []); + ] ++ libiconvOrEmpty; postConfigure = '' # Broken substitution is used for `perl/config.pl', which leaves literal diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 60ffd7a2d4dd..0caed27517da 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -689,7 +689,6 @@ let docbook2x = callPackage ../tools/typesetting/docbook2x { inherit (perlPackages) XMLSAX XMLParser XMLNamespaceSupport; - libiconv = if stdenv.isDarwin then libiconv else null; }; dosfstools = callPackage ../tools/filesystems/dosfstools { }; @@ -847,13 +846,9 @@ let guile = guile_1_8; }; - gnugrep = - # Use libiconv only on non-GNU platforms (we can't test with - # `stdenv ? glibc' at this point.) - let gnu = stdenv.isLinux; in - callPackage ../tools/text/gnugrep { - libiconv = if gnu then null else libiconv; - }; + gnugrep = callPackage ../tools/text/gnugrep { + libiconv = libiconvOrNull; + }; gnulib = callPackage ../development/tools/gnulib { }; @@ -4325,6 +4320,9 @@ let libiconvOrLibc = if libiconvOrNull == null then gcc.libc else libiconv; + # On non-GNU systems we need GNU Gettext for libintl. + libintlOrEmpty = stdenv.lib.optional (!stdenv.isLinux) gettext; + libid3tag = callPackage ../development/libraries/libid3tag { }; libidn = callPackage ../development/libraries/libidn { };