haskell: extend generic builder to support upcoming format change from cabal2nix

+11 -11
+11 -11
pkgs/development/haskell-modules/generic-builder.nix
··· 6 6 , version, revision ? null 7 7 , sha256 ? null 8 8 , src ? fetchurl { url = "mirror://hackage/${pname}-${version}.tar.gz"; inherit sha256; } 9 - , buildDepends ? [] 9 + , buildDepends ? [], libraryHaskellDepends ? [], executableHaskellDepends ? [] 10 10 , buildTarget ? "" 11 - , buildTools ? [] 11 + , buildTools ? [], libraryToolDepends ? [], executableToolDepends ? [], testToolDepends ? [] 12 12 , configureFlags ? [] 13 13 , description ? "" 14 14 , doCheck ? stdenv.lib.versionOlder "7.4" ghc.version ··· 19 19 , enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version) 20 20 , enableSplitObjs ? !stdenv.isDarwin # http://hackage.haskell.org/trac/ghc/ticket/4013 21 21 , enableStaticLibraries ? true 22 - , extraLibraries ? [] 22 + , extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? [] 23 23 , homepage ? "http://hackage.haskell.org/package/${pname}" 24 24 , hydraPlatforms ? ghc.meta.hydraPlatforms or ghc.meta.platforms 25 25 , hyperlinkSource ? true ··· 29 29 , maintainers ? [] 30 30 , doHaddock ? true 31 31 , passthru ? {} 32 - , pkgconfigDepends ? [] 32 + , pkgconfigDepends ? [], libraryPkgconfigDepends ? [], executablePkgconfigDepends ? [], testPkgconfigDepends ? [] 33 33 , platforms ? ghc.meta.platforms 34 - , testDepends ? [] 34 + , testDepends ? [], testHaskellDepends ? [], testSystemDepends ? [] 35 35 , testTarget ? "" 36 36 , broken ? false 37 37 , preUnpack ? "", postUnpack ? "" ··· 84 84 (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghc.name}/${pname}-${version}") 85 85 (optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names") 86 86 (optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES") 87 - (optionalString (useCpphs) "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp") 87 + (optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp") 88 88 (enableFeature enableSplitObjs "split-objs") 89 89 (enableFeature enableLibraryProfiling "library-profiling") 90 90 (enableFeature enableSharedLibraries "shared") ··· 105 105 isHaskellPkg = x: (x ? pname) && (x ? version) && (x ? env); 106 106 isSystemPkg = x: !isHaskellPkg x; 107 107 108 - propagatedBuildInputs = buildDepends; 109 - otherBuildInputs = extraLibraries ++ 110 - buildTools ++ 111 - optionals (pkgconfigDepends != []) ([pkgconfig] ++ pkgconfigDepends) ++ 112 - optionals doCheck testDepends; 108 + propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends; 109 + otherBuildInputs = extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++ 110 + buildTools ++ libraryToolDepends ++ executableToolDepends ++ 111 + optionals (pkgconfigDepends != []) ([pkgconfig] ++ pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends) ++ 112 + optionals doCheck (testDepends ++ testHaskellDepends ++ testSystemDepends); 113 113 allBuildInputs = propagatedBuildInputs ++ otherBuildInputs; 114 114 115 115 haskellBuildInputs = stdenv.lib.filter isHaskellPkg allBuildInputs;