ghcjs: init at 8.10.7
The src points to the obsidiansystems repo as it has the ghcjs ported from 8.10.5 to 8.10.7, and a bunch of other fixes (#812, #811, #809) (cherry picked from commit ba25b274f4bb0240a8ffa71e41b55712930af3d8) Modified the stm_2_5_0_1 -> stm_2_5_0_0
This commit is contained in:
@@ -0,0 +1,114 @@
|
||||
{ stdenv
|
||||
, pkgsHostHost
|
||||
, callPackage
|
||||
, fetchgit
|
||||
, ghcjsSrcJson ? null
|
||||
, ghcjsSrc ? fetchgit (builtins.fromJSON (builtins.readFile ghcjsSrcJson))
|
||||
, bootPkgs
|
||||
, stage0
|
||||
, haskellLib
|
||||
, cabal-install
|
||||
, nodejs
|
||||
, makeWrapper
|
||||
, xorg
|
||||
, gmp
|
||||
, pkg-config
|
||||
, gcc
|
||||
, lib
|
||||
, ghcjsDepOverrides ? (_:_:{})
|
||||
, haskell
|
||||
, linkFarm
|
||||
, buildPackages
|
||||
}:
|
||||
|
||||
let
|
||||
passthru = {
|
||||
configuredSrc = callPackage ./configured-ghcjs-src.nix {
|
||||
inherit ghcjsSrc;
|
||||
inherit (bootPkgs) ghc alex;
|
||||
inherit (bootGhcjs) version;
|
||||
happy = bootPkgs.happy_1_19_12;
|
||||
};
|
||||
bootPkgs = bootPkgs.extend (lib.foldr lib.composeExtensions (_:_:{}) [
|
||||
(self: _: import stage0 {
|
||||
inherit (passthru) configuredSrc;
|
||||
inherit (self) callPackage;
|
||||
})
|
||||
|
||||
(callPackage ./common-overrides.nix {
|
||||
inherit haskellLib;
|
||||
})
|
||||
ghcjsDepOverrides
|
||||
]);
|
||||
|
||||
targetPrefix = "";
|
||||
inherit bootGhcjs;
|
||||
inherit (bootGhcjs) version;
|
||||
isGhcjs = true;
|
||||
|
||||
enableShared = true;
|
||||
|
||||
socket-io = pkgsHostHost.nodePackages."socket.io";
|
||||
|
||||
haskellCompilerName = "ghcjs-${bootGhcjs.version}";
|
||||
};
|
||||
|
||||
bootGhcjs = haskellLib.justStaticExecutables passthru.bootPkgs.ghcjs;
|
||||
|
||||
# This provides the stuff we need from the emsdk
|
||||
emsdk = linkFarm "emsdk" [
|
||||
{ name = "upstream/bin"; path = buildPackages.clang + "/bin";}
|
||||
{ name = "upstream/emscripten"; path = buildPackages.emscripten + "/bin"; }
|
||||
];
|
||||
|
||||
in stdenv.mkDerivation {
|
||||
name = bootGhcjs.name;
|
||||
src = passthru.configuredSrc;
|
||||
nativeBuildInputs = [
|
||||
bootGhcjs
|
||||
passthru.bootPkgs.ghc
|
||||
cabal-install
|
||||
nodejs
|
||||
makeWrapper
|
||||
xorg.lndir
|
||||
gmp
|
||||
pkg-config
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
gcc # https://github.com/ghcjs/ghcjs/issues/663
|
||||
];
|
||||
dontConfigure = true;
|
||||
dontInstall = true;
|
||||
buildPhase = ''
|
||||
export HOME=$TMP
|
||||
mkdir $HOME/.cabal
|
||||
touch $HOME/.cabal/config
|
||||
cd lib/boot
|
||||
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/lib/${bootGhcjs.name}
|
||||
lndir ${bootGhcjs}/bin $out/bin
|
||||
chmod -R +w $out/bin
|
||||
rm $out/bin/ghcjs-boot
|
||||
cp ${bootGhcjs}/bin/ghcjs-boot $out/bin
|
||||
rm $out/bin/haddock
|
||||
cp ${bootGhcjs}/bin/haddock $out/bin
|
||||
cp ${bootGhcjs}/bin/private-ghcjs-hsc2hs $out/bin/ghcjs-hsc2hs
|
||||
|
||||
wrapProgram $out/bin/ghcjs-boot --set ghcjs_libexecdir $out/bin
|
||||
|
||||
wrapProgram $out/bin/ghcjs --add-flags "-B$out/lib/${bootGhcjs.name}"
|
||||
wrapProgram $out/bin/haddock --add-flags "-B$out/lib/${bootGhcjs.name}"
|
||||
wrapProgram $out/bin/ghcjs-pkg --add-flags "--global-package-db=$out/lib/${bootGhcjs.name}/package.conf.d"
|
||||
wrapProgram $out/bin/ghcjs-hsc2hs --add-flags "-I$out/lib/${bootGhcjs.name}/include --template=$out/lib/${bootGhcjs.name}/include/template-hsc.h"
|
||||
|
||||
env PATH=$out/bin:$PATH $out/bin/ghcjs-boot --with-emsdk=${emsdk} --no-haddock
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
inherit passthru;
|
||||
|
||||
# The emscripten is broken on darwin
|
||||
meta.platforms = lib.platforms.linux;
|
||||
meta.maintainers = with lib.maintainers; [ obsidian-systems-maintenance ];
|
||||
}
|
||||
Reference in New Issue
Block a user