Merge pull request #47443 from obsidiansystems/ghcjs-no-double-callPackage

ghcjs-{7.10, 8.0}: Improve overriding situation
This commit is contained in:
John Ericson 2018-09-27 19:11:49 -04:00 committed by GitHub
commit 33716c1d4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 66 additions and 51 deletions

View file

@ -0,0 +1,50 @@
{ fetchgit, fetchFromGitHub, bootPkgs, cabal-install }:
bootPkgs.callPackage ../base.nix {
version = "0.2.0";
inherit bootPkgs cabal-install;
ghcjsSrc = fetchFromGitHub {
owner = "ghcjs";
repo = "ghcjs";
rev = "689c7753f50353dd05606ed79c51cd5a94d3922a";
sha256 = "076020a9gjv8ldj5ckm43sbzq9s6c5xj6lpd8v28ybpiama3m6b4";
};
ghcjsBootSrc = fetchgit {
url = git://github.com/ghcjs/ghcjs-boot.git;
rev = "8c549931da27ba9e607f77195208ec156c840c8a";
sha256 = "0yg9bnabja39qysh9pg1335qbvbc0r2mdw6cky94p7kavacndfdv";
fetchSubmodules = true;
};
shims = import ./shims.nix { inherit fetchFromGitHub; };
stage1Packages = [
"array"
"base"
"binary"
"bytestring"
"containers"
"deepseq"
"directory"
"filepath"
"ghc-boot"
"ghc-boot-th"
"ghc-prim"
"ghci"
"ghcjs-prim"
"ghcjs-th"
"integer-gmp"
"pretty"
"primitive"
"process"
"rts"
"template-haskell"
"time"
"transformers"
"unix"
];
stage2 = import ./stage2.nix;
patches = [ ./boot.patch ];
}

View file

@ -1,6 +1,6 @@
{ fetchgit, fetchFromGitHub, bootPkgs, cabal-install }: { fetchgit, fetchFromGitHub, bootPkgs, cabal-install }:
bootPkgs.callPackage ./base.nix { bootPkgs.callPackage ../base.nix {
version = "0.2.020170323"; version = "0.2.020170323";
inherit bootPkgs cabal-install; inherit bootPkgs cabal-install;
@ -18,7 +18,7 @@ bootPkgs.callPackage ./base.nix {
fetchSubmodules = true; fetchSubmodules = true;
}; };
shims = import ./head_shims.nix { inherit fetchFromGitHub; }; shims = import ./shims.nix { inherit fetchFromGitHub; };
stage1Packages = [ stage1Packages = [
"array" "array"
"base" "base"
@ -44,7 +44,7 @@ bootPkgs.callPackage ./base.nix {
"transformers" "transformers"
"unix" "unix"
]; ];
stage2 = import ./head_stage2.nix; stage2 = import ./stage2.nix;
patches = [ ./ghcjs-head.patch ]; patches = [ ./boot.patch ];
} }

View file

@ -37,57 +37,23 @@
, coreutils , coreutils
, libiconv , libiconv
, version ? "0.2.0" , version
, ghcjsSrc ? fetchFromGitHub { , ghcjsSrc
owner = "ghcjs"; , ghcjsBootSrc
repo = "ghcjs";
rev = "689c7753f50353dd05606ed79c51cd5a94d3922a";
sha256 = "076020a9gjv8ldj5ckm43sbzq9s6c5xj6lpd8v28ybpiama3m6b4";
}
, ghcjsBootSrc ? fetchgit {
url = git://github.com/ghcjs/ghcjs-boot.git;
rev = "8c549931da27ba9e607f77195208ec156c840c8a";
sha256 = "0yg9bnabja39qysh9pg1335qbvbc0r2mdw6cky94p7kavacndfdv";
fetchSubmodules = true;
}
, ghcjsBoot ? import ./ghcjs-boot.nix { , ghcjsBoot ? import ./ghcjs-boot.nix {
inherit runCommand; inherit runCommand;
src = ghcjsBootSrc; src = ghcjsBootSrc;
} }
, shims ? import ./shims.nix { inherit fetchFromGitHub; } , shims
# This is the list of the Stage 1 packages that are built into a booted ghcjs installation # This is the list of the Stage 1 packages that are built into a booted ghcjs installation
# It can be generated with the command: # It can be generated with the command:
# nix-shell -p haskell.packages.ghcjs.ghc --command "ghcjs-pkg list | sed -n 's/^ \(.*\)-\([0-9.]*\)$/\1_\2/ p' | sed 's/\./_/g' | sed 's/^\([^_]*\)\(.*\)$/ \"\1\"/'" # nix-shell -p haskell.packages.ghcjs.ghc --command "ghcjs-pkg list | sed -n 's/^ \(.*\)-\([0-9.]*\)$/\1_\2/ p' | sed 's/\./_/g' | sed 's/^\([^_]*\)\(.*\)$/ \"\1\"/'"
, stage1Packages ? [ , stage1Packages
"array"
"base"
"binary"
"bytestring"
"containers"
"deepseq"
"directory"
"filepath"
"ghc-boot"
"ghc-boot-th"
"ghc-prim"
"ghci"
"ghcjs-prim"
"ghcjs-th"
"integer-gmp"
"pretty"
"primitive"
"process"
"rts"
"template-haskell"
"time"
"transformers"
"unix"
]
, stage2 ? import ./stage2.nix , stage2 ? import ./stage2.nix
, patches ? [ ./ghcjs.patch ] , patches
# used for resolving compiler plugins # used for resolving compiler plugins
, ghcLibdir ? null , ghcLibdir ? null

View file

@ -1,5 +0,0 @@
{ bootPkgs, cabal-install }:
bootPkgs.callPackage ./base.nix {
inherit bootPkgs cabal-install;
}

View file

@ -80,13 +80,17 @@ in {
llvmPackages = pkgs.llvmPackages_5; llvmPackages = pkgs.llvmPackages_5;
}; };
ghcjs = compiler.ghcjs84; ghcjs = compiler.ghcjs84;
ghcjs710 = packages.ghc7103.callPackage ../development/compilers/ghcjs { # Use `import` because `callPackage inside`.
ghcjs710 = import ../development/compilers/ghcjs/7.10 {
bootPkgs = packages.ghc7103; bootPkgs = packages.ghc7103;
inherit (pkgs) cabal-install; inherit (pkgs) cabal-install;
inherit (buildPackages) fetchgit fetchFromGitHub;
}; };
ghcjs80 = packages.ghc802.callPackage ../development/compilers/ghcjs/head.nix { # `import` on purpose; see above.
ghcjs80 = import ../development/compilers/ghcjs/8.0 {
bootPkgs = packages.ghc802; bootPkgs = packages.ghc802;
inherit (pkgs) cabal-install; inherit (pkgs) cabal-install;
inherit (buildPackages) fetchgit fetchFromGitHub;
}; };
ghcjs82 = callPackage ../development/compilers/ghcjs-ng { ghcjs82 = callPackage ../development/compilers/ghcjs-ng {
bootPkgs = packages.ghc822; bootPkgs = packages.ghc822;