]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - pkgs/python-packages/buildbot/plugins/buildslist/default.nix
Migrate mylibs to niv (work in progress)
[perso/Immae/Config/Nix.git] / pkgs / python-packages / buildbot / plugins / buildslist / default.nix
CommitLineData
db343436 1{ stdenv, runCommand, writeScriptBin, buildBowerComponents, pythonPackages, libsass, python, fetchurl, jq, yarn, nodejs, yarn2nix-moretea, sources }:
b798cf6d 2let
db343436 3 buildslist_src = sources.buildbot-plugin-buildslist;
5145061e 4 packagejson = runCommand "package.json" { buildInputs = [ jq ]; } ''
db343436 5 cat ${buildslist_src}/package.json | jq -r '.version = "${pythonPackages.buildbot-pkg.version}"|.license= "MIT"' > $out
5145061e 6 '';
5400b9b6
IB
7 nodeHeaders = fetchurl {
8 url = "https://nodejs.org/download/release/v${nodejs.version}/node-v${nodejs.version}-headers.tar.gz";
f5761aac 9 sha256 = "1prvrcvbyal39k9axfwjixs4wfgs1m8xy4prsl0kq0s0n7r7nxzj";
5400b9b6 10 };
71b4786d 11 buildslist_yarn = yarn2nix-moretea.mkYarnModules rec {
b798cf6d
IB
12 name = "buildslist-yarn-modules";
13 pname = name;
14 inherit (pythonPackages.buildbot-pkg) version;
5145061e 15 packageJSON = packagejson;
db343436 16 yarnLock = "${buildslist_src}/yarn.lock";
5145061e 17 yarnNix = ./yarn-packages.nix;
b798cf6d 18 pkgConfig = {
ea3a7a25
IB
19 node-sass = {
20 buildInputs = [ libsass python ];
5400b9b6 21 postInstall =
ea3a7a25
IB
22 ''
23 node scripts/build.js --tarball=${nodeHeaders}
24 '';
25 };
b798cf6d
IB
26 };
27 };
28 buildslist_bower = buildBowerComponents {
29 name = "buildslist";
30 generated = ./bower.nix;
db343436 31 src = "${buildslist_src}/guanlecoja/";
b798cf6d 32 };
5400b9b6
IB
33 # the buildbot-pkg calls yarn and screws up everything...
34 fakeYarn = writeScriptBin "yarn" ''
35 #!${stdenv.shell}
36 if [ "$1" = "--version" ]; then
37 echo "1.17"
38 fi
39 '';
b798cf6d
IB
40in
41pythonPackages.buildPythonPackage rec {
42 pname = "buildbot-buildslist";
43 inherit (pythonPackages.buildbot-pkg) version;
44
45 preConfigure = ''
46 export HOME=$PWD
ea3a7a25 47 ln -s ${buildslist_yarn}/node_modules .
b798cf6d 48 cp -a ${buildslist_bower}/bower_components ./libs
5400b9b6 49 PATH=${buildslist_yarn}/node_modules/.bin:$PATH
b798cf6d
IB
50 chmod -R u+w libs
51 '';
52 propagatedBuildInputs = with pythonPackages; [
53 (klein.overridePythonAttrs(old: { checkPhase = ""; }))
54 buildbot-pkg
55 ];
5400b9b6 56 nativeBuildInputs = [ fakeYarn nodejs ];
b798cf6d
IB
57 buildInputs = [ buildslist_yarn buildslist_bower ];
58
59 doCheck = false;
db343436 60 src = buildslist_src;
b798cf6d 61}