diff options
author | David Johnson <djohnson.m@gmail.com> | 2017-02-04 11:19:14 -0600 |
---|---|---|
committer | David Johnson <djohnson.m@gmail.com> | 2017-03-10 19:31:12 -0600 |
commit | 26623240e93f8454ac69f66a3a025d98a7e94b71 (patch) | |
tree | e929462cc37cde5d489f87bcf3bbe40be5b5f601 /pkgs/development/haskell-modules/generic-builder.nix | |
parent | 2839b101f927be5daab7948421de00a6f6c084ae (diff) | |
download | nixlib-26623240e93f8454ac69f66a3a025d98a7e94b71.tar nixlib-26623240e93f8454ac69f66a3a025d98a7e94b71.tar.gz nixlib-26623240e93f8454ac69f66a3a025d98a7e94b71.tar.bz2 nixlib-26623240e93f8454ac69f66a3a025d98a7e94b71.tar.lz nixlib-26623240e93f8454ac69f66a3a025d98a7e94b71.tar.xz nixlib-26623240e93f8454ac69f66a3a025d98a7e94b71.tar.zst nixlib-26623240e93f8454ac69f66a3a025d98a7e94b71.zip |
Init HaLVM at 2.4.0
Diffstat (limited to 'pkgs/development/haskell-modules/generic-builder.nix')
-rw-r--r-- | pkgs/development/haskell-modules/generic-builder.nix | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index e47375e71c73..64924f7252e0 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -66,7 +66,8 @@ let concatStringsSep enableFeature optionalAttrs toUpper; isGhcjs = ghc.isGhcjs or false; - packageDbFlag = if isGhcjs || versionOlder "7.6" ghc.version + isHaLVM = ghc.isHaLVM or false; + packageDbFlag = if isGhcjs || isHaLVM || versionOlder "7.6" ghc.version then "package-db" else "package-conf"; @@ -99,16 +100,15 @@ let "--with-ghc-pkg=${ghc.cross.config}-ghc-pkg" "--with-gcc=${ghc.cc}" "--with-ld=${ghc.ld}" - "--hsc2hs-options=--cross-compile" "--with-hsc2hs=${nativeGhc}/bin/hsc2hs" - ]; + ] ++ (if isHaLVM then [] else ["--hsc2hs-options=--cross-compile"]); crossCabalFlagsString = stdenv.lib.optionalString isCross (" " + stdenv.lib.concatStringsSep " " crossCabalFlags); defaultConfigureFlags = [ "--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/\\$compiler" "--libsubdir=\\$pkgid" - "--with-gcc=$CC" # Clang won't work without that extra information. + "--with-gcc=$CC" # Clang won't work without that extra information. "--package-db=$packageConfDir" (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}") (optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names") @@ -133,8 +133,9 @@ let setupCompileFlags = [ (optionalString (!coreSetup) "-${packageDbFlag}=$packageConfDir") - (optionalString (isGhcjs || versionOlder "7.8" ghc.version) "-j$NIX_BUILD_CORES") - (optionalString (versionOlder "7.10" ghc.version) "-threaded") # https://github.com/haskell/cabal/issues/2398 + (optionalString (isGhcjs || isHaLVM || versionOlder "7.8" ghc.version) "-j$NIX_BUILD_CORES") + # https://github.com/haskell/cabal/issues/2398 + (optionalString (versionOlder "7.10" ghc.version && !isHaLVM) "-threaded") ]; isHaskellPkg = x: (x ? pname) && (x ? version) && (x ? env); @@ -319,11 +320,10 @@ stdenv.mkDerivation ({ export NIX_${ghcCommandCaps}="${ghcEnv}/bin/${ghcCommand}" export NIX_${ghcCommandCaps}PKG="${ghcEnv}/bin/${ghcCommand}-pkg" export NIX_${ghcCommandCaps}_DOCDIR="${ghcEnv}/share/doc/ghc/html" - export NIX_${ghcCommandCaps}_LIBDIR="${ghcEnv}/lib/${ghcCommand}-${ghc.version}" - ${shellHook} - ''; + '' + (if isHaLVM + then ''export NIX_${ghcCommandCaps}_LIBDIR="${ghcEnv}/lib/HaLVM-${ghc.version}"'' + else ''export NIX_${ghcCommandCaps}_LIBDIR="${ghcEnv}/lib/${ghcCommand}-${ghc.version}"'') + "${shellHook}"; }; - }; meta = { inherit homepage license platforms; } |