Fix packages and make buildslist sandboxed
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 24 May 2019 21:55:36 +0000 (23:55 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Mon, 27 May 2019 22:40:06 +0000 (00:40 +0200)
pkgs/python-packages/buildbot/plugins/buildslist/default.nix
pkgs/webapps/infcloud/default.nix

index 08e6955..a1a87b2 100644 (file)
@@ -1,4 +1,4 @@
-{ mylibs, runCommand, buildBowerComponents, pythonPackages, jq, yarn, nodejs }:
+{ mylibs, runCommand, buildBowerComponents, pythonPackages, libsass, python, fetchurl, jq, yarn, nodejs }:
 let
   buildslist_src = mylibs.fetchedGit ./buildslist.json;
   packagejson = runCommand "package.json" { buildInputs = [ jq ]; } ''
@@ -13,6 +13,18 @@ let
     yarnNix = ./yarn-packages.nix;
     pkgConfig = {
       all = { buildInputs = [ mylibs.yarn2nixPackage.src ]; };
+      node-sass = {
+        buildInputs = [ libsass python ];
+        postInstall = let
+          nodeHeaders = fetchurl {
+            url = "https://nodejs.org/download/release/v${nodejs.version}/node-v${nodejs.version}-headers.tar.gz";
+            sha256 = "16f20ya3ys6w5w6y6l4536f7jrgk4gz46bf71w1r1xxb26a54m32";
+          };
+        in
+          ''
+            node scripts/build.js --tarball=${nodeHeaders}
+          '';
+      };
     };
   };
   buildslist_bower = buildBowerComponents {
@@ -25,11 +37,9 @@ 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
+    ln -s ${buildslist_yarn}/node_modules .
     cp -a ${buildslist_bower}/bower_components ./libs
     chmod -R u+w libs
     '';
index 0d73f52..d949d26 100644 (file)
@@ -7,6 +7,7 @@ stdenv.mkDerivation rec {
     sha256 = "1fjhs0cj0b9fhf5ysfz281mknmmg1z551bas143sxfcqlpa5aiiq";
   };
   buildPhase = ''
+    patchShebangs .
     ./cache_update.sh
     rm config.js
     '';