blob: 4ab4c5474689db480f61c0263d6da98e0f03a6a6 (
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
{ stdenv, runCommand, writeScriptBin, buildBowerComponents, pythonPackages, libsass, python, fetchurl, jq, yarn, nodejs-10_x, yarn2nix-moretea, sources }:
let
yarn2nix-moretea' = yarn2nix-moretea.override({
yarn = yarn.override({ nodejs = nodejs-10_x; });
nodejs = nodejs-10_x;
});
buildslist_src = sources.buildbot-plugin-buildslist;
packagejson = runCommand "package.json" { buildInputs = [ jq ]; } ''
cat ${buildslist_src}/package.json | jq -r '.version = "${pythonPackages.buildbot-pkg.version}"|.license= "MIT"' > $out
'';
nodeHeaders = fetchurl {
url = "https://nodejs.org/download/release/v${nodejs-10_x.version}/node-v${nodejs-10_x.version}-headers.tar.gz";
sha256 = "15hkcbs328d3rc1s14rmky8lh8d3rr86l8k0bia0ggxzwl23lj9c";
};
buildslist_yarn = yarn2nix-moretea'.mkYarnModules rec {
name = "buildslist-yarn-modules";
pname = name;
inherit (pythonPackages.buildbot-pkg) version;
packageJSON = packagejson;
yarnLock = "${buildslist_src}/yarn.lock";
yarnNix = ./yarn-packages.nix;
pkgConfig = {
node-sass = {
buildInputs = [ libsass python ];
postInstall =
''
node scripts/build.js --tarball=${nodeHeaders}
'';
};
};
};
buildslist_bower = buildBowerComponents {
name = "buildslist";
generated = ./bower.nix;
src = "${buildslist_src}/guanlecoja/";
};
# the buildbot-pkg calls yarn and screws up everything...
fakeYarn = writeScriptBin "yarn" ''
#!${stdenv.shell}
if [ "$1" = "--version" ]; then
echo "1.17"
fi
'';
in
pythonPackages.buildPythonPackage rec {
pname = "buildbot-buildslist";
inherit (pythonPackages.buildbot-pkg) version;
preConfigure = ''
export HOME=$PWD
ln -s ${buildslist_yarn}/node_modules .
cp -a ${buildslist_bower}/bower_components ./libs
PATH=${buildslist_yarn}/node_modules/.bin:$PATH
chmod -R u+w libs
'';
propagatedBuildInputs = with pythonPackages; [
(klein.overridePythonAttrs(old: { checkPhase = ""; }))
buildbot-pkg
];
nativeBuildInputs = [ fakeYarn nodejs-10_x ];
buildInputs = [ buildslist_yarn buildslist_bower ];
doCheck = false;
src = buildslist_src;
}
|