@ -1,8 +1,10 @@
{ stdenv , fetchurl , libiconv }:
{ stdenv , fetchurl , libiconvOrEmpty }:
with { inherit ( stdenv . lib ) optionals optionalAttrs ; } ;
stdenv . mkDerivation ( rec {
name = " g e t t e x t - 0 . 1 8 . 1 . 1 " ;
src = fetchurl {
url = " m i r r o r : / / g n u / g e t t e x t / ${ name } . t a r . g z " ;
sha256 = " 1 s a 3 c h 1 2 q x a 4 h 3 y a 6 h k z 1 1 9 y c l c c c m i n c l 9 j 2 0 d h r d x 5 m y k p 3 b 4 k " ;
@ -11,7 +13,7 @@ stdenv.mkDerivation (rec {
patches = [ ./no-gets.patch ] ;
configureFlags = [ " - - d i s a b l e - c s h a r p " ]
++ ( stdenv . lib . optionals stdenv . isCygwin
++ ( optionals stdenv . isCygwin
[ # We have a static libiconv, so we can only build the static lib.
" - - d i s a b l e - s h a r e d " " - - e n a b l e - s t a t i c "
@ -19,9 +21,6 @@ stdenv.mkDerivation (rec {
" - - c o n f i g - c a c h e "
] ) ;
makeFlags = stdenv . lib . optionalString stdenv . isDarwin
" C F L A G S = - D _ F O R T I F Y _ S O U R C E = 0 " ;
# On cross building, gettext supposes that the wchar.h from libc
# does not fulfill gettext needs, so it tries to work with its
# own wchar.h file, which does not cope well with the system's
@ -33,12 +32,12 @@ stdenv.mkDerivation (rec {
fi
'' ;
buildInputs = stdenv . lib . optional ( ! stdenv . isLinux ) libiconv ;
buildInputs = libiconvOrEmpty ;
enableParallelBuilding = true ;
crossAttrs = {
buildInputs = stdenv . lib . optional ( stdenv . gccCross . libc ? libiconv )
buildInputs = optional ( stdenv . gccCross . libc ? libiconv )
stdenv . gccCross . libc . libiconv . crossDrv ;
# Gettext fails to guess the cross compiler
configureFlags = " C X X = ${ stdenv . cross . config } - g + + " ;
@ -73,9 +72,11 @@ stdenv.mkDerivation (rec {
} ;
}
//
// optionalAttrs stdenv . isDarwin {
makeFlags = " C F L A G S = - D _ F O R T I F Y _ S O U R C E = 0 " ;
}
stdenv . lib . optionalAttrs stdenv . isCygwin {
// optionalAttrs stdenv . isCygwin {
patchPhase =
# Make sure `error.c' gets compiled and is part of `libgettextlib.la'.
# This fixes: