2017-02-04 18:19:14 +01:00
|
|
|
{ stdenv, fetchgit, bootPkgs, perl, gmp, ncurses, binutils, autoconf, alex, happy, makeStaticLibraries
|
|
|
|
, hscolour, xen, automake, gcc, git, zlib, libtool, enableIntegerSimple ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "2.4.0";
|
|
|
|
name = "HaLVM-${version}";
|
|
|
|
isHaLVM = true;
|
2017-04-19 22:20:51 +02:00
|
|
|
enableParallelBuilding = false;
|
2017-02-04 18:19:14 +01:00
|
|
|
isGhcjs = false;
|
|
|
|
src = fetchgit {
|
2017-04-14 06:21:38 +02:00
|
|
|
rev = "65fad65966eb7e60f234453a35aeb564a09d2595";
|
2017-02-04 18:19:14 +01:00
|
|
|
url = "https://github.com/GaloisInc/HaLVM";
|
2017-04-14 06:21:38 +02:00
|
|
|
sha256 = "09633h38w0z20cz0wcfp9z5kzv8v1zwcv0wqvgq3c8svqbrxp28k";
|
2017-02-04 18:19:14 +01:00
|
|
|
};
|
|
|
|
prePatch = ''
|
2017-04-14 06:21:38 +02:00
|
|
|
sed -i '305 d' Makefile
|
|
|
|
sed -i '309,439 d' Makefile # Removes RPM packaging
|
2017-02-04 18:19:14 +01:00
|
|
|
sed -i '20 d' src/scripts/halvm-cabal.in
|
|
|
|
sed -ie 's|ld |${binutils}/bin/ld |g' src/scripts/ldkernel.in
|
|
|
|
'';
|
|
|
|
configureFlags = stdenv.lib.optional (!enableIntegerSimple) [ "--enable-gmp" ];
|
2017-09-06 09:40:01 +02:00
|
|
|
propagatedNativeBuildInputs = [ alex happy ];
|
2017-02-04 18:19:14 +01:00
|
|
|
buildInputs =
|
2017-09-06 09:40:01 +02:00
|
|
|
let haskellPkgs = [ alex happy bootPkgs.hscolour bootPkgs.cabal-install bootPkgs.haddock bootPkgs.hpc
|
2017-02-04 18:19:14 +01:00
|
|
|
]; in [ bootPkgs.ghc
|
|
|
|
automake perl git binutils
|
|
|
|
autoconf xen zlib ncurses.dev
|
|
|
|
libtool gmp ] ++ haskellPkgs;
|
|
|
|
preConfigure = ''
|
|
|
|
autoconf
|
|
|
|
patchShebangs .
|
|
|
|
'';
|
|
|
|
hardeningDisable = ["all"];
|
2017-04-22 19:33:01 +02:00
|
|
|
postInstall = ''
|
|
|
|
patchShebangs $out/bin
|
|
|
|
$out/bin/halvm-ghc-pkg recache
|
|
|
|
'';
|
2017-02-04 18:19:14 +01:00
|
|
|
passthru = {
|
|
|
|
inherit bootPkgs;
|
|
|
|
cross.config = "halvm";
|
|
|
|
cc = "${gcc}/bin/gcc";
|
|
|
|
ld = "${binutils}/bin/ld";
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
2017-08-17 23:53:40 +02:00
|
|
|
homepage = https://github.com/GaloisInc/HaLVM;
|
2017-02-04 18:19:14 +01:00
|
|
|
description = "The Haskell Lightweight Virtual Machine (HaLVM): GHC running on Xen";
|
2017-04-24 15:18:15 +02:00
|
|
|
platforms = ["x86_64-linux"]; # other platforms don't have Xen
|
2017-02-04 18:19:14 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ dmjio ];
|
2017-04-24 15:18:15 +02:00
|
|
|
inherit (bootPkgs.ghc.meta) license;
|
2017-08-23 16:46:56 +02:00
|
|
|
broken = true; # https://nix-cache.s3.amazonaws.com/log/6i98mhbq9nzzhwr4svlivm4gz91l2w0f-HaLVM-2.4.0.drv
|
2017-02-04 18:19:14 +01:00
|
|
|
};
|
|
|
|
}
|