1{ pkgs, buildPackages, stdenv, lib, haskellLib, ghc, fetchurl, runCommand, comp-builder, setup-builder }:
21assert (if ghc.isHaskellNixCompiler or false then true
22 else throw ("It is likely you used `haskell.compiler.X` instead of `haskell-nix.compiler.X`"
23 + pkgs.lib.optionalString (name != null) (" for " + name)));
26 cabalFile = if revision == null || revision == 0 then null else
28 name = "${name}-${toString revision}.cabal";
29 url = "https://hackage.haskell.org/package/${name}/revision/${toString revision}.cabal";
30 sha256 = revisionSha256;
33 defaultSetupSrc = builtins.toFile "Setup.hs" ''
34 import Distribution.Simple
37 defaultSetup = setup-builder {
38 name = "${ghc.targetPrefix}default-Setup";
40 depends = config.setup-depends;
43 doExactConfig = false;
50 extraSrcFiles = [ "Setup.hs" "Setup.lhs" ];
55 preBuild = null; postBuild = null;
56 preInstall = null; postInstall = null;
57 preUnpack = null; postUnpack = null;
61 name = "default-Setup";
68 src = null; cleanSrc = buildPackages.runCommand "default-Setup-src" {} ''
70 cat ${defaultSetupSrc} > $out/Setup.hs
72 inherit defaultSetupSrc;
75 # buildPackages.runCommand "default-Setup" { nativeBuildInputs = [(ghc.passthru.buildGHC or ghc)]; } ''
76 # cat ${defaultSetupSrc} > Setup.hs
78 # ${(ghc.passthru.buildGHC or ghc).targetPrefix}ghc Setup.hs --make -o $out/bin/Setup
81 setup = if package.buildType == "Simple"
84 component = components.setup // {
85 depends = config.setup-depends ++ components.setup.depends ++ package.setup-depends;
86 extraSrcFiles = components.setup.extraSrcFiles ++ [ "Setup.hs" "Setup.lhs" ];
87 pkgconfig = if components ? library then components.library.pkgconfig or [] else [];
89 inherit package name src flags revision patches defaultSetupSrc;
90 inherit (pkg) preUnpack postUnpack;
93 buildComp = componentId: component: comp-builder {
94 inherit componentId component package name src flags setup cabalFile cabal-generator patches revision
100 components = haskellLib.applyComponents buildComp pkg;
101 checks = pkgs.recurseIntoAttrs (builtins.mapAttrs
102 (_: d: haskellLib.check d)
103 (lib.filterAttrs (_: d: d.config.doCheck) components.tests));
104 inherit (package) identifier detailLevel isLocal;
105 inherit setup cabalFile;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list