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.
This commit is contained in:
parent
3badad811c
commit
c564997ba0
|
@ -136,6 +136,9 @@ in mkDerivation (rec {
|
||||||
isGhcjs = true;
|
isGhcjs = true;
|
||||||
inherit nodejs ghcjsBoot;
|
inherit nodejs ghcjsBoot;
|
||||||
inherit (ghcjsNodePkgs) "socket.io";
|
inherit (ghcjsNodePkgs) "socket.io";
|
||||||
|
mkStage2 = import ./stage2.nix {
|
||||||
|
inherit ghcjsBoot;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
homepage = "https://github.com/ghcjs/ghcjs";
|
homepage = "https://github.com/ghcjs/ghcjs";
|
||||||
|
|
5
pkgs/development/haskell-modules/ghcjs/gen-stage2.rb → pkgs/development/compilers/ghcjs/gen-stage2.rb
Normal file → Executable file
5
pkgs/development/haskell-modules/ghcjs/gen-stage2.rb → pkgs/development/compilers/ghcjs/gen-stage2.rb
Normal file → Executable file
|
@ -26,10 +26,10 @@ stage2_packages = [
|
||||||
]
|
]
|
||||||
|
|
||||||
nixpkgs = File.expand_path("../../../../..", __FILE__)
|
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 = "".dup
|
||||||
out << "{ ghcjsBoot, callPackage }:\n"
|
out << "{ ghcjsBoot }: { callPackage }:\n"
|
||||||
out << "\n"
|
out << "\n"
|
||||||
out << "{\n"
|
out << "{\n"
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ stage2_packages.each do |package|
|
||||||
name = Pathname.new(package).basename
|
name = Pathname.new(package).basename
|
||||||
nix = `cabal2nix file://#{boot}/#{package} --jailbreak`
|
nix = `cabal2nix file://#{boot}/#{package} --jailbreak`
|
||||||
nix.sub!(/src =.*?$/, "src = \"${ghcjsBoot}/#{package}\";")
|
nix.sub!(/src =.*?$/, "src = \"${ghcjsBoot}/#{package}\";")
|
||||||
|
nix.sub!(" doCheck = false;\n", "")
|
||||||
nix.sub!("libraryHaskellDepends", "doCheck = false;\n libraryHaskellDepends")
|
nix.sub!("libraryHaskellDepends", "doCheck = false;\n libraryHaskellDepends")
|
||||||
# cabal2nix somehow generates the deps for 'text' as if it had selected flag
|
# cabal2nix somehow generates the deps for 'text' as if it had selected flag
|
||||||
# 'integer-simple' (despite not passing the flag within the generated
|
# 'integer-simple' (despite not passing the flag within the generated
|
|
@ -1,4 +1,4 @@
|
||||||
{ ghcjsBoot, callPackage }:
|
{ ghcjsBoot }: { callPackage }:
|
||||||
|
|
||||||
{
|
{
|
||||||
async = callPackage
|
async = callPackage
|
|
@ -9,11 +9,9 @@ with import ./lib.nix { inherit pkgs; };
|
||||||
|
|
||||||
self: super:
|
self: super:
|
||||||
# The stage 2 packages. Regenerate with ./ghcjs/gen-stage2.rb
|
# The stage 2 packages. Regenerate with ./ghcjs/gen-stage2.rb
|
||||||
let stage2 =
|
let stage2 = super.ghc.mkStage2 {
|
||||||
(import ./ghcjs/stage2.nix {
|
|
||||||
inherit (self) callPackage;
|
inherit (self) callPackage;
|
||||||
inherit (self.ghc) ghcjsBoot;
|
}; in stage2 // {
|
||||||
}); in stage2 // {
|
|
||||||
|
|
||||||
old-time = overrideCabal stage2.old-time (drv: {
|
old-time = overrideCabal stage2.old-time (drv: {
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
|
|
Loading…
Reference in New Issue