@@ -1,7 +1,63 @@
1−# Nixpkgs overlay which aggregates overlays for tools and products
1+self: super:
22
3−{ nixpkgs ? import <nixpkgs> {} }:
3+let
44
5−with nixpkgs.lib;
6−let haskellOverlay = import ./haskell-overlay.nix;
7−in fix (extends haskellOverlay (_: nixpkgs))
5+ # from pkgs/stdenv/generic/make-derivation.nix
6+ # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck
7+ normalizedConfigureFlags = configureFlags: let inherit (super) lib; in
8+ (/**/ if lib.isString configureFlags then [configureFlags]
9+ else if configureFlags == null then []
10+ else configureFlags);
11+
12+in {
13+ haskell = super.haskell // {
14+ packages = super.haskell.packages // {
15+ stackage = super.callPackage ./stackage {};
16+ };
17+ };
18+
19+ stackage2nix = super.callPackage ./stackage2nix {
20+ stackage2nix = super.haskell.lib.disableSharedExecutables
21+ (self.haskell.packages.stackage.lts-100.callPackage ./stackage2nix/stackage2nix.nix{});
22+ cacheVersion = builtins.readFile ./cache-version.txt;
23+ };
24+
25+ stackage2nix-static = super.callPackage ./stackage2nix {
26+ stackage2nix =
27+ let
28+ staticConfigureFlags = super.lib.concatStringsSep " " [
29+ "--ghc-option=-optl=-static"
30+ "--ghc-option=-optl=-pthread"
31+ "--ghc-option=-optl=-L${super.glibc.static}/lib"
32+ "--ghc-option=-optl=-L${super.gmp5.static}/lib"
33+ "--ghc-option=-optl=-L${self.icu-static.static}/lib"
34+ "--ghc-option=-optl=-L${self.openssl-static.static}/lib"
35+ "--ghc-option=-optl=-L${super.zlib.static}/lib"
36+ ];
37+ buildStaticExecutable = drv:
38+ super.haskell.lib.appendConfigureFlag (super.haskell.lib.disableSharedExecutables drv) staticConfigureFlags;
39+ in
40+ buildStaticExecutable
41+ (self.haskell.packages.stackage.lts-100.callPackage ./stackage2nix/stackage2nix.nix{});
42+ cacheVersion = builtins.readFile ./cache-version.txt;
43+ };
44+
45+ icu-static = super.icu.overrideAttrs (attrs: {
46+ dontDisableStatic = true;
47+ configureFlags = normalizedConfigureFlags attrs.configureFlags ++ [ "--enable-static" ];
48+ outputs = attrs.outputs ++ [ "static" ];
49+ postInstall = ''
50+ moveToOutput "lib/*.a" "$static"
51+ '' + attrs.postInstall;
52+ });
53+
54+ openssl-static = super.openssl.overrideAttrs (attrs: {
55+ dontDisableStatic = true;
56+ outputs = attrs.outputs ++ [ "static" ];
57+ postInstall = ''
58+ mkdir -p $static/lib;
59+ moveToOutput "*.a" "$static/lib";
60+ '' + attrs.postInstall;
61+ });
62+
63+}