@@ -74,83 +74,6 @@ with haskellLib;
7474
7575 isLibrary = componentId: componentId.ctype == "lib";
7676
77− adjustHackage = hackage: args:
78− let
79− handleVer = vdata:
80− let
81− revs = builtins.removeAttrs vdata ["sha256"];
82− rev2HashedConfig = name: rev: { name = rev.cabalSha256; value = revConfigs.${name}; };
83− revConfigs = lib.mapAttrs (_: rev2config vdata.sha256) revs;
84− in revConfigs // lib.mapAttrs' rev2HashedConfig revs;
85− rev2config = sha256: rev: self: import rev (args // { inherit (self) flags; }) // {
86− inherit sha256;
87− inherit (rev) cabalFile;
88− };
89− in lib.mapAttrs (_: lib.mapAttrs (_: handleVer)) hackage;
90−
91− buildPlan = { pkgs, plan }:
92− let
93− ghc = pkgs.haskell.compiler.${plan.compiler.nix-name};
94− weakCallPackage = scope: f: args:
95− let f' = if lib.isFunction f then f else import f;
96− args' = scope // args;
97− in f' (builtins.intersectAttrs (builtins.functionArgs f') args');
98−
99− new-builder = weakCallPackage pkgs ./builder {
100− inherit haskellLib ghc weakCallPackage;
101− };
102− cabal = import ./cabal-os-arch-comp.nix;
103− configs = lib.mapAttrs (_: lib.fix) plan.packages;
104− in {
105− system =
106− let hostMap = import ./host-map.nix pkgs.stdenv;
107− in cabal.os // { "is${hostMap.os}" = true; }
108− // cabal.arch // { "is${hostMap.arch}" = true; };
109− compiler = cabal.compiler // {
110− isGhc = true;
111− version = lib.mapAttrs (_: f: v: f (builtins.compareVersions plan.compiler.version v)) {
112− eq = c: c == 0;
113− gt = c: c > 0;
114− ge = c: c >= 0;
115− lt = c: c < 0;
116− le = c: c <= 0;
117− };
118− };
119− pkgconfPkgs = pkgs // {
120− cairo-pdf = pkgs.cairo;
121− cairo-ps = pkgs.cairo;
122− cairo-svg = pkgs.cairo;
123− xft = pkgs.xorg.libXft;
124− xau = pkgs.xorg.libXau;
125− libR = pkgs.R;
126− fftw3f = pkgs.fftwFloat;
127− fftw3 = pkgs.fftw;
128− };
129− pkgs = pkgs // {
130− pthread = null;
131− "stdc++" = null;
132− ssl = pkgs.openssl.dev;
133− crypto = pkgs.openssl.dev;
134− z = pkgs.zlib;
135− GL = pkgs.libGL;
136− GLU = pkgs.libGLU;
137− alut = pkgs.freealut;
138− X11 = pkgs.xorg.libX11;
139− Xrandr = pkgs.xorg.libXrandr;
140− Xext = pkgs.xorg.libXext;
141− Xi = pkgs.xorg.libXi;
142− Xxf86vm = pkgs.xorg.libXxf86vm;
143− Xcursor = pkgs.xorg.libXcursor;
144− Xinerama = pkgs.xorg.libXinerama;
145− mysqlclient = pkgs.mysql;
146− Imlib2 = pkgs.imlib2;
147− asound = pkgs.alsaLib;
148− ffi = null;
149− };
150− hsPkgs = lib.mapAttrs (_: _: null) (plan.compiler.packages // { hsc2hs = "0.68.2"; })
151− // lib.mapAttrs (_: new-builder) configs;
152− };
153−
15477 # Avoid pkgs.callPackage for now. It does a lot of nonsense with OOP
15578 # style programming that we should avoid until we know we want it.
15679