Skip to content

Commit 9ce06e8

Browse files
committed
Make it build
- bump haskell.nix - bump hackage.nix - add sources for haskell-src-meta and hnix. Note: We can not upgrade haskell-src-ext 0.20.3 -> 0.21.0, or pretty-show, those will result in broken happy lookups. (Not sure where those come from) Also we seem to have an issue with source repository packages in the plan.json parser. They are ignored and lead to incorrect builds with plan-to-json.
1 parent e34eb1a commit 9ce06e8

File tree

4 files changed

+612
-468
lines changed

4 files changed

+612
-468
lines changed

haskell-src-meta.nix

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
2+
{
3+
flags = {};
4+
package = {
5+
specVersion = "1.8";
6+
identifier = { name = "haskell-src-meta"; version = "0.8.0.5"; };
7+
license = "BSD-3-Clause";
8+
copyright = "(c) Matt Morrow";
9+
maintainer = "Ben Millwood <[email protected]>";
10+
author = "Matt Morrow";
11+
homepage = "";
12+
url = "";
13+
synopsis = "Parse source to template-haskell abstract syntax.";
14+
description = "The translation from haskell-src-exts abstract syntax\nto template-haskell abstract syntax isn't 100% complete yet.";
15+
buildType = "Simple";
16+
};
17+
components = {
18+
"library" = {
19+
depends = [
20+
(hsPkgs.base)
21+
(hsPkgs.haskell-src-exts)
22+
(hsPkgs.pretty)
23+
(hsPkgs.syb)
24+
(hsPkgs.template-haskell)
25+
(hsPkgs.th-orphans)
26+
] ++ (pkgs.lib).optional (compiler.isGhc && (compiler.version).lt "7.8") (hsPkgs.safe);
27+
};
28+
tests = {
29+
"unit" = {
30+
depends = [
31+
(hsPkgs.HUnit)
32+
(hsPkgs.base)
33+
(hsPkgs.haskell-src-exts)
34+
(hsPkgs.haskell-src-meta)
35+
(hsPkgs.pretty)
36+
(hsPkgs.template-haskell)
37+
(hsPkgs.test-framework)
38+
(hsPkgs.test-framework-hunit)
39+
];
40+
};
41+
"splices" = { depends = [ (hsPkgs.base) (hsPkgs.haskell-src-meta) ]; };
42+
};
43+
};
44+
} // {
45+
src = pkgs.fetchgit {
46+
url = "https://github.com/galenhuntington/haskell-src-meta.git";
47+
rev = "109ee29d5fd0f4e23fdd2f80eb122d66341b64a9";
48+
sha256 = "08qw6y9br6fy3qkwl9v2kp38msprsq9v1ssym0fsnj2jm0vbnfrx";
49+
};
50+
}

