diff options
author | Peter Simons <simons@cryp.to> | 2013-12-06 12:52:18 +0100 |
---|---|---|
committer | Peter Simons <simons@cryp.to> | 2013-12-10 20:41:36 +0100 |
commit | ea20904aefbb7a5bd865abd23b850ccb82e36342 (patch) | |
tree | a9f0bbdd85d79d0a4f153c1802801351dbae66af /pkgs/build-support | |
parent | 36cb2af0570889d57364b3b71f5526a536d41485 (diff) |
cabal: add support for the enableStaticLibrary flag to enable/disable building of static libraries
Disabling static libraries is supported only in GHC 7.7 or later.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/cabal/default.nix | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix index 9b6d8c4e80ede..14bd01c7346ed 100644 --- a/pkgs/build-support/cabal/default.nix +++ b/pkgs/build-support/cabal/default.nix @@ -4,6 +4,7 @@ , enableLibraryProfiling ? false , enableSharedLibraries ? false , enableSharedExecutables ? false +, enableStaticLibraries ? true , enableCheckPhase ? stdenv.lib.versionOlder "7.4" ghc.version }: @@ -25,6 +26,9 @@ assert enableSharedExecutables -> versionOlder "7.4" ghc.version; # Our GHC 6.10.x builds do not provide sharable versions of their core libraries. assert enableSharedLibraries -> versionOlder "6.12" ghc.version; +# Our GHC 6.10.x builds do not provide sharable versions of their core libraries. +assert !enableStaticLibraries -> versionOlder "7.7" ghc.version; + { mkDerivation = args : # arguments for the individual package, can modify the defaults @@ -128,6 +132,10 @@ assert enableSharedLibraries -> versionOlder "6.12" ghc.version; # and run any regression test suites the package might have doCheck = enableCheckPhase; + # pass the '--enable-library-vanilla' flag to cabal in the + # configure stage to enable building shared libraries + inherit enableStaticLibraries; + # pass the '--enable-shared' flag to cabal in the configure # stage to enable building shared libraries inherit enableSharedLibraries; @@ -140,6 +148,7 @@ assert enableSharedLibraries -> versionOlder "6.12" ghc.version; (enableFeature self.enableSplitObjs "split-objs") (enableFeature enableLibraryProfiling "library-profiling") (enableFeature self.enableSharedLibraries "shared") + (optional (versionOlder "7" ghc.version) (enableFeature self.enableStaticLibraries "library-vanilla")) (optional (versionOlder "7.4" ghc.version) (enableFeature self.enableSharedExecutables "executable-dynamic")) (optional (versionOlder "7" ghc.version) (enableFeature self.doCheck "tests")) ]; |