about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/haskell-modules/configuration-ghcjs.nix6
-rw-r--r--pkgs/development/haskell-modules/ghcjs/gen-stage2.rb22
-rw-r--r--pkgs/development/haskell-modules/ghcjs/stage2.nix6
3 files changed, 24 insertions, 10 deletions
diff --git a/pkgs/development/haskell-modules/configuration-ghcjs.nix b/pkgs/development/haskell-modules/configuration-ghcjs.nix
index 53da845210e2..ac7a30d4cfb0 100644
--- a/pkgs/development/haskell-modules/configuration-ghcjs.nix
+++ b/pkgs/development/haskell-modules/configuration-ghcjs.nix
@@ -49,7 +49,11 @@ self: super:
   time = null;
   transformers = null;
   unix = null;
-  integer-simple = null;
+
+  # Don't set integer-simple to null!
+  # GHCJS uses integer-gmp, so any package expression that depends on
+  # integer-simple is wrong.
+  #integer-simple = null;
 
   # These packages are core libraries in GHC 7.10.x, but not here.
   bin-package-db = null;
diff --git a/pkgs/development/haskell-modules/ghcjs/gen-stage2.rb b/pkgs/development/haskell-modules/ghcjs/gen-stage2.rb
index 260e2ee2f12c..c801dbe3e4b7 100644
--- a/pkgs/development/haskell-modules/ghcjs/gen-stage2.rb
+++ b/pkgs/development/haskell-modules/ghcjs/gen-stage2.rb
@@ -28,16 +28,26 @@ stage2_packages = [
 nixpkgs = File.expand_path("../../../../..", __FILE__)
 boot = `nix-build #{nixpkgs} -A haskell.packages.ghcjs.ghc.ghcjsBoot`.chomp
 
+out = "".dup
+out << "{ ghcjsBoot, callPackage }:\n"
+out << "\n"
+out << "{\n"
+
 stage2_packages.each do |package|
   name = Pathname.new(package).basename
   nix = `cabal2nix file://#{boot}/#{package}  --jailbreak`
   nix.sub!(/src =.*?$/, "src = \"${ghcjsBoot}/#{package}\";")
   nix.sub!("libraryHaskellDepends", "doCheck = false;\n  libraryHaskellDepends")
-  nix = nix.split("\n").join("\n    ")
-
-  out = "".dup
-  out << "#{name} = callPackage\n"
-  out << "  (#{nix}) {};"
+  # cabal2nix somehow generates the deps for 'text' as if it had selected flag
+  # 'integer-simple' (despite not passing the flag within the generated
+  # expression). We want integer-gmp instead.
+  nix.gsub!(/integer-simple/, "integer-gmp")
+  nix = nix.split("\n").join("\n      ")
 
-  puts out
+  out << "  #{name} = callPackage\n"
+  out << "    (#{nix}) {};\n"
 end
+
+out << "}"
+
+puts out
diff --git a/pkgs/development/haskell-modules/ghcjs/stage2.nix b/pkgs/development/haskell-modules/ghcjs/stage2.nix
index f840869568c9..f84ddbdefa45 100644
--- a/pkgs/development/haskell-modules/ghcjs/stage2.nix
+++ b/pkgs/development/haskell-modules/ghcjs/stage2.nix
@@ -225,7 +225,7 @@
       }) {};
   text = callPackage
     ({ mkDerivation, array, base, binary, bytestring, deepseq, directory
-      , ghc-prim, HUnit, integer-simple, QuickCheck, quickcheck-unicode
+      , ghc-prim, HUnit, integer-gmp, QuickCheck, quickcheck-unicode
       , random, stdenv, test-framework, test-framework-hunit
       , test-framework-quickcheck2
       }:
@@ -235,11 +235,11 @@
         src = "${ghcjsBoot}/boot/text";
         doCheck = false;
         libraryHaskellDepends = [
-          array base binary bytestring deepseq ghc-prim integer-simple
+          array base binary bytestring deepseq ghc-prim integer-gmp
         ];
         testHaskellDepends = [
           array base binary bytestring deepseq directory ghc-prim HUnit
-          integer-simple QuickCheck quickcheck-unicode random test-framework
+          integer-gmp QuickCheck quickcheck-unicode random test-framework
           test-framework-hunit test-framework-quickcheck2
         ];
         jailbreak = true;