hnix.nix

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
2+
{
3+
flags = { optimize = false; profiling = false; tracing = false; };
4+
package = {
5+
specVersion = "1.10";
6+
identifier = { name = "hnix"; version = "0.5.2"; };
7+
license = "BSD-3-Clause";
8+
copyright = "";
9+
maintainer = "[email protected]";
10+
author = "John Wiegley";
11+
homepage = "https://github.com/haskell-nix/hnix#readme";
12+
url = "";
13+
synopsis = "Haskell implementation of the Nix language";
14+
description = "Haskell implementation of the Nix language.";
15+
buildType = "Simple";
16+
};
17+
components = {
18+
"library" = {
19+
depends = (((([
20+
(hsPkgs.aeson)
21+
(hsPkgs.array)
22+
(hsPkgs.base)
23+
(hsPkgs.binary)
24+
(hsPkgs.bytestring)
25+
(hsPkgs.containers)
26+
(hsPkgs.data-fix)
27+
(hsPkgs.deepseq)
28+
(hsPkgs.dependent-sum)
29+
(hsPkgs.deriving-compat)
30+
(hsPkgs.directory)
31+
(hsPkgs.exceptions)
32+
(hsPkgs.filepath)
33+
(hsPkgs.free)
34+
(hsPkgs.hashing)
35+
(hsPkgs.http-client)
36+
(hsPkgs.http-client-tls)
37+
(hsPkgs.http-types)
38+
(hsPkgs.interpolate)
39+
(hsPkgs.lens-family-th)
40+
(hsPkgs.logict)
41+
(hsPkgs.megaparsec)
42+
(hsPkgs.monadlist)
43+
(hsPkgs.mtl)
44+
(hsPkgs.optparse-applicative)
45+
(hsPkgs.parser-combinators)
46+
(hsPkgs.prettyprinter)
47+
(hsPkgs.process)
48+
(hsPkgs.ref-tf)
49+
(hsPkgs.regex-tdfa)
50+
(hsPkgs.regex-tdfa-text)
51+
(hsPkgs.scientific)
52+
(hsPkgs.semigroups)
53+
(hsPkgs.split)
54+
(hsPkgs.syb)
55+
(hsPkgs.template-haskell)
56+
(hsPkgs.text)
57+
(hsPkgs.these)
58+
(hsPkgs.time)
59+
(hsPkgs.transformers)
60+
(hsPkgs.unix)
61+
(hsPkgs.unordered-containers)
62+
(hsPkgs.vector)
63+
(hsPkgs.xml)
64+
] ++ (pkgs.lib).optional (system.isLinux && (compiler.isGhc && (compiler.version).ge "8.2") && (compiler.isGhc && (compiler.version).lt "8.3")) (hsPkgs.compact)) ++ (pkgs.lib).optionals (!(compiler.isGhcjs && true)) [
65+
(hsPkgs.base16-bytestring)
66+
(hsPkgs.cryptohash-md5)
67+
(hsPkgs.cryptohash-sha1)
68+
(hsPkgs.cryptohash-sha256)
69+
(hsPkgs.cryptohash-sha512)
70+
(hsPkgs.serialise)
71+
]) ++ [
72+
(hsPkgs.lens-family)
73+
(hsPkgs.lens-family-core)
74+
]) ++ (pkgs.lib).optional (compiler.isGhc && (compiler.version).lt "8.4.0" && !flags.profiling) (hsPkgs.ghc-datasize)) ++ (if compiler.isGhcjs && true
75+
then [ (hsPkgs.hashable) ]
76+
else [ (hsPkgs.hashable) (hsPkgs.haskeline) (hsPkgs.pretty-show) ]);
77+
};
78+
exes = {
79+
"hnix" = {
80+
depends = ([
81+
(hsPkgs.aeson)
82+
(hsPkgs.base)
83+
(hsPkgs.bytestring)
84+
(hsPkgs.containers)
85+
(hsPkgs.data-fix)
86+
(hsPkgs.deepseq)
87+
(hsPkgs.exceptions)
88+
(hsPkgs.filepath)
89+
(hsPkgs.hashing)
90+
(hsPkgs.haskeline)
91+
(hsPkgs.hnix)
92+
(hsPkgs.mtl)
93+
(hsPkgs.optparse-applicative)
94+
(hsPkgs.pretty-show)
95+
(hsPkgs.prettyprinter)
96+
(hsPkgs.repline)
97+
(hsPkgs.template-haskell)
98+
(hsPkgs.text)
99+
(hsPkgs.time)
100+
(hsPkgs.transformers)
101+
(hsPkgs.unordered-containers)
102+
] ++ (pkgs.lib).optional (system.isLinux && (compiler.isGhc && (compiler.version).ge "8.2") && (compiler.isGhc && (compiler.version).lt "8.3")) (hsPkgs.compact)) ++ (pkgs.lib).optionals (!(compiler.isGhcjs && true)) [
103+
(hsPkgs.base16-bytestring)
104+
(hsPkgs.cryptohash-md5)
105+
(hsPkgs.cryptohash-sha1)
106+
(hsPkgs.cryptohash-sha256)
107+
(hsPkgs.cryptohash-sha512)
108+
(hsPkgs.serialise)
109+
];
110+
};
111+
};
112+
tests = {
113+
"hnix-tests" = {
114+
depends = ([
115+
(hsPkgs.Diff)
116+
(hsPkgs.Glob)
117+
(hsPkgs.base)
118+
(hsPkgs.bytestring)
119+
(hsPkgs.containers)
120+
(hsPkgs.data-fix)
121+
(hsPkgs.deepseq)
122+
(hsPkgs.dependent-sum)
123+
(hsPkgs.directory)
124+
(hsPkgs.exceptions)
125+
(hsPkgs.filepath)
126+
(hsPkgs.generic-random)
127+
(hsPkgs.hashing)
128+
(hsPkgs.hedgehog)
129+
(hsPkgs.hnix)
130+
(hsPkgs.interpolate)
131+
(hsPkgs.megaparsec)
132+
(hsPkgs.mtl)
133+
(hsPkgs.optparse-applicative)
134+
(hsPkgs.pretty-show)
135+
(hsPkgs.prettyprinter)
136+
(hsPkgs.process)
137+
(hsPkgs.split)
138+
(hsPkgs.tasty)
139+
(hsPkgs.tasty-hedgehog)
140+
(hsPkgs.tasty-hunit)
141+
(hsPkgs.tasty-quickcheck)
142+
(hsPkgs.tasty-th)
143+
(hsPkgs.template-haskell)
144+
(hsPkgs.text)
145+
(hsPkgs.time)
146+
(hsPkgs.transformers)
147+
(hsPkgs.unix)
148+
(hsPkgs.unordered-containers)
149+
] ++ (pkgs.lib).optional (system.isLinux && (compiler.isGhc && (compiler.version).ge "8.2") && (compiler.isGhc && (compiler.version).lt "8.3")) (hsPkgs.compact)) ++ (pkgs.lib).optionals (!(compiler.isGhcjs && true)) [
150+
(hsPkgs.base16-bytestring)
151+
(hsPkgs.cryptohash-md5)
152+
(hsPkgs.cryptohash-sha1)
153+
(hsPkgs.cryptohash-sha256)
154+
(hsPkgs.cryptohash-sha512)
155+
(hsPkgs.serialise)
156+
];
157+
build-tools = [ ((hsPkgs.buildPackages).hspec-discover) ];
158+
};
159+
};
160+
benchmarks = {
161+
"hnix-benchmarks" = {
162+
depends = ([
163+
(hsPkgs.base)
164+
(hsPkgs.bytestring)
165+
(hsPkgs.containers)
166+
(hsPkgs.criterion)
167+
(hsPkgs.data-fix)
168+
(hsPkgs.deepseq)
169+
(hsPkgs.exceptions)
170+
(hsPkgs.filepath)
171+
(hsPkgs.hashing)
172+
(hsPkgs.hnix)
173+
(hsPkgs.mtl)
174+
(hsPkgs.optparse-applicative)
175+
(hsPkgs.template-haskell)
176+
(hsPkgs.text)
177+
(hsPkgs.time)
178+
(hsPkgs.transformers)
179+
(hsPkgs.unordered-containers)
180+
] ++ (pkgs.lib).optional (system.isLinux && (compiler.isGhc && (compiler.version).ge "8.2") && (compiler.isGhc && (compiler.version).lt "8.3")) (hsPkgs.compact)) ++ (pkgs.lib).optionals (!(compiler.isGhcjs && true)) [
181+
(hsPkgs.base16-bytestring)
182+
(hsPkgs.cryptohash-md5)
183+
(hsPkgs.cryptohash-sha1)
184+
(hsPkgs.cryptohash-sha256)
185+
(hsPkgs.cryptohash-sha512)
186+
(hsPkgs.serialise)
187+
];
188+
};
189+
};
190+
};
191+
} // {
192+
src = pkgs.fetchgit {
193+
url = "https://github.com/haskell-nix/hnix.git";
194+
rev = "617d0867ab96c8f97b02c4524bd948d9f114005e";
195+
sha256 = "037kxj9wirynmavlp7d0k19a5xrhj117hlh3yia12xj6v828b99z";
196+
};
197+
}

pkgs.nix

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,35 @@ let
1414
hackage = import (overrideWith "hackage"
1515
(pkgs.fetchFromGitHub { owner = "angerman";
1616
repo = "hackage.nix";
17-
rev = "66c28064da46525711722b75b4adb2ac878897d3";
18-
sha256 = "12ffzzjgirwzha3ngxbniccgn19406iryxspq19kgi4kz9lz6bpr";
17+
rev = "15155a37d3a40173b57e93b09453984fac614523";
18+
sha256 = "016538bfnlb0dxdga4n5p0m75zq0zymbdh5vrvr0gwsa7pywi7zy";
1919
name = "hackage-exprs-source"; }))
2020
;
2121
# a different haskell infrastructure
2222
haskell = import (overrideWith "haskell"
2323
(pkgs.fetchFromGitHub { owner = "angerman";
2424
repo = "haskell.nix";
25-
rev = "2a3b2612a15fd7f14d32c3519aba2b64bd7b1e43";
26-
sha256 = "181dv1zlf381kkb82snjmpibhgmkyw1n5qsvpqjrv8dxmcjqjl2k";
25+
rev = "ed1dbc01f98411894f6613c62818f14b02fb6679";
26+
sha256 = "0kbj4kb9rlvjb4afpcisz9zlk5z3h7frkwggfwri1q5683fapkgv";
2727
name = "haskell-lib-source"; }))
2828
hackage;
2929

3030
# our packages
31+
# this is generated with plan-to-nix
32+
# $ cabal new-configure
33+
# $ plan-to-nix ./dist-newstyle/cache/plan.json > plan.nix
3134
plan = import ./plan.nix;
3235

3336
pkgSet = haskell.mkNewPkgSet {
3437
inherit pkgs;
3538
pkg-def = plan;
3639
pkg-def-overlays = [
37-
{ nix-tools = ./nix-tools.nix;
38-
hackage-db = ./hackage-db.nix;
40+
{ nix-tools = ./nix-tools.nix;
41+
# these are generated with cabal-to-nix
42+
# $ cabal-to-nix https://github.com/galenhuntington/haskell-src-meta.git 109ee29d5fd0f4e23fdd2f80eb122d66341b64a9 > haskell-src-meta.nix
43+
hackage-db = ./hackage-db.nix;
44+
haskell-src-meta = ./haskell-src-meta.nix;
45+
hnix = ./hnix.nix;
3946
}
4047
];
4148
modules = [

0 commit comments

Comments
 (0)