-
Notifications
You must be signed in to change notification settings - Fork 19
/
default.nix
81 lines (77 loc) · 2.09 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{ mkDerivation, aeson, base, bytestring, containers
, directory, deepseq, effectful, filemanip, filepath
, optparse-applicative, parsec, pretty, signal, lib
, uuagc, uuagc-cabal, tasty, tasty-golden, tasty-hunit
}:
let
# Clean up the source of the derivation to prevent rebuilds
src = lib.cleanSourceWith {
name = "glualint-src";
src = ./.;
filter = path: type:
let
suffixAllowlist = [
".ag"
".cabal"
".hs"
"LICENSE"
];
suffixDenylist = [
"release-linux.sh"
"nix"
"installation-instructions"
];
in
((type == "directory") ||
(builtins.any (suffix: lib.hasSuffix suffix path) suffixAllowlist)
) &&
!(builtins.any (suffix: lib.hasSuffix suffix path) suffixDenylist) &&
# Simple library function to remove git related files.
lib.cleanSourceFilter path type
;
};
in mkDerivation {
inherit src;
pname = "glualint";
version = "0.1.0.0";
isLibrary = true;
isExecutable = true;
buildDepends = [uuagc uuagc-cabal];
libraryHaskellDepends = [
base
aeson
bytestring
containers
parsec
pretty
uuagc
uuagc-cabal
tasty
tasty-golden
tasty-hunit
];
executableHaskellDepends = [
aeson
base
bytestring
containers
deepseq
directory
effectful
filemanip
filepath
optparse-applicative
signal
];
preBuild = ''
printf "Generating attribute grammar haskell files"
${uuagc}/bin/uuagc --haskellsyntax --data src/GLua/AG/AST.ag
${uuagc}/bin/uuagc --haskellsyntax --data --strictdata src/GLua/AG/Token.ag
${uuagc}/bin/uuagc --catas --haskellsyntax --semfuns --wrappers --signatures src/GLua/AG/PrettyPrint.ag
${uuagc}/bin/uuagc --catas --haskellsyntax --semfuns --wrappers --signatures --optimize src/GLuaFixer/AG/LexLint.ag
${uuagc}/bin/uuagc --catas --haskellsyntax --semfuns --wrappers --signatures --optimize src/GLuaFixer/AG/ASTLint.ag
'';
homepage = "https://github.com/FPtje/GLuaFixer";
description = "Attempts to fix your syntax erroring Lua files";
license = lib.licenses.lgpl21;
}