13 json = builtins.fromJSON (builtins.readFile ./generated.json);
16 lib.flip builtins.mapAttrs json (
19 inherit (entry) manifest;
26 packageName = builtins.head (builtins.match "([^~=<>@]*).*" name);
27 lower = lib.toLower packageName;
28 dash = builtins.replaceStrings [ "_" ] [ "-" ] packageName;
29 lowerDash = builtins.replaceStrings [ "_" ] [ "-" ] lower;
31 python3.pkgs.${packageName} or python3.pkgs.${lower} or python3.pkgs.${dash}
32 or python3.pkgs.${lowerDash} or null
33 ) (builtins.filter (x: x != "maubot" && x != null) deps);
35 reqDeps = resolveDeps (lib.toList (manifest.dependencies or null));
36 optDeps = resolveDeps (lib.toList (manifest.soft_dependencies or null));
39 lib.makeOverridable buildMaubotPlugin (
43 inherit (manifest) version;
46 if entry ? github then
47 fetchFromGitHub entry.github
48 else if entry ? git then
50 else if entry ? gitlab then
51 fetchFromGitLab entry.gitlab
52 else if entry ? gitea then
53 fetchFromGitea entry.gitea
55 throw "Invalid generated entry for ${manifest.id}: missing source";
57 propagatedBuildInputs = builtins.filter (x: x != null) (reqDeps ++ optDeps);
59 passthru.isOfficial = entry.isOfficial or false;
61 meta = entry.attrs.meta // {
64 spdx = entry.attrs.meta.license or manifest.license or "unfree";
65 spdxLicenses = builtins.listToAttrs (
66 map (x: lib.nameValuePair x.spdxId x) (
67 builtins.filter (x: x ? spdxId) (builtins.attrValues lib.licenses)
72 broken = builtins.any (x: x == null) reqDeps;
75 // lib.optionalAttrs (entry.isPoetry or false) {
78 (python3.withPackages (
88 lib.optionalString (entry ? attrs.preBuild) (entry.attrs.preBuild + "\n")
90 export HOME=$(mktemp -d)
91 [[ ! -d scripts ]] || patchShebangs --build scripts