about summary refs log tree commit diff
path: root/pkgs/development/compilers/uhc
diff options
context:
space:
mode:
authorPhilipp Hausmann <ph_git@314.ch>2015-03-06 23:43:38 +0100
committerPhilipp Hausmann <ph_git@314.ch>2015-03-09 13:38:28 +0100
commit1ce75368f1a54c97c006c1abdd454aa00fdf9acf (patch)
treefe7e192d04268c28a010f8284cb8d6bdf4e86a68 /pkgs/development/compilers/uhc
parentb8020184823194a1853b000ef9aeb8e4d12d733f (diff)
downloadnixlib-1ce75368f1a54c97c006c1abdd454aa00fdf9acf.tar
nixlib-1ce75368f1a54c97c006c1abdd454aa00fdf9acf.tar.gz
nixlib-1ce75368f1a54c97c006c1abdd454aa00fdf9acf.tar.bz2
nixlib-1ce75368f1a54c97c006c1abdd454aa00fdf9acf.tar.lz
nixlib-1ce75368f1a54c97c006c1abdd454aa00fdf9acf.tar.xz
nixlib-1ce75368f1a54c97c006c1abdd454aa00fdf9acf.tar.zst
nixlib-1ce75368f1a54c97c006c1abdd454aa00fdf9acf.zip
Add uhc haskell compiler
Diffstat (limited to 'pkgs/development/compilers/uhc')
-rw-r--r--pkgs/development/compilers/uhc/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/development/compilers/uhc/default.nix b/pkgs/development/compilers/uhc/default.nix
new file mode 100644
index 000000000000..b3126c6604bc
--- /dev/null
+++ b/pkgs/development/compilers/uhc/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, coreutils, fetchgit, m4, libtool, clang, ghcWithPackages,
+  shuffle,
+  binary, hashable, mtl, network, uhc-util, uulib
+}:
+
+let wrappedGhc = ghcWithPackages ( self: [binary hashable mtl network uhc-util uulib] );
+in stdenv.mkDerivation rec {
+  version = "1.1.8.7";
+  name = "uhc-${version}";
+
+  src = fetchgit {
+    url = "https://github.com/UU-ComputerScience/uhc.git";
+    rev = "0dec07e9cb60e78bbca63fc101f8fec6e249269f";
+    sha256 = "0isz3qz23ihbn0rg54x8ddzwpsqlmmpkvaa66b7srfly7nciv8gl";
+  };
+
+  postUnpack = "sourceRoot=\${sourceRoot}/EHC";
+
+  buildInputs = [ m4 wrappedGhc clang libtool shuffle ];
+
+  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 = ''
+    p=`pwd`/uhc-local-packages
+    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
+    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";
+    maintainers = [ maintainers.phausmann ];
+    platforms = stdenv.lib.platforms.unix;
+  };
+}