diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2018-03-11 17:13:25 +0800 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2018-05-23 10:27:41 -0400 |
commit | a4d5dbd45dfe35ca93b32daedba1c25167701cb0 (patch) | |
tree | c9f9dc66604c431e438511eac449d5666fc567c2 /pkgs/development/haskell-modules | |
parent | 38fbdcc7267d84aa224a8711038caa2b8ef8a418 (diff) | |
download | nixlib-a4d5dbd45dfe35ca93b32daedba1c25167701cb0.tar nixlib-a4d5dbd45dfe35ca93b32daedba1c25167701cb0.tar.gz nixlib-a4d5dbd45dfe35ca93b32daedba1c25167701cb0.tar.bz2 nixlib-a4d5dbd45dfe35ca93b32daedba1c25167701cb0.tar.lz nixlib-a4d5dbd45dfe35ca93b32daedba1c25167701cb0.tar.xz nixlib-a4d5dbd45dfe35ca93b32daedba1c25167701cb0.tar.zst nixlib-a4d5dbd45dfe35ca93b32daedba1c25167701cb0.zip |
haskell generic builder: Disable static libs on Windows because no -staticlib
The reason why this does not work is not that we can't built static objects, we can, but we can't use `-staticlib` on GHC on windows. `-staticlib` rolls all dependencies into a combined archive. While this would work on windows if we used gnu ar and MRI script, GHC can't rely on GNU ar, and as such has a quick archive concatenation module for GNU and BSD archives only.
Diffstat (limited to 'pkgs/development/haskell-modules')
-rw-r--r-- | pkgs/development/haskell-modules/generic-builder.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index b0cf228f8c76..66c8c1fd3753 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -31,7 +31,7 @@ in , enableSharedExecutables ? false , enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version) , enableDeadCodeElimination ? (!stdenv.isDarwin) # TODO: use -dead_strip for darwin -, enableStaticLibraries ? true +, enableStaticLibraries ? !hostPlatform.isWindows , enableHsc2hsViaAsm ? hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4" , extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? [] , homepage ? "http://hackage.haskell.org/package/${pname}" @@ -68,6 +68,10 @@ in assert editedCabalFile != null -> revision != null; +# --enable-static does not work on windows. This is a bug in GHC. +# --enable-static will pass -staticlib to ghc, which only works for mach-o and elf. +assert hostPlatform.isWindows -> enableStaticLibraries == false; + let inherit (stdenv.lib) optional optionals optionalString versionOlder versionAtLeast |