diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2018-12-02 14:26:53 -0600 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2018-12-05 13:17:40 -0600 |
commit | 7a00e80329b5ff9673f6a2282f98db7903af7d3f (patch) | |
tree | 1463aa7ed5df579a07a1a543a4fbe53bdfc147af | |
parent | a9d153633e15a38a661be91f81cfbd22d0c49be6 (diff) |
ghc: don’t add libiconv automatically
ghc needs it to fail to correctly detect it for later.
-rw-r--r-- | doc/stdenv.xml | 17 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.2.2.nix | 3 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.4.4.nix | 3 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.6.1.nix | 3 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/8.6.2.nix | 3 | ||||
-rw-r--r-- | pkgs/development/compilers/ghc/head.nix | 3 | ||||
-rw-r--r-- | pkgs/development/libraries/gettext/gettext-setup-hook.sh | 2 | ||||
-rw-r--r-- | pkgs/development/libraries/libiconv/setup-hook.sh | 6 |
8 files changed, 37 insertions, 3 deletions
diff --git a/doc/stdenv.xml b/doc/stdenv.xml index 26190debc29b..4ef89991d2f2 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -2527,6 +2527,23 @@ addEnvHooks "$hostOffset" myBashFunction </varlistentry> <varlistentry> <term> + libiconv, libintl + </term> + <listitem> + <para> + A few libraries automatically add to + <literal>NIX_LDFLAGS</literal> their library, making their + symbols automatically available to the linker. This includes + libiconv and libintl (gettext). This is done to provide + compatibility between GNU Linux, where libiconv and libintl + are bundled in, and other systems where that might not be the + case. Sometimes, this behavior is not desired. To disable + this behavior, set <literal>dontAddExtraLibs</literal>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term> cmake </term> <listitem> diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix index 3ecea2b54edb..3b9fecd55e10 100644 --- a/pkgs/development/compilers/ghc/8.2.2.nix +++ b/pkgs/development/compilers/ghc/8.2.2.nix @@ -206,6 +206,9 @@ stdenv.mkDerivation (rec { "--disable-large-address-space" ]; + # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself. + dontAddExtraLibs = true; + # Make sure we never relax`$PATH` and hooks support for compatability. strictDeps = true; diff --git a/pkgs/development/compilers/ghc/8.4.4.nix b/pkgs/development/compilers/ghc/8.4.4.nix index 1ea18149d1ef..4db5c07b4601 100644 --- a/pkgs/development/compilers/ghc/8.4.4.nix +++ b/pkgs/development/compilers/ghc/8.4.4.nix @@ -186,6 +186,9 @@ stdenv.mkDerivation (rec { # Make sure we never relax`$PATH` and hooks support for compatability. strictDeps = true; + # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself. + dontAddExtraLibs = true; + nativeBuildInputs = [ perl autoconf automake m4 python3 sphinx ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour diff --git a/pkgs/development/compilers/ghc/8.6.1.nix b/pkgs/development/compilers/ghc/8.6.1.nix index 434570fe9889..5710c60338a8 100644 --- a/pkgs/development/compilers/ghc/8.6.1.nix +++ b/pkgs/development/compilers/ghc/8.6.1.nix @@ -167,6 +167,9 @@ stdenv.mkDerivation (rec { # Make sure we never relax`$PATH` and hooks support for compatability. strictDeps = true; + # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself. + dontAddExtraLibs = true; + nativeBuildInputs = [ perl autoconf automake m4 python3 sphinx ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour diff --git a/pkgs/development/compilers/ghc/8.6.2.nix b/pkgs/development/compilers/ghc/8.6.2.nix index 85853e158327..914d6ae08fac 100644 --- a/pkgs/development/compilers/ghc/8.6.2.nix +++ b/pkgs/development/compilers/ghc/8.6.2.nix @@ -167,6 +167,9 @@ stdenv.mkDerivation (rec { # Make sure we never relax`$PATH` and hooks support for compatability. strictDeps = true; + # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself. + dontAddExtraLibs = true; + nativeBuildInputs = [ perl autoconf automake m4 python3 sphinx ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 29de668767b8..42119682892d 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -149,6 +149,9 @@ stdenv.mkDerivation (rec { # Make sure we never relax`$PATH` and hooks support for compatability. strictDeps = true; + # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself. + dontAddExtraLibs = true; + nativeBuildInputs = [ perl autoconf automake m4 python3 ghc bootPkgs.alex bootPkgs.happy bootPkgs.hscolour diff --git a/pkgs/development/libraries/gettext/gettext-setup-hook.sh b/pkgs/development/libraries/gettext/gettext-setup-hook.sh index 0a6bc0dd253a..ad3763c29b64 100644 --- a/pkgs/development/libraries/gettext/gettext-setup-hook.sh +++ b/pkgs/development/libraries/gettext/gettext-setup-hook.sh @@ -10,7 +10,7 @@ addEnvHooks "$hostOffset" gettextDataDirsHook # libintl must be listed in load flags on non-Glibc # it doesn't hurt to have it in Glibc either though -if [ ! -z "@gettextNeedsLdflags@" ]; then +if [ -n "@gettextNeedsLdflags@" -a -z "$dontAddExtraLibs" ]; then # See pkgs/build-support/setup-hooks/role.bash getHostRole export NIX_${role_pre}LDFLAGS+=" -lintl" diff --git a/pkgs/development/libraries/libiconv/setup-hook.sh b/pkgs/development/libraries/libiconv/setup-hook.sh index d20e94513e26..f89361a62998 100644 --- a/pkgs/development/libraries/libiconv/setup-hook.sh +++ b/pkgs/development/libraries/libiconv/setup-hook.sh @@ -2,5 +2,7 @@ # it doesn't hurt to have it in Glibc either though # See pkgs/build-support/setup-hooks/role.bash -getHostRole -export NIX_${role_pre}LDFLAGS+=" -liconv" +if [ -z "$dontAddExtraLibs" ]; then + getHostRole + export NIX_${role_pre}LDFLAGS+=" -liconv" +fi |