on iko/ghcjs-patch-master help sign in
Delete seemingly dead code
commit192d8aa94105f8dcc0fa8f14661f065676c1946f authorWill Fancher <elvishjerricco@gmail.com> dateMon 29 Oct 2018, 03:45 (8 years ago) parentd18913e
3 files changed−131
lib/default.nix−77 lib/system-nixpkgs-map.nix~−23 nix/driver.nix−31
lib/default.nix−77
@@ -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
lib/system-nixpkgs-map.nix~deleted−23
@@ -1,23 +0,0 @@
1−# Maps of system pkg refenreces from
2−# cabal file to nixpkgs pkgs.
3−pkgs: {
4− pthread = null;
5− "stdc++" = null;
6− ssl = pkgs.openssl.dev;
7− crypto = pkgs.openssl.dev;
8− z = pkgs.zlib;
9− GL = pkgs.libGL;
10− GLU = pkgs.libGLU;
11− alut = pkgs.freealut;
12− X11 = pkgs.xorg.libX11;
13− Xrandr = pkgs.xorg.libXrandr;
14− Xext = pkgs.xorg.libXext;
15− Xi = pkgs.xorg.libXi;
16− Xxf86vm = pkgs.xorg.libXxf86vm;
17− Xcursor = pkgs.xorg.libXcursor;
18− Xinerama = pkgs.xorg.libXinerama;
19− mysqlclient = pkgs.mysql;
20− Imlib2 = pkgs.imlib2;
21− asound = pkgs.alsaLib;
22− ffi = null;
23−}
nix/driver.nixdeleted−31
@@ -1,31 +0,0 @@
1−{ lib, expr, mkDerivation }:
2−
3−let
4− # utilities
5− collectAttr = a: s: lib.lists.fold (e: acc: (if e ? ${a} then e.${a} else []) ++ acc) [] (builtins.attrValues s);
6− pname = expr.package.identifier.name;
7−in mkDerivation ({
8− inherit pname;
9− version = expr.package.identifier.version;
10−
11− isLibrary = builtins.hasAttr pname expr.components;
12− isExecutable = builtins.hasAttr "exes" expr.components;
13−
14− homepage = expr.package.homepage;
15− description = expr.package.synopsis;
16− license = (import ./cabal-licenses.nix lib).${expr.package.license};
17−
18−} // lib.optionalAttrs (expr ? revision) {
19− revision = "${toString expr.revision}";
20− editedCabalFile = expr.revisionSha256;
21−} // lib.optionalAttrs (expr ? sha256) {
22− inherit (expr) sha256;
23−} // lib.optionalAttrs (builtins.hasAttr pname expr.components) {
24− libraryHaskellDepends = expr.components.${pname}.depends;
25−} // lib.optionalAttrs (builtins.hasAttr "exes" expr.components) {
26− executableHaskellDepends = collectAttr "depends" expr.components.exes;
27−} // lib.optionalAttrs (builtins.hasAttr "tests" expr.components) {
28− testHaskellDepends = collectAttr "depends" expr.components.tests;
29−} // lib.optionalAttrs (builtins.hasAttr "benchmarks" expr.components) {
30− benchmarkHaskellDepends = collectAttr "depends" expr.components.benchmarks;
31−})