From 1ce75368f1a54c97c006c1abdd454aa00fdf9acf Mon Sep 17 00:00:00 2001 From: Philipp Hausmann Date: Fri, 6 Mar 2015 23:43:38 +0100 Subject: [PATCH] Add uhc haskell compiler --- lib/maintainers.nix | 1 + pkgs/development/compilers/uhc/default.nix | 46 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 6 +++ 3 files changed, 53 insertions(+) create mode 100644 pkgs/development/compilers/uhc/default.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 75fdb60e84b..4f858d91124 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -138,6 +138,7 @@ page = "Carles Pagès "; paholg = "Paho Lurie-Gregg "; pashev = "Igor Pashev "; + phausmann = "Philipp Hausmann "; phreedom = "Evgeny Egorochkin "; pierron = "Nicolas B. Pierron "; piotr = "Piotr Pietraszkiewicz "; diff --git a/pkgs/development/compilers/uhc/default.nix b/pkgs/development/compilers/uhc/default.nix new file mode 100644 index 00000000000..b3126c6604b --- /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; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 777c5e3d1ea..79423f3f4d6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3511,6 +3511,12 @@ let regexCompat HsSyck random; }; + uhc = callPackage ../development/compilers/uhc/default.nix ({ + stdenv = clangStdenv; + ghcWithPackages = haskellngPackages.ghcWithPackages; + inherit (haskellngPackages) shuffle binary hashable mtl network uhc-util uulib; + }); + gcc-arm-embedded-4_7 = callPackage_i686 ../development/compilers/gcc-arm-embedded { version = "4.7-2013q3-20130916"; releaseType = "update";