summaryrefslogtreecommitdiff
path: root/pkgs/python-packages/buildbot/plugins/buildslist/default.nix
blob: 08e6955ae03bef6a22fe6109c3ae6bcf31875aaa (plain) (blame)
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
{ mylibs, runCommand, buildBowerComponents, pythonPackages, jq, yarn, nodejs }:
let
  buildslist_src = mylibs.fetchedGit ./buildslist.json;
  packagejson = runCommand "package.json" { buildInputs = [ jq ]; } ''
    cat ${buildslist_src.src}/package.json | jq -r '.version = "${pythonPackages.buildbot-pkg.version}"' > $out
    '';
  buildslist_yarn = mylibs.yarn2nixPackage.mkYarnModules rec {
    name = "buildslist-yarn-modules";
    pname = name;
    inherit (pythonPackages.buildbot-pkg) version;
    packageJSON = packagejson;
    yarnLock = "${buildslist_src.src}/yarn.lock";
    yarnNix = ./yarn-packages.nix;
    pkgConfig = {
      all = { buildInputs = [ mylibs.yarn2nixPackage.src ]; };
    };
  };
  buildslist_bower = buildBowerComponents {
    name = "buildslist";
    generated = ./bower.nix;
    src = "${buildslist_src.src}/guanlecoja/";
  };
in
pythonPackages.buildPythonPackage rec {
  pname = "buildbot-buildslist";
  inherit (pythonPackages.buildbot-pkg) version;

  __noChroot = true;
  preConfigure = ''
    export HOME=$PWD
    cp -a ${buildslist_yarn}/node_modules .
    chmod -R u+w node_modules
    cp -a ${buildslist_bower}/bower_components ./libs
    chmod -R u+w libs
    '';
  propagatedBuildInputs = with pythonPackages; [
    (klein.overridePythonAttrs(old: { checkPhase = ""; }))
    buildbot-pkg
  ];
  nativeBuildInputs = [ yarn nodejs ];
  buildInputs = [ buildslist_yarn buildslist_bower ];

  doCheck = false;
  src = buildslist_src.src;
}