about summary refs log tree commit diff
path: root/pkgs/development/compilers/ghc
diff options
context:
space:
mode:
authorGuillaume Bouchard <guillaume.bouchard@tweag.io>2019-02-04 13:49:51 +0100
committerPeter Simons <simons@cryp.to>2019-02-12 13:40:59 +0100
commita7c774300b7eab779afb9a81b3f02f3bed69c943 (patch)
tree1e4c66e0a27f908f37636ca6264ca5740c89faaa /pkgs/development/compilers/ghc
parent7f32b3db305443fe9d5eebd76a6f6497b2784534 (diff)
downloadnixlib-a7c774300b7eab779afb9a81b3f02f3bed69c943.tar
nixlib-a7c774300b7eab779afb9a81b3f02f3bed69c943.tar.gz
nixlib-a7c774300b7eab779afb9a81b3f02f3bed69c943.tar.bz2
nixlib-a7c774300b7eab779afb9a81b3f02f3bed69c943.tar.lz
nixlib-a7c774300b7eab779afb9a81b3f02f3bed69c943.tar.xz
nixlib-a7c774300b7eab779afb9a81b3f02f3bed69c943.tar.zst
nixlib-a7c774300b7eab779afb9a81b3f02f3bed69c943.zip
ghc-8.6.3: use system `libffi`
Use the system `libffi` (`ie` nixpkgs's) instead of built-in libffi
from ghc source tree.

This will prevent library conflict when ghc dynamically links haskell
packages (linked with ghc built-in libffi) and any external library
which uses nixpkgs `libffi`.

Closes https://github.com/NixOS/nixpkgs/pull/55208.
Diffstat (limited to 'pkgs/development/compilers/ghc')
-rw-r--r--pkgs/development/compilers/ghc/8.6.3.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkgs/development/compilers/ghc/8.6.3.nix b/pkgs/development/compilers/ghc/8.6.3.nix
index 4e1f0dd9fc72..c57e4d96ae2e 100644
--- a/pkgs/development/compilers/ghc/8.6.3.nix
+++ b/pkgs/development/compilers/ghc/8.6.3.nix
@@ -6,6 +6,9 @@
 
 , libiconv ? null, ncurses
 
+, # GHC can be built with system libffi or a bundled one.
+  libffi ? null
+
 , useLLVM ? !stdenv.targetPlatform.isx86 || (stdenv.targetPlatform.isMusl && stdenv.hostPlatform != stdenv.targetPlatform)
 , # LLVM is conceptually a run-time-only depedendency, but for
   # non-x86, we need LLVM to bootstrap later stages, so it becomes a
@@ -65,6 +68,7 @@ let
 
   # Splicer will pull out correct variations
   libDeps = platform: stdenv.lib.optional enableTerminfo [ ncurses ]
+    ++ [libffi]
     ++ stdenv.lib.optional (!enableIntegerSimple) gmp
     ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
 
@@ -149,6 +153,7 @@ stdenv.mkDerivation (rec {
   configureFlags = [
     "--datadir=$doc/share/doc/ghc"
     "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
+  ] ++ stdenv.lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${libffi}/include" "--with-ffi-libraries=${libffi}/lib"
   ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && !enableIntegerSimple) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
   ] ++ stdenv.lib.optional (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [