toxic: 0.15.1 -> 0.16.0
[NixPkgs.git] / pkgs / tools / package-management / akku / default.nix
blobcc036dfa5c69ad9cdcb7217d20cfab4b19dad318
2   lib,
3   newScope,
4   fetchurl,
5 }:
6 lib.makeScope newScope (self: rec {
7   akkuDerivation = self.callPackage ./akkuDerivation.nix { };
8   akku = self.callPackage ./akku.nix { };
10   akkuPackages =
11     let
12       overrides = self.callPackage ./overrides.nix { };
13       makeAkkuPackage =
14         akkuself: pname:
15         {
16           version,
17           dependencies,
18           dev-dependencies,
19           license,
20           url,
21           sha256,
22           source,
23           synopsis ? "",
24           homepage ? "",
25           ...
26         }:
27         (akkuDerivation {
28           pname = "akku-${pname}";
29           inherit version;
30           src = fetchurl {
31             inherit url sha256;
32           };
33           buildInputs = builtins.map (x: akkuself.${x}) dependencies;
34           r7rs = source == "snow-fort";
35           nativeBuildInputs = builtins.map (x: akkuself.${x}) dev-dependencies;
36           unpackPhase = "tar xf $src";
38           meta.homepage = homepage;
39           meta.description = synopsis;
40           meta.license =
41             let
42               stringToLicense =
43                 s:
44                 (
45                   lib.licenses
46                   // (with lib.licenses; {
47                     "agpl" = agpl3Only;
48                     "artistic" = artistic2;
49                     "bsd" = bsd3;
50                     "bsd-1-clause" = bsd1;
51                     "bsd-2-clause" = bsd2;
52                     "bsd-3-clause" = bsd3;
53                     "gpl" = gpl3Only;
54                     "gpl-2" = gpl2Only;
55                     "gplv2" = gpl2Only;
56                     "gpl-3" = gpl3Only;
57                     "gpl-3.0" = gpl3Only;
58                     "gplv3" = gpl3Only;
59                     "lgpl" = lgpl3Only;
60                     "lgpl-2" = lgpl2Only;
61                     "lgpl-2.0+" = lgpl2Plus;
62                     "lgpl-2.1" = lgpl21Only;
63                     "lgpl-2.1-or-later" = lgpl21Plus;
64                     "lgpl-3" = lgpl3Only;
65                     "lgplv3" = lgpl3Only;
66                     "public-domain" = publicDomain;
67                     "srfi" = bsd3;
68                     "unicode" = ucd;
69                     "zlib-acknowledgement" = zlib;
70                   })
71                 ).${s} or s;
72             in
73             if builtins.isList license then map stringToLicense license else stringToLicense license;
74         }).overrideAttrs
75           ({ "${pname}" = lib.id; } // overrides)."${pname}";
76       deps = lib.importTOML ./deps.toml;
77       packages = lib.makeScope self.newScope (akkuself: lib.mapAttrs (makeAkkuPackage akkuself) deps);
78     in
79     lib.recurseIntoAttrs packages;