2016-01-29 16:46:56 +00:00
|
|
|
# Note: The Haskell package set used for building UHC is
|
|
|
|
# determined in the file top-level/haskell-packages.nix.
|
2016-02-26 07:54:33 +00:00
|
|
|
{ stdenv, coreutils, m4, libtool, clang, ghcWithPackages, fetchFromGitHub }:
|
2015-03-06 22:43:38 +00:00
|
|
|
|
2015-10-15 12:12:40 +01:00
|
|
|
let wrappedGhc = ghcWithPackages (hpkgs: with hpkgs; [fgl vector syb uulib network binary hashable uhc-util mtl transformers directory containers array process filepath shuffle uuagc] );
|
2015-03-06 22:43:38 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2016-02-26 07:54:33 +00:00
|
|
|
version = "1.1.9.3";
|
2015-03-06 22:43:38 +00:00
|
|
|
name = "uhc-${version}";
|
|
|
|
|
2016-02-26 07:54:33 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "UU-ComputerScience";
|
|
|
|
repo = "uhc";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1r3mja77dqj2ncgp1d9nnc7dhp3gzrb1b1qvml3rq2321mn3m2ad";
|
2015-03-06 22:43:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postUnpack = "sourceRoot=\${sourceRoot}/EHC";
|
|
|
|
|
2015-04-23 14:21:15 +01:00
|
|
|
buildInputs = [ m4 wrappedGhc clang libtool ];
|
2015-03-06 22:43:38 +00:00
|
|
|
|
|
|
|
configureFlags = [ "--with-gcc=${clang}/bin/clang" ];
|
|
|
|
|
|
|
|
# UHC builds packages during compilation; these are by default
|
|
|
|
# installed in the user-specific package config file. We do not
|
|
|
|
# want that, and hack the build process to use a temporary package
|
|
|
|
# configuration file instead.
|
|
|
|
preConfigure = ''
|
2015-04-30 10:45:05 +01:00
|
|
|
p=`pwd`/uhc-local-packages/
|
|
|
|
ghc-pkg init $p
|
2015-03-06 22:43:38 +00:00
|
|
|
sed -i "s|--user|--package-db=$p|g" mk/shared.mk.in
|
|
|
|
sed -i "s|-fglasgow-exts|-fglasgow-exts -package-conf=$p|g" mk/shared.mk.in
|
|
|
|
sed -i "s|/bin/date|${coreutils}/bin/date|g" mk/dist.mk
|
|
|
|
sed -i "s|/bin/date|${coreutils}/bin/date|g" mk/config.mk.in
|
|
|
|
sed -i "s|--make|--make -package-db=$p|g" src/ehc/files2.mk
|
|
|
|
sed -i "s|--make|--make -package-db=$p|g" src/gen/files.mk
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit clang;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "http://www.cs.uu.nl/wiki/UHC";
|
|
|
|
description = "Utrecht Haskell Compiler";
|
2015-12-27 18:12:37 +00:00
|
|
|
maintainers = [ maintainers.phile314 ];
|
2015-03-30 17:47:38 +01:00
|
|
|
|
|
|
|
# UHC i686 support is broken, see
|
|
|
|
# https://github.com/UU-ComputerScience/uhc/issues/52
|
|
|
|
#
|
|
|
|
# Darwin build is broken as well at the moment.
|
|
|
|
# On Darwin, the GNU libtool is used, which does not
|
|
|
|
# support the -static flag and thus breaks the build.
|
|
|
|
platforms = ["x86_64-linux"];
|
2015-03-06 22:43:38 +00:00
|
|
|
};
|
|
|
|
}
|