2012-04-09 11:17:17 +01:00
|
|
|
{ stdenv, coreutils, glibc, fetchgit, m4, libtool, ghc, uulib
|
2011-09-05 20:24:07 +01:00
|
|
|
, uuagc, mtl, network, binary, llvm, fgl, syb
|
|
|
|
}:
|
2008-03-13 18:02:48 +00:00
|
|
|
|
2012-06-11 19:58:28 +01:00
|
|
|
# this check won't be needed anymore after ghc-wrapper is fixed
|
|
|
|
# to show ghc-builtin packages in "ghc-pkg list" output.
|
2013-10-26 17:33:09 +01:00
|
|
|
let binaryIsBuiltIn = builtins.compareVersions "7.2.1" ghc.version != 1;
|
2012-06-11 19:58:28 +01:00
|
|
|
|
|
|
|
in stdenv.mkDerivation {
|
2012-05-09 11:01:41 +01:00
|
|
|
name = "uhc-svn-git20120502";
|
2008-03-13 18:02:48 +00:00
|
|
|
|
2012-04-09 11:17:17 +01:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/UU-ComputerScience/uhc.git";
|
2012-05-09 11:01:41 +01:00
|
|
|
rev = "ab26d787657bb729d8a4f92ef5d067d9990f6ce3";
|
|
|
|
sha256 = "66c5b6d95dc80a652f6e17476a1b18fbef4b4ff6199a92d033f0055526ec97ff";
|
2008-03-13 18:02:48 +00:00
|
|
|
};
|
|
|
|
|
2012-04-09 11:17:17 +01:00
|
|
|
postUnpack = "sourceRoot=\${sourceRoot}/EHC";
|
|
|
|
|
2011-09-05 20:24:07 +01:00
|
|
|
propagatedBuildInputs = [mtl network binary fgl syb];
|
2010-04-29 18:35:09 +01:00
|
|
|
buildInputs = [coreutils m4 ghc libtool uulib uuagc];
|
2008-03-13 18:02:48 +00:00
|
|
|
|
2011-12-11 19:54:40 +00:00
|
|
|
# Can we rename this flag to "--with-cpp-uhc-options"?
|
2011-09-05 20:24:07 +01:00
|
|
|
configureFlags = "--with-cpp-ehc-options=-I${glibc}/include";
|
2010-04-29 18:35:09 +01:00
|
|
|
|
2011-12-11 19:54:40 +00:00
|
|
|
# UHC builds packages during compilation; these are by default
|
2010-04-29 18:35:09 +01:00
|
|
|
# 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.
|
2008-03-13 18:02:48 +00:00
|
|
|
preConfigure = ''
|
2011-12-11 19:54:40 +00:00
|
|
|
p=`pwd`/uhc-local-packages
|
2010-04-29 18:35:09 +01:00
|
|
|
echo '[]' > $p
|
|
|
|
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
|
2008-03-13 18:02:48 +00:00
|
|
|
sed -i "s|/bin/date|${coreutils}/bin/date|g" mk/dist.mk
|
2012-03-22 22:37:08 +00:00
|
|
|
sed -i "s|/bin/date|${coreutils}/bin/date|g" mk/config.mk.in
|
2012-06-11 19:58:28 +01:00
|
|
|
'' + stdenv.lib.optionalString binaryIsBuiltIn ''
|
|
|
|
sed -i "s|ghcLibBinary=no|ghcLibBinaryExists=yes|" configure
|
2008-03-13 18:02:48 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2011-12-11 19:54:40 +00:00
|
|
|
homepage = "http://www.cs.uu.nl/wiki/UHC";
|
|
|
|
description = "Utrecht Haskell Compiler";
|
2011-09-05 20:24:07 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [
|
|
|
|
stdenv.lib.maintainers.andres
|
|
|
|
];
|
2008-03-13 18:02:48 +00:00
|
|
|
};
|
2011-09-05 20:24:07 +01:00
|
|
|
}
|