-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdefault.nix
More file actions
70 lines (60 loc) · 2.38 KB
/
default.nix
File metadata and controls
70 lines (60 loc) · 2.38 KB
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
self: super:
let
# from pkgs/stdenv/generic/make-derivation.nix
# This parameter is sometimes a string, sometimes null, and sometimes a list, yuck
normalizedConfigureFlags = configureFlags: let inherit (super) lib; in
(/**/ if lib.isString configureFlags then [configureFlags]
else if configureFlags == null then []
else configureFlags);
stackage2nixPackages = import ./stackage2nix/stackage-packages.nix { nixpkgs = self; };
in {
haskell = super.haskell // {
packages = super.haskell.packages // {
stackage = super.callPackage ./stackage {} // {
lib = super.callPackage ./lib.nix {};
};
};
};
stackage2nix = self.callPackage ./stackage2nix {
drv = super.haskell.lib.disableSharedExecutables stackage2nixPackages.stackage2nix;
};
stackage2nixWrapper = import ./stackage2nix/impure.nix {
cacheVersion = builtins.readFile ./cache-version.txt;
inherit self;
};
stackage2nix-static = import ./stackage2nix/impure.nix {
drv =
let
stackagePackages = import ./stackage2nix/stackage-packages.nix { nixpkgs = self; };
in self.haskell.lib.overrideCabal stackagePackages.stackage2nix (drv: {
enableSharedExecutables = false;
enableSharedLibraries = false;
configureFlags = [
"--ghc-option=-optl=-static"
"--ghc-option=-optl=-L${self.glibc.static}/lib"
"--ghc-option=-optl=-L${self.gmp.override { withStatic = true; }}/lib"
"--ghc-option=-optl=-L${self.icu-static.static}/lib"
"--ghc-option=-optl=-L${self.openssl-static.static}/lib"
"--ghc-option=-optl=-L${self.zlib.static}/lib"
];
});
cacheVersion = builtins.readFile ./cache-version.txt;
inherit self;
};
icu-static = super.icu.overrideAttrs (attrs: {
dontDisableStatic = true;
configureFlags = normalizedConfigureFlags attrs.configureFlags ++ [ "--enable-static" ];
outputs = attrs.outputs ++ [ "static" ];
postInstall = ''
moveToOutput "lib/*.a" "$static"
'' + (if attrs ? postInstall then attrs.postInstall else "");
});
openssl-static = super.openssl.overrideAttrs (attrs: {
dontDisableStatic = true;
outputs = attrs.outputs ++ [ "static" ];
postInstall = ''
mkdir -p $static/lib;
cp -v *.a $static/lib;
'' + (if attrs ? postInstall then attrs.postInstall else "");
});
}