summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorRyan Trinkle <ryan.trinkle@gmail.com>2016-07-26 16:58:56 -0400
committerRyan Trinkle <ryan.trinkle@gmail.com>2016-07-26 16:58:56 -0400
commitc564997ba0372147a2b0f376073fdfdd37306152 (patch)
treebfd834296ab915841adbdc6479c83a21e01165ab /pkgs
parent3badad811c600db9867f15a326efa69898299099 (diff)
downloadnixpkgs-c564997ba0372147a2b0f376073fdfdd37306152.tar
nixpkgs-c564997ba0372147a2b0f376073fdfdd37306152.tar.gz
nixpkgs-c564997ba0372147a2b0f376073fdfdd37306152.tar.bz2
nixpkgs-c564997ba0372147a2b0f376073fdfdd37306152.tar.lz
nixpkgs-c564997ba0372147a2b0f376073fdfdd37306152.tar.xz
nixpkgs-c564997ba0372147a2b0f376073fdfdd37306152.tar.zst
nixpkgs-c564997ba0372147a2b0f376073fdfdd37306152.zip
ghcjs: refactor stage2 handling
Previously, the stage2 information was stored in haskell-modules, and imported directly from there.  However, the correct stage2 information is determined by the version of ghcjs-boot repository.  This commit makes the stage2 information part of the ghcjs derivation, which improves organization and makes it possible to override stage2 when overriding ghcjs.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/compilers/ghcjs/default.nix3
-rwxr-xr-x[-rw-r--r--]pkgs/development/compilers/ghcjs/gen-stage2.rb (renamed from pkgs/development/haskell-modules/ghcjs/gen-stage2.rb)5
-rw-r--r--pkgs/development/compilers/ghcjs/stage2.nix (renamed from pkgs/development/haskell-modules/ghcjs/stage2.nix)2
-rw-r--r--pkgs/development/haskell-modules/configuration-ghcjs.nix6
4 files changed, 9 insertions, 7 deletions
diff --git a/pkgs/development/compilers/ghcjs/default.nix b/pkgs/development/compilers/ghcjs/default.nix
index fb8d789f533..f677cd77122 100644
--- a/pkgs/development/compilers/ghcjs/default.nix
+++ b/pkgs/development/compilers/ghcjs/default.nix
@@ -136,6 +136,9 @@ in mkDerivation (rec {
     isGhcjs = true;
     inherit nodejs ghcjsBoot;
     inherit (ghcjsNodePkgs) "socket.io";
+    mkStage2 = import ./stage2.nix {
+      inherit ghcjsBoot;
+    };
   };
 
   homepage = "https://github.com/ghcjs/ghcjs";
diff --git a/pkgs/development/haskell-modules/ghcjs/gen-stage2.rb b/pkgs/development/compilers/ghcjs/gen-stage2.rb
index c801dbe3e4b..709e635db55 100644..100755
--- a/pkgs/development/haskell-modules/ghcjs/gen-stage2.rb
+++ b/pkgs/development/compilers/ghcjs/gen-stage2.rb
@@ -26,10 +26,10 @@ stage2_packages = [
 ]
 
 nixpkgs = File.expand_path("../../../../..", __FILE__)
-boot = `nix-build #{nixpkgs} -A haskell.packages.ghcjs.ghc.ghcjsBoot`.chomp
+boot = ARGV[0] || `nix-build #{nixpkgs} -A haskell.packages.ghcjs.ghc.ghcjsBoot`.chomp
 
 out = "".dup
-out << "{ ghcjsBoot, callPackage }:\n"
+out << "{ ghcjsBoot }: { callPackage }:\n"
 out << "\n"
 out << "{\n"
 
@@ -37,6 +37,7 @@ stage2_packages.each do |package|
   name = Pathname.new(package).basename
   nix = `cabal2nix file://#{boot}/#{package}  --jailbreak`
   nix.sub!(/src =.*?$/, "src = \"${ghcjsBoot}/#{package}\";")
+  nix.sub!("  doCheck = false;\n", "")
   nix.sub!("libraryHaskellDepends", "doCheck = false;\n  libraryHaskellDepends")
   # cabal2nix somehow generates the deps for 'text' as if it had selected flag
   # 'integer-simple' (despite not passing the flag within the generated
diff --git a/pkgs/development/haskell-modules/ghcjs/stage2.nix b/pkgs/development/compilers/ghcjs/stage2.nix
index aca4c6c7828..8c68b6f15a6 100644
--- a/pkgs/development/haskell-modules/ghcjs/stage2.nix
+++ b/pkgs/development/compilers/ghcjs/stage2.nix
@@ -1,4 +1,4 @@
-{ ghcjsBoot, callPackage }:
+{ ghcjsBoot }: { callPackage }:
 
 {
   async = callPackage
diff --git a/pkgs/development/haskell-modules/configuration-ghcjs.nix b/pkgs/development/haskell-modules/configuration-ghcjs.nix
index d75a7f889aa..fffe29b1bc3 100644
--- a/pkgs/development/haskell-modules/configuration-ghcjs.nix
+++ b/pkgs/development/haskell-modules/configuration-ghcjs.nix
@@ -9,11 +9,9 @@ with import ./lib.nix { inherit pkgs; };
 
 self: super:
   # The stage 2 packages. Regenerate with ./ghcjs/gen-stage2.rb
-  let stage2 =
-    (import ./ghcjs/stage2.nix {
+  let stage2 = super.ghc.mkStage2 {
        inherit (self) callPackage;
-       inherit (self.ghc) ghcjsBoot;
-    }); in stage2 // {
+    }; in stage2 // {
 
   old-time = overrideCabal stage2.old-time (drv: {
     postPatch = ''