diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix index 934e05465c7..10c0b46f8ff 100644 --- a/pkgs/development/compilers/ghc/8.2.2.nix +++ b/pkgs/development/compilers/ghc/8.2.2.nix @@ -1,6 +1,5 @@ { stdenv, targetPackages , buildPlatform, hostPlatform, targetPlatform -, selfPkgs, cross ? null # build-tools , bootPkgs, alex, happy, hscolour, llvm_39 @@ -29,7 +28,7 @@ let BuildFlavour = perf-cross ''; in -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { version = "8.2.2"; name = "${targetPrefix}ghc-${version}"; @@ -89,11 +88,6 @@ stdenv.mkDerivation (rec { passthru = { inherit bootPkgs targetPrefix; - } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) { - crossCompiler = selfPkgs.ghc.override { - cross = targetPlatform; - bootPkgs = selfPkgs; - }; }; meta = { @@ -103,24 +97,4 @@ stdenv.mkDerivation (rec { inherit (ghc.meta) license platforms; }; -} // stdenv.lib.optionalAttrs (cross != null) { - configureFlags = [ - "CC=${stdenv.cc}/bin/${cross.config}-cc" - "LD=${stdenv.cc.bintools}/bin/${cross.config}-ld" - "AR=${stdenv.cc.bintools}/bin/${cross.config}-ar" - "NM=${stdenv.cc.bintools}/bin/${cross.config}-nm" - "RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib" - "--target=${cross.config}" - "--enable-bootstrap-with-devel-snapshot" - ] ++ - # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ - stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space"; - - configurePlatforms = []; - - passthru = { - inherit bootPkgs cross; - cc = "${stdenv.cc}/bin/${cross.config}-cc"; - ld = "${stdenv.cc}/bin/${cross.config}-ld"; - }; -}) +} diff --git a/pkgs/development/compilers/ghc/8.4.1.nix b/pkgs/development/compilers/ghc/8.4.1.nix index dd0be26da7c..498bba896ae 100644 --- a/pkgs/development/compilers/ghc/8.4.1.nix +++ b/pkgs/development/compilers/ghc/8.4.1.nix @@ -1,6 +1,5 @@ { stdenv, targetPackages , buildPlatform, hostPlatform, targetPlatform -, selfPkgs, cross ? null # build-tools , bootPkgs, alex, happy @@ -33,7 +32,7 @@ let BuildFlavour = perf-cross ''; in -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { inherit version rev; name = "${targetPrefix}ghc-${version}"; @@ -95,11 +94,6 @@ stdenv.mkDerivation (rec { passthru = { inherit bootPkgs targetPrefix; - } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) { - crossCompiler = selfPkgs.ghc.override { - cross = targetPlatform; - bootPkgs = selfPkgs; - }; }; meta = { @@ -109,24 +103,4 @@ stdenv.mkDerivation (rec { inherit (ghc.meta) license platforms; }; -} // stdenv.lib.optionalAttrs (cross != null) { - configureFlags = [ - "CC=${stdenv.cc}/bin/${cross.config}-cc" - "LD=${stdenv.cc.bintools}/bin/${cross.config}-ld" - "AR=${stdenv.cc.bintools}/bin/${cross.config}-ar" - "NM=${stdenv.cc.bintools}/bin/${cross.config}-nm" - "RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib" - "--target=${cross.config}" - "--enable-bootstrap-with-devel-snapshot" - ] ++ - # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ - stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space"; - - configurePlatforms = []; - - passthru = { - inherit bootPkgs cross; - cc = "${stdenv.cc}/bin/${cross.config}-cc"; - ld = "${stdenv.cc}/bin/${cross.config}-ld"; - }; -}) +} diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 6fb199b1a57..753c6bb5672 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -1,6 +1,5 @@ { stdenv, targetPackages , buildPlatform, hostPlatform, targetPlatform -, selfPkgs, cross ? null # build-tools , bootPkgs, alex, happy @@ -33,7 +32,7 @@ let BuildFlavour = perf-cross ''; in -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { inherit version rev; name = "${targetPrefix}ghc-${version}"; @@ -95,11 +94,6 @@ stdenv.mkDerivation (rec { passthru = { inherit bootPkgs targetPrefix; - } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) { - crossCompiler = selfPkgs.ghc.override { - cross = targetPlatform; - bootPkgs = selfPkgs; - }; }; meta = { @@ -109,24 +103,4 @@ stdenv.mkDerivation (rec { inherit (ghc.meta) license platforms; }; -} // stdenv.lib.optionalAttrs (cross != null) { - configureFlags = [ - "CC=${stdenv.cc}/bin/${cross.config}-cc" - "LD=${stdenv.cc.bintools}/bin/${cross.config}-ld" - "AR=${stdenv.cc.bintools}/bin/${cross.config}-ar" - "NM=${stdenv.cc.bintools}/bin/${cross.config}-nm" - "RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib" - "--target=${cross.config}" - "--enable-bootstrap-with-devel-snapshot" - ] ++ - # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/ - stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space"; - - configurePlatforms = []; - - passthru = { - inherit bootPkgs cross; - cc = "${stdenv.cc}/bin/${cross.config}-cc"; - ld = "${stdenv.cc}/bin/${cross.config}-ld"; - }; -}) +} diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index 8f035cfd575..aa0869cccc5 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -1,4 +1,7 @@ -{ pkgs, lib, newScope, stdenv, buildPlatform, targetPlatform, cabal-install }: +{ buildPackages, pkgs +, newScope, stdenv +, buildPlatform, targetPlatform +}: let # These are attributes in compiler and packages that don't support integer-simple. @@ -76,27 +79,22 @@ in rec { inherit (bootPkgs) hscolour alex happy; inherit buildPlatform targetPlatform; sphinx = pkgs.python3Packages.sphinx; - selfPkgs = packages.ghc822; }; ghc841 = callPackage ../development/compilers/ghc/8.4.1.nix rec { bootPkgs = packages.ghc821Binary; inherit (bootPkgs) alex happy; - inherit buildPlatform targetPlatform; - selfPkgs = packages.ghc841; }; ghcHEAD = callPackage ../development/compilers/ghc/head.nix rec { bootPkgs = packages.ghc821Binary; inherit (bootPkgs) alex happy; - inherit buildPlatform targetPlatform; - selfPkgs = packages.ghcHEAD; }; ghcjs = packages.ghc7103.callPackage ../development/compilers/ghcjs { bootPkgs = packages.ghc7103; - inherit cabal-install; + inherit (pkgs) cabal-install; }; ghcjsHEAD = packages.ghc802.callPackage ../development/compilers/ghcjs/head.nix { bootPkgs = packages.ghc802; - inherit cabal-install; + inherit (pkgs) cabal-install; }; ghcHaLVM240 = callPackage ../development/compilers/halvm/2.4.0.nix rec { bootPkgs = packages.ghc7103Binary; @@ -110,19 +108,17 @@ in rec { # The integer-simple attribute set contains all the GHC compilers # build with integer-simple instead of integer-gmp. - integer-simple = - let integerSimpleGhcNames = - pkgs.lib.filter (name: ! builtins.elem name integerSimpleExcludes) - (pkgs.lib.attrNames compiler); - integerSimpleGhcs = pkgs.lib.genAttrs integerSimpleGhcNames - (name: compiler."${name}".override { enableIntegerSimple = true; }); - in pkgs.recurseIntoAttrs (integerSimpleGhcs // { - ghcHEAD = integerSimpleGhcs.ghcHEAD.override { selfPkgs = packages.integer-simple.ghcHEAD; }; - }); - + integer-simple = let + integerSimpleGhcNames = pkgs.lib.filter + (name: ! builtins.elem name integerSimpleExcludes) + (pkgs.lib.attrNames compiler); + in pkgs.recurseIntoAttrs (pkgs.lib.genAttrs + integerSimpleGhcNames + (name: compiler."${name}".override { enableIntegerSimple = true; })); }; - packages = { + # Always get compilers from `buildPackages` + packages = let inherit (buildPackages.haskell) compiler; in { ghc7103 = callPackage ../development/haskell-modules { ghc = compiler.ghc7103; @@ -152,11 +148,6 @@ in rec { ghc = compiler.ghcHEAD; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { }; }; - # TODO Support for multiple variants here - ghcCross = callPackage ../development/haskell-modules { - ghc = compiler.ghcHEAD.crossCompiler; - compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { }; - }; ghcjs = callPackage ../development/haskell-modules { ghc = compiler.ghcjs; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; @@ -174,16 +165,16 @@ in rec { # The integer-simple attribute set contains package sets for all the GHC compilers # using integer-simple instead of integer-gmp. - integer-simple = - let integerSimpleGhcNames = - pkgs.lib.filter (name: ! builtins.elem name integerSimpleExcludes) - (pkgs.lib.attrNames packages); - in pkgs.lib.genAttrs integerSimpleGhcNames (name: packages."${name}".override { - ghc = compiler.integer-simple."${name}"; - overrides = _self : _super : { - integer-simple = null; - integer-gmp = null; - }; + integer-simple = let + integerSimpleGhcNames = pkgs.lib.filter + (name: ! builtins.elem name integerSimpleExcludes) + (pkgs.lib.attrNames packages); + in pkgs.lib.genAttrs integerSimpleGhcNames (name: packages."${name}".override { + ghc = compiler.integer-simple."${name}"; + overrides = _self : _super : { + integer-simple = null; + integer-gmp = null; + }; }); };