nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 17.09 53 lines 2.0 kB view raw
1# Note: The Haskell package set used for building UHC is 2# determined in the file top-level/haskell-packages.nix. 3{ stdenv, coreutils, m4, libtool, clang, ghcWithPackages, fetchFromGitHub }: 4 5let wrappedGhc = ghcWithPackages (hpkgs: with hpkgs; [fgl vector syb uulib network binary hashable uhc-util mtl transformers directory containers array process filepath shuffle uuagc] ); 6in stdenv.mkDerivation rec { 7 version = "1.1.9.4"; 8 name = "uhc-${version}"; 9 10 src = fetchFromGitHub { 11 owner = "UU-ComputerScience"; 12 repo = "uhc"; 13 rev = "v${version}"; 14 sha256 = "1s84csk6zgzj09igxgdza7gb52jdn3jsr8lygl5xplshv8yzl34n"; 15 }; 16 17 postUnpack = "sourceRoot=\${sourceRoot}/EHC"; 18 19 buildInputs = [ m4 wrappedGhc clang libtool ]; 20 21 configureFlags = [ "--with-gcc=${clang}/bin/clang" ]; 22 23 # UHC builds packages during compilation; these are by default 24 # installed in the user-specific package config file. We do not 25 # want that, and hack the build process to use a temporary package 26 # configuration file instead. 27 preConfigure = '' 28 p=`pwd`/uhc-local-packages/ 29 ghc-pkg init $p 30 sed -i "s|--user|--package-db=$p|g" mk/shared.mk.in 31 sed -i "s|-fglasgow-exts|-fglasgow-exts -package-conf=$p|g" mk/shared.mk.in 32 sed -i "s|/bin/date|${coreutils}/bin/date|g" mk/dist.mk 33 sed -i "s|/bin/date|${coreutils}/bin/date|g" mk/config.mk.in 34 sed -i "s|--make|--make -package-db=$p|g" src/ehc/files2.mk 35 sed -i "s|--make|--make -package-db=$p|g" src/gen/files.mk 36 ''; 37 38 inherit clang; 39 40 meta = with stdenv.lib; { 41 homepage = http://www.cs.uu.nl/wiki/UHC; 42 description = "Utrecht Haskell Compiler"; 43 maintainers = [ maintainers.phile314 ]; 44 45 # UHC i686 support is broken, see 46 # https://github.com/UU-ComputerScience/uhc/issues/52 47 # 48 # Darwin build is broken as well at the moment. 49 # On Darwin, the GNU libtool is used, which does not 50 # support the -static flag and thus breaks the build. 51 platforms = ["x86_64-linux"]; 52 }; 53}