├── README.md ├── adb-fhs-shell.nix ├── enable-fPIC.patch ├── env-shell.nix ├── force-relocation-equal-pic.patch ├── force_CC_SUPPORTS_TLS_equal_zero.patch ├── ghc-android.nix ├── libiconv.nix ├── ncurses.nix ├── ndk-wrapper.nix ├── nixpkgs ├── development │ ├── compilers │ │ └── ghc │ │ │ ├── 7.10.2.nix │ │ │ ├── 7.4.2-binary.nix │ │ │ ├── 7.8.4.nix │ │ │ ├── fix-7.4.2-clang.patch │ │ │ ├── gcc-clang-wrapper.sh │ │ │ ├── hpc-7.8.4.patch │ │ │ ├── osx-dylib-resolver.patch │ │ │ └── with-packages.nix │ └── haskell-modules │ │ ├── configuration-common.nix │ │ ├── configuration-ghc-7.10.x.nix │ │ ├── configuration-ghc-7.4.x.nix │ │ ├── configuration-ghc-7.8.x.nix │ │ ├── configuration-ghc-android.nix │ │ ├── default.nix │ │ ├── generic-builder.nix │ │ ├── hackage-packages.nix │ │ ├── hoogle-local-wrapper.sh │ │ ├── hoogle.nix │ │ ├── lib.nix │ │ ├── patches │ │ ├── bloomfilter-fix-on-32bit.patch │ │ ├── dyre-nix.patch │ │ ├── ghc-paths-nix-ghcjs.patch │ │ ├── ghc-paths-nix.patch │ │ ├── graphviz-fix-ghc710.patch │ │ ├── hans-disable-webserver.patch │ │ ├── network-android.patch │ │ ├── network-tcp-for-bionic.patch │ │ ├── regex-tdfa-text.patch │ │ └── xmonad-nix.patch │ │ └── with-packages-wrapper.nix └── top-level │ └── haskell-packages.nix ├── no-pthread-android.patch ├── protobuf.nix ├── protobuf_shell.nix ├── release.nix ├── rts_android_log_write.patch ├── shell.nix ├── undefine_MYTASK_USE_TLV_for_CC_SUPPORTS_TLS_zero.patch ├── unix-posix-files-imports.patch └── unix-posix_vdisable.patch /README.md: -------------------------------------------------------------------------------- 1 | nix-build-ghc-android 2 | ===================== 3 | 4 | **FINAL NOTE: The build adjustment done in this repo has been merged into Nixpkgs and GHC. Therefore, this repo is archived.** 5 | 6 | **NOTE: nixpkgs is a moving target. This nix build has been tested against commit: ce2756f701886313180655a069202f3771621404 (2016-01-19)** 7 | 8 | 9 | This repo contains nix expressions to build ghc as a cross compiler for android. 10 | This automatically downloads sources for ghc-7.10.2 and android-ndk r10c. 11 | Right now, ghc compiler is built on x86-64 and will run on x86-64 targetting arm devices. 12 | 13 | You can start nix-shell by 14 | 15 | nix-shell shell.nix -I nixpkgs=(your nixpkgs directory) 16 | 17 | Inside nix-shell, you can run 18 | 19 | arm-unknown-linux-androideabi-ghc test.hs 20 | 21 | For recent android, you should make executable binary as position independent executable. To do that, run 22 | 23 | arm-unknown-linux-androideabi-ghc -fPIC -optl-pie test.hs 24 | 25 | cabal can also be easily used. 26 | 27 | 28 | cabal --with-ghc=arm-unknown-linux-androideabi-ghc --with-ld=arm-linux-androideabi-ld.gold --with-ghc-pkg=arm-unknown-linux-androideabi-ghc-pkg --ghc-options=-fPIC --ghc-options=-optl-pie configure 29 | cabal build 30 | 31 | Then you can push resultant executable by `adb push` and run it in adb shell. 32 | 33 | Enjoy! 34 | 35 | Full Android SDK shell 36 | ---------------------- 37 | 38 | We also have a full android development shell made with `buildFHSUserEnv` to follow conventional filesystem hierarchy. Start the shell by 39 | 40 | nix-shell adb-fhs-shell.nix -I nixpkgs=(your nixpkgs directory) 41 | 42 | 43 | 44 | Example 45 | ------- 46 | 47 | See https://github.com/wavewave/haskell-android-example (this is based on https://github.com/neurocyte/android-haskell-activity but remove foreign-jni dep) 48 | 49 | 50 | Reference 51 | --------- 52 | 53 | This work is based on the following works. 54 | 55 | * [ghc-android](https://github.com/neurocyte/ghc-android) 56 | * [docker-build-ghc-android](https://github.com/sseefried/docker-build-ghc-android) 57 | * [ghc on android in haskell wiki](https://wiki.haskell.org/Android) 58 | 59 | 60 | -------------------------------------------------------------------------------- /adb-fhs-shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? (import {}) }: 2 | 3 | with pkgs; 4 | 5 | let ndkWrapper = import ./ndk-wrapper.nix { inherit stdenv makeWrapper androidndk; }; 6 | hsenv = haskell.packages.ghc7102.ghcWithPackages 7 | (p: with p; 8 | [ cabal-install 9 | hprotoc # host protocol buffer code generator 10 | protocol-buffers # host protocol buffer library 11 | aeson 12 | ]); 13 | haskell-packages = import ./nixpkgs/top-level/haskell-packages.nix { inherit pkgs callPackage stdenv; }; 14 | ghc-android-env = haskell-packages.packages.ghc-android.ghcWithPackages 15 | (p: with p; 16 | [ aeson 17 | free 18 | protocol-buffers # target protocol buffer library 19 | protocol-buffers-descriptor 20 | text-binary 21 | network-simple 22 | monad-loops ]); 23 | 24 | protobuf-android = import ./protobuf.nix {inherit protobuf androidndk ndkWrapper;}; 25 | 26 | fhs = buildFHSUserEnv { 27 | name = "android-env"; 28 | targetPkgs = pkgs: with pkgs; 29 | [ git gitRepo gnupg python2 curl procps openssl gnumake nettools 30 | androidenv.platformTools androidenv.androidsdk_5_1_1_extras 31 | androidenv.androidndk 32 | jdk schedtool utillinux m4 gperf 33 | perl libxml2 zip unzip bison flex lzop gradle 34 | hsenv ghc-android-env ndkWrapper 35 | protobuf 36 | pkgconfig 37 | ]; 38 | multiPkgs = pkgs: with pkgs; [ zlib ]; 39 | runScript = "bash"; 40 | profile = '' 41 | export USE_CCACHE=1 42 | export JAVA_HOME=${jdk.home} 43 | export ANDROID_JAVA_HOME=${jdk.home} 44 | export ANDROID_HOME=${androidenv.androidsdk_5_1_1_extras}/libexec/android-sdk-linux 45 | export ANDROID_NDK_HOME=${androidenv.androidndk}/libexec/${androidenv.androidndk.name} 46 | export ANDROID_NDK_ROOT=${androidenv.androidndk}/libexec/${androidenv.androidndk.name} 47 | export PROTOBUF=${protobuf-android} 48 | export PKG_CONFIG_PATH=$PROTOBUF/lib/pkgconfig:$PKG_CONFIG_PATH 49 | ''; 50 | }; 51 | in stdenv.mkDerivation { 52 | name = "android-env-shell"; 53 | nativeBuildInputs = [ fhs ]; 54 | buildInputs = [ protobuf-android ]; 55 | shellHook = "exec android-env"; 56 | 57 | } 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /enable-fPIC.patch: -------------------------------------------------------------------------------- 1 | diff -rupN a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs 2 | --- a/compiler/main/DynFlags.hs 2015-07-21 13:52:57.000000000 +0000 3 | +++ b/compiler/main/DynFlags.hs 2015-09-19 10:12:13.314277103 +0000 4 | @@ -4138,15 +4138,15 @@ makeDynFlagsConsistent dflags 5 | = let dflags' = dflags { hscTarget = HscLlvm } 6 | warn = "No native code generator, so using LLVM" 7 | in loop dflags' warn 8 | - | hscTarget dflags == HscLlvm && 9 | - not ((arch == ArchX86_64) && (os == OSLinux || os == OSDarwin || os == OSFreeBSD)) && 10 | - not ((isARM arch) && (os == OSLinux)) && 11 | - (not (gopt Opt_Static dflags) || gopt Opt_PIC dflags) 12 | - = if cGhcWithNativeCodeGen == "YES" 13 | - then let dflags' = dflags { hscTarget = HscAsm } 14 | - warn = "Using native code generator rather than LLVM, as LLVM is incompatible with -fPIC and -dynamic on this platform" 15 | - in loop dflags' warn 16 | - else throwGhcException $ CmdLineError "Can't use -fPIC or -dynamic on this platform" 17 | +--- | hscTarget dflags == HscLlvm && 18 | +-- not ((arch == ArchX86_64) && (os == OSLinux || os == OSDarwin || os == OSFreeBSD)) && 19 | +-- not ((isARM arch) && (os == OSLinux)) && 20 | +-- (not (gopt Opt_Static dflags) || gopt Opt_PIC dflags) 21 | +-- = if cGhcWithNativeCodeGen == "YES" 22 | +-- then let dflags' = dflags { hscTarget = HscAsm } 23 | +-- warn = "Using native code generator rather than LLVM, as LLVM is incompatible with -fPIC and -dynamic on this platform" 24 | +-- in loop dflags' warn 25 | +-- else throwGhcException $ CmdLineError "Can't use -fPIC or -dynamic on this platform" 26 | | os == OSDarwin && 27 | arch == ArchX86_64 && 28 | not (gopt Opt_PIC dflags) 29 | -------------------------------------------------------------------------------- /env-shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? (import {}) }: 2 | 3 | with pkgs; 4 | 5 | let hsenv = haskell.packages.ghc7102.ghcWithPackages 6 | (p: with p; [cabal-install network-simple monad-loops text-binary ]); 7 | 8 | haskell-packages = import ./nixpkgs/top-level/haskell-packages.nix { inherit pkgs callPackage stdenv; }; 9 | 10 | ghc-android-env = haskell-packages.packages.ghc-android.ghcWithPackages 11 | (p: with p; [network-simple monad-loops text-binary ] ); 12 | 13 | 14 | ndkWrapper = import ./ndk-wrapper.nix { inherit stdenv makeWrapper androidndk; }; 15 | 16 | in stdenv.mkDerivation { 17 | name = "ghc-android-shell"; 18 | 19 | buildInputs = [ hsenv ghc-android-env ndkWrapper ]; 20 | 21 | } -------------------------------------------------------------------------------- /force-relocation-equal-pic.patch: -------------------------------------------------------------------------------- 1 | diff -rupN a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs 2 | --- a/compiler/main/DriverPipeline.hs 2015-07-21 13:52:50.000000000 +0000 3 | +++ b/compiler/main/DriverPipeline.hs 2015-10-10 22:26:05.106785648 +0000 4 | @@ -1432,7 +1432,7 @@ runPhase (RealPhase LlvmLlc) input_fn df 5 | rmodel | platformOS (targetPlatform dflags) == OSiOS = "dynamic-no-pic" 6 | | gopt Opt_PIC dflags = "pic" 7 | | not (gopt Opt_Static dflags) = "dynamic-no-pic" 8 | - | otherwise = "static" 9 | + | otherwise = "pic" -- "static" 10 | tbaa | ver < 29 = "" -- no tbaa in 2.8 and earlier 11 | | gopt Opt_LlvmTBAA dflags = "--enable-tbaa=true" 12 | | otherwise = "--enable-tbaa=false" 13 | -------------------------------------------------------------------------------- /force_CC_SUPPORTS_TLS_equal_zero.patch: -------------------------------------------------------------------------------- 1 | diff -rupN a/configure.ac b/configure.ac 2 | --- a/configure.ac 2015-07-21 19:50:11.000000000 +0000 3 | +++ b/configure.ac 2015-10-10 07:07:47.667072355 +0000 4 | @@ -973,16 +973,16 @@ AC_CHECK_FUNCS([eventfd]) 5 | 6 | dnl ** Check for __thread support in the compiler 7 | AC_MSG_CHECKING(for __thread support) 8 | -AC_COMPILE_IFELSE( 9 | - [ AC_LANG_SOURCE([[__thread int tester = 0;]]) ], 10 | - [ 11 | - AC_MSG_RESULT(yes) 12 | - AC_DEFINE([CC_SUPPORTS_TLS],[1],[Define to 1 if __thread is supported]) 13 | - ], 14 | - [ 15 | +#AC_COMPILE_IFELSE( 16 | +# [ AC_LANG_SOURCE([[__thread int tester = 0;]]) ], 17 | +# [ 18 | +# AC_MSG_RESULT(yes) 19 | +# AC_DEFINE([CC_SUPPORTS_TLS],[1],[Define to 1 if __thread is supported]) 20 | +# ], 21 | +# [ 22 | AC_MSG_RESULT(no) 23 | AC_DEFINE([CC_SUPPORTS_TLS],[0],[Define to 1 if __thread is supported]) 24 | - ]) 25 | +# ]) 26 | 27 | 28 | dnl ** checking for PAPI 29 | -------------------------------------------------------------------------------- /ghc-android.nix: -------------------------------------------------------------------------------- 1 | { stdenv, fetchurl, makeWrapper, perl, m4, autoconf, automake 2 | , llvm_35, haskell, ncurses 3 | , androidndk 4 | , ghc 5 | }: 6 | 7 | let ndkWrapper = import ./ndk-wrapper.nix { inherit stdenv makeWrapper androidndk; }; 8 | ncurses_ndk = import ./ncurses.nix { inherit stdenv fetchurl ncurses ndkWrapper androidndk; }; 9 | libiconv_ndk = import ./libiconv.nix { inherit stdenv fetchurl ndkWrapper androidndk; }; 10 | in stdenv.mkDerivation { 11 | name = "ghc-android"; 12 | version = "7.10.2"; 13 | 14 | src = fetchurl { 15 | url = "https://downloads.haskell.org/~ghc/7.10.2/ghc-7.10.2-src.tar.xz"; 16 | sha256 = "1x8m4rp2v7ydnrz6z9g8x7z3x3d3pxhv2pixy7i7hkbqbdsp7kal"; 17 | }; 18 | 19 | 20 | buildInputs = [ ghc 21 | perl 22 | llvm_35 23 | ndkWrapper 24 | androidndk 25 | m4 autoconf automake 26 | ncurses_ndk libiconv_ndk 27 | ncurses 28 | ]; 29 | patches = [ ./unix-posix_vdisable.patch 30 | ./unix-posix-files-imports.patch 31 | ./enable-fPIC.patch 32 | ./no-pthread-android.patch 33 | ./force_CC_SUPPORTS_TLS_equal_zero.patch 34 | ./undefine_MYTASK_USE_TLV_for_CC_SUPPORTS_TLS_zero.patch 35 | ./force-relocation-equal-pic.patch 36 | ./rts_android_log_write.patch 37 | ]; 38 | 39 | preConfigure = '' 40 | cat > mk/build.mk <mk/build.mk "${buildMK}" 35 | sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 36 | '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 37 | export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 38 | '' + stdenv.lib.optionalString stdenv.isDarwin '' 39 | export NIX_LDFLAGS+=" -no_dtrace_dof" 40 | ''; 41 | 42 | configureFlags = [ 43 | "--with-gcc=${stdenv.cc}/bin/cc" 44 | "--with-gmp-includes=${gmp}/include" "--with-gmp-libraries=${gmp}/lib" 45 | ]; 46 | 47 | # required, because otherwise all symbols from HSffi.o are stripped, and 48 | # that in turn causes GHCi to abort 49 | stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols"; 50 | 51 | postInstall = '' 52 | # Install the bash completion file. 53 | install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc 54 | 55 | # Patch scripts to include "readelf" and "cat" in $PATH. 56 | for i in "$out/bin/"*; do 57 | test ! -h $i || continue 58 | egrep --quiet '^#!' <(head -n 1 $i) || continue 59 | sed -i -e '2i export PATH="$PATH:${binutils}/bin:${coreutils}/bin"' $i 60 | done 61 | ''; 62 | 63 | meta = { 64 | homepage = "http://haskell.org/ghc"; 65 | description = "The Glasgow Haskell Compiler"; 66 | maintainers = with stdenv.lib.maintainers; [ marcweber andres simons ]; 67 | inherit (ghc.meta) license platforms; 68 | }; 69 | 70 | } 71 | -------------------------------------------------------------------------------- /nixpkgs/development/compilers/ghc/7.4.2-binary.nix: -------------------------------------------------------------------------------- 1 | {stdenv, fetchurl, perl, ncurses, gmp, libiconv, makeWrapper}: 2 | 3 | stdenv.mkDerivation rec { 4 | version = "7.4.2"; 5 | 6 | name = "ghc-${version}-binary"; 7 | 8 | src = 9 | if stdenv.system == "i686-linux" then 10 | fetchurl { 11 | url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2"; 12 | sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi"; 13 | } 14 | else if stdenv.system == "x86_64-linux" then 15 | fetchurl { 16 | url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2"; 17 | sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns"; 18 | } 19 | else if stdenv.system == "i686-darwin" then 20 | fetchurl { 21 | url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2"; 22 | sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0"; 23 | } 24 | else if stdenv.system == "x86_64-darwin" then 25 | fetchurl { 26 | url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2"; 27 | sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf"; 28 | } 29 | else throw "cannot bootstrap GHC on this platform"; 30 | 31 | buildInputs = [perl]; 32 | 33 | postUnpack = 34 | # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib 35 | # during linking 36 | stdenv.lib.optionalString stdenv.isDarwin '' 37 | export NIX_LDFLAGS+=" -no_dtrace_dof" 38 | '' + 39 | 40 | # Strip is harmful, see also below. It's important that this happens 41 | # first. The GHC Cabal build system makes use of strip by default and 42 | # has hardcoded paths to /usr/bin/strip in many places. We replace 43 | # those below, making them point to our dummy script. 44 | '' 45 | mkdir "$TMP/bin" 46 | for i in strip; do 47 | echo '#! ${stdenv.shell}' > "$TMP/bin/$i" 48 | chmod +x "$TMP/bin/$i" 49 | done 50 | PATH="$TMP/bin:$PATH" 51 | '' + 52 | # We have to patch the GMP paths for the integer-gmp package. 53 | '' 54 | find . -name integer-gmp.buildinfo \ 55 | -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp}/lib@" {} \; 56 | '' + stdenv.lib.optionalString stdenv.isDarwin '' 57 | find . -name base.buildinfo \ 58 | -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \; 59 | '' + 60 | # On Linux, use patchelf to modify the executables so that they can 61 | # find editline/gmp. 62 | stdenv.lib.optionalString stdenv.isLinux '' 63 | mkdir -p "$out/lib" 64 | ln -sv "${ncurses}/lib/libncurses.so" "$out/lib/libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.5" 65 | find . -type f -perm +100 \ 66 | -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ 67 | --set-rpath "$out/lib:${gmp}/lib" {} \; 68 | sed -i "s|/usr/bin/perl|perl\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2 69 | sed -i "s|/usr/bin/gcc|gcc\x00 |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2 70 | for prog in ld ar gcc strip ranlib; do 71 | find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \; 72 | done 73 | '' + stdenv.lib.optionalString stdenv.isDarwin '' 74 | # not enough room in the object files for the full path to libiconv :( 75 | fix () { 76 | install_name_tool -change /usr/lib/libiconv.2.dylib @executable_path/libiconv.dylib $1 77 | } 78 | 79 | ln -s ${libiconv}/lib/libiconv.dylib ghc-7.4.2/utils/ghc-pwd/dist-install/build/tmp 80 | ln -s ${libiconv}/lib/libiconv.dylib ghc-7.4.2/utils/hpc/dist-install/build/tmp 81 | ln -s ${libiconv}/lib/libiconv.dylib ghc-7.4.2/ghc/stage2/build/tmp 82 | 83 | for file in ghc-cabal ghc-pwd ghc-stage2 ghc-pkg haddock hsc2hs hpc; do 84 | fix $(find . -type f -name $file) 85 | done 86 | 87 | for file in $(find . -name setup-config); do 88 | substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)" 89 | done 90 | ''; 91 | 92 | configurePhase = '' 93 | ./configure --prefix=$out \ 94 | --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include \ 95 | ${stdenv.lib.optionalString stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"} 96 | ''; 97 | 98 | # Stripping combined with patchelf breaks the executables (they die 99 | # with a segfault or the kernel even refuses the execve). (NIXPKGS-85) 100 | dontStrip = true; 101 | 102 | # No building is necessary, but calling make without flags ironically 103 | # calls install-strip ... 104 | buildPhase = "true"; 105 | 106 | preInstall = stdenv.lib.optionalString stdenv.isDarwin '' 107 | mkdir -p $out/lib/ghc-7.4.2 108 | mkdir -p $out/bin 109 | ln -s ${libiconv}/lib/libiconv.dylib $out/bin 110 | ln -s ${libiconv}/lib/libiconv.dylib $out/lib/ghc-7.4.2/libiconv.dylib 111 | ln -s ${libiconv}/lib/libiconv.dylib utils/ghc-cabal/dist-install/build/tmp 112 | ''; 113 | 114 | postInstall = '' 115 | # Sanity check, can ghc create executables? 116 | cd $TMP 117 | mkdir test-ghc; cd test-ghc 118 | cat > main.hs << EOF 119 | {-# LANGUAGE TemplateHaskell #-} 120 | module Main where 121 | main = putStrLn \$([|"yes"|]) 122 | EOF 123 | $out/bin/ghc --make main.hs || exit 1 124 | echo compilation ok 125 | [ $(./main) == "yes" ] 126 | ''; 127 | 128 | meta.license = stdenv.lib.licenses.bsd3; 129 | meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"]; 130 | } 131 | -------------------------------------------------------------------------------- /nixpkgs/development/compilers/ghc/7.8.4.nix: -------------------------------------------------------------------------------- 1 | { stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }: 2 | 3 | stdenv.mkDerivation (rec { 4 | version = "7.8.4"; 5 | name = "ghc-${version}"; 6 | 7 | src = fetchurl { 8 | url = "http://www.haskell.org/ghc/dist/7.8.4/${name}-src.tar.xz"; 9 | sha256 = "1i4254akbb4ym437rf469gc0m40bxm31blp6s1z1g15jmnacs6f3"; 10 | }; 11 | 12 | buildInputs = [ ghc perl gmp ncurses ]; 13 | 14 | enableParallelBuilding = true; 15 | 16 | buildMK = '' 17 | libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib" 18 | libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include" 19 | libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-includes="${ncurses}/include" 20 | libraries/terminfo_CONFIGURE_OPTS += --configure-option=--with-curses-libraries="${ncurses}/lib" 21 | DYNAMIC_BY_DEFAULT = NO 22 | ${stdenv.lib.optionalString stdenv.isDarwin '' 23 | libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-includes="${libiconv}/include" 24 | libraries/base_CONFIGURE_OPTS += --configure-option=--with-iconv-libraries="${libiconv}/lib" 25 | ''} 26 | ''; 27 | 28 | preConfigure = '' 29 | echo "${buildMK}" > mk/build.mk 30 | sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure 31 | '' + stdenv.lib.optionalString (!stdenv.isDarwin) '' 32 | export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}" 33 | '' + stdenv.lib.optionalString stdenv.isDarwin '' 34 | export NIX_LDFLAGS+=" -no_dtrace_dof" 35 | ''; 36 | 37 | # required, because otherwise all symbols from HSffi.o are stripped, and 38 | # that in turn causes GHCi to abort 39 | stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols"; 40 | 41 | meta = { 42 | homepage = "http://haskell.org/ghc"; 43 | description = "The Glasgow Haskell Compiler"; 44 | maintainers = with stdenv.lib.maintainers; [ marcweber andres simons ]; 45 | inherit (ghc.meta) license platforms; 46 | }; 47 | 48 | } // stdenv.lib.optionalAttrs stdenv.isDarwin { 49 | # https://ghc.haskell.org/trac/ghc/ticket/9762 50 | patches = [ ./hpc-7.8.4.patch ]; 51 | }) 52 | -------------------------------------------------------------------------------- /nixpkgs/development/compilers/ghc/fix-7.4.2-clang.patch: -------------------------------------------------------------------------------- 1 | diff --git a/compiler/codeGen/CgInfoTbls.hs b/compiler/codeGen/CgInfoTbls.hs 2 | index 25ba154..fbb7874 100644 3 | --- a/compiler/codeGen/CgInfoTbls.hs 4 | +++ b/compiler/codeGen/CgInfoTbls.hs 5 | @@ -178,9 +178,7 @@ mkStackLayout = do 6 | [(offset - frame_sp - retAddrSizeW, b) 7 | | (offset, b) <- binds] 8 | 9 | - WARN( not (all (\bind -> fst bind >= 0) rel_binds), 10 | - pprPlatform platform binds $$ pprPlatform platform rel_binds $$ 11 | - ppr frame_size $$ ppr real_sp $$ ppr frame_sp ) 12 | + WARN( not (all (\bind -> fst bind >= 0) rel_binds), pprPlatform platform binds $$ pprPlatform platform rel_binds $$ ppr frame_size $$ ppr real_sp $$ ppr frame_sp ) 13 | return $ stack_layout rel_binds frame_size 14 | 15 | stack_layout :: [(VirtualSpOffset, CgIdInfo)] 16 | diff --git a/compiler/main/GhcMake.hs b/compiler/main/GhcMake.hs 17 | index 091e1be..23447e4 100644 18 | --- a/compiler/main/GhcMake.hs 19 | +++ b/compiler/main/GhcMake.hs 20 | @@ -338,8 +338,7 @@ load2 how_much mod_graph = do 21 | liftIO $ intermediateCleanTempFiles dflags mods_to_keep hsc_env1 22 | 23 | -- there should be no Nothings where linkables should be, now 24 | - ASSERT(all (isJust.hm_linkable) 25 | - (eltsUFM (hsc_HPT hsc_env))) do 26 | + ASSERT(all (isJust.hm_linkable) (eltsUFM (hsc_HPT hsc_env))) do 27 | 28 | -- Link everything together 29 | linkresult <- liftIO $ link (ghcLink dflags) dflags False hpt4 30 | diff --git a/compiler/simplCore/SimplUtils.lhs b/compiler/simplCore/SimplUtils.lhs 31 | index 86dc88d..ecde4fd 100644 32 | --- a/compiler/simplCore/SimplUtils.lhs 33 | +++ b/compiler/simplCore/SimplUtils.lhs 34 | @@ -407,8 +407,7 @@ mkArgInfo fun rules n_val_args call_cont 35 | else 36 | map isStrictDmd demands ++ vanilla_stricts 37 | | otherwise 38 | - -> WARN( True, text "More demands than arity" <+> ppr fun <+> ppr (idArity fun) 39 | - <+> ppr n_val_args <+> ppr demands ) 40 | + -> WARN( True, text "More demands than arity" <+> ppr fun <+> ppr (idArity fun) <+> ppr n_val_args <+> ppr demands ) 41 | vanilla_stricts -- Not enough args, or no strictness 42 | 43 | add_type_str :: Type -> [Bool] -> [Bool] 44 | diff --git a/compiler/simplCore/Simplify.lhs b/compiler/simplCore/Simplify.lhs 45 | index 3bd95a7..4c9ee7c 100644 46 | --- a/compiler/simplCore/Simplify.lhs 47 | +++ b/compiler/simplCore/Simplify.lhs 48 | @@ -2336,8 +2336,7 @@ mkDupableAlt env case_bndr (con, bndrs', rhs') 49 | rhs = mkConApp dc (map Type (tyConAppArgs scrut_ty) 50 | ++ varsToCoreExprs bndrs') 51 | 52 | - LitAlt {} -> WARN( True, ptext (sLit "mkDupableAlt") 53 | - <+> ppr case_bndr <+> ppr con ) 54 | + LitAlt {} -> WARN( True, ptext (sLit "mkDupableAlt") <+> ppr case_bndr <+> ppr con ) 55 | case_bndr 56 | -- The case binder is alive but trivial, so why has 57 | -- it not been substituted away? 58 | -------------------------------------------------------------------------------- /nixpkgs/development/compilers/ghc/gcc-clang-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | inPreprocessorMode () { 4 | hasE=0 5 | hasU=0 6 | hasT=0 7 | for arg in "$@" 8 | do 9 | if [ 'x-E' = "x$arg" ]; then hasE=1; fi 10 | if [ 'x-undef' = "x$arg" ]; then hasU=1; fi 11 | if [ 'x-traditional' = "x$arg" ]; then hasT=1; fi 12 | done 13 | [ "$hasE$hasU$hasT" = '111' ] 14 | } 15 | 16 | extraClangArgs="-Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs" 17 | 18 | adjustPreprocessorLanguage () { 19 | newArgs='' 20 | while [ $# -gt 0 ] 21 | do 22 | newArgs="$newArgs $1" 23 | if [ "$1" = '-x' ] 24 | then 25 | shift 26 | if [ $# -gt 0 ] 27 | then 28 | if [ "$1" = 'c' ] 29 | then 30 | newArgs="$newArgs assembler-with-cpp" 31 | else 32 | newArgs="$newArgs $1" 33 | fi 34 | fi 35 | fi 36 | shift 37 | done 38 | echo $newArgs 39 | } 40 | 41 | if inPreprocessorMode "$@" 42 | then 43 | exec clang $extraClangArgs `adjustPreprocessorLanguage "$@"` 44 | else 45 | exec clang $extraClangArgs "${@/-nodefaultlibs/}" 46 | fi 47 | -------------------------------------------------------------------------------- /nixpkgs/development/compilers/ghc/hpc-7.8.4.patch: -------------------------------------------------------------------------------- 1 | diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs 2 | index 991fc57..0aad221 100644 3 | --- a/compiler/cmm/CLabel.hs 4 | +++ b/compiler/cmm/CLabel.hs 5 | @@ -877,7 +877,7 @@ labelDynamic dflags this_pkg this_mod lbl = 6 | 7 | PlainModuleInitLabel m -> not (gopt Opt_Static dflags) && this_pkg /= (modulePackageId m) 8 | 9 | - HpcTicksLabel m -> not (gopt Opt_Static dflags) && this_pkg /= (modulePackageId m) 10 | + HpcTicksLabel m -> not (gopt Opt_Static dflags) && this_mod /= m 11 | 12 | -- Note that DynamicLinkerLabels do NOT require dynamic linking themselves. 13 | _ -> False 14 | -------------------------------------------------------------------------------- /nixpkgs/development/compilers/ghc/osx-dylib-resolver.patch: -------------------------------------------------------------------------------- 1 | diff --git a/compiler/ghci/Linker.hs b/compiler/ghci/Linker.hs 2 | --- a/compiler/ghci/Linker.hs 3 | +++ b/compiler/ghci/Linker.hs 4 | @@ -119,9 +119,9 @@ 5 | -- that is really important 6 | pkgs_loaded :: ![PackageKey], 7 | 8 | - -- we need to remember the name of the last temporary DLL/.so 9 | - -- so we can link it 10 | - last_temp_so :: !(Maybe (FilePath, String)) } 11 | + -- we need to remember the name of previous temporary DLL/.so 12 | + -- libraries so we can link them (see #10322) 13 | + temp_sos :: ![(FilePath, String)] } 14 | 15 | 16 | emptyPLS :: DynFlags -> PersistentLinkerState 17 | @@ -131,7 +131,7 @@ 18 | pkgs_loaded = init_pkgs, 19 | bcos_loaded = [], 20 | objs_loaded = [], 21 | - last_temp_so = Nothing } 22 | + temp_sos = [] } 23 | 24 | -- Packages that don't need loading, because the compiler 25 | -- shares them with the interpreted program. 26 | @@ -841,19 +841,19 @@ 27 | dflags2 = dflags1 { 28 | -- We don't want the original ldInputs in 29 | -- (they're already linked in), but we do want 30 | - -- to link against the previous dynLoadObjs 31 | - -- library if there was one, so that the linker 32 | + -- to link against previous dynLoadObjs 33 | + -- libraries if there were any, so that the linker 34 | -- can resolve dependencies when it loads this 35 | -- library. 36 | ldInputs = 37 | - case last_temp_so pls of 38 | - Nothing -> [] 39 | - Just (lp, l) -> 40 | + concatMap 41 | + (\(lp, l) -> 42 | [ Option ("-L" ++ lp) 43 | , Option ("-Wl,-rpath") 44 | , Option ("-Wl," ++ lp) 45 | , Option ("-l" ++ l) 46 | - ], 47 | + ]) 48 | + (temp_sos pls), 49 | -- Even if we're e.g. profiling, we still want 50 | -- the vanilla dynamic libraries, so we set the 51 | -- ways / build tag to be just WayDyn. 52 | @@ -868,7 +868,7 @@ 53 | consIORef (filesToNotIntermediateClean dflags) soFile 54 | m <- loadDLL soFile 55 | case m of 56 | - Nothing -> return pls { last_temp_so = Just (libPath, libName) } 57 | + Nothing -> return pls { temp_sos = (libPath, libName) : temp_sos pls } 58 | Just err -> panic ("Loading temp shared object failed: " ++ err) 59 | 60 | rmDupLinkables :: [Linkable] -- Already loaded 61 | -------------------------------------------------------------------------------- /nixpkgs/development/compilers/ghc/with-packages.nix: -------------------------------------------------------------------------------- 1 | { stdenv, ghc, packages, buildEnv, makeWrapper, ignoreCollisions ? false }: 2 | 3 | # This wrapper works only with GHC 6.12 or later. 4 | assert stdenv.lib.versionOlder "6.12" ghc.version; 5 | 6 | # It's probably a good idea to include the library "ghc-paths" in the 7 | # compiler environment, because we have a specially patched version of 8 | # that package in Nix that honors these environment variables 9 | # 10 | # NIX_GHC 11 | # NIX_GHCPKG 12 | # NIX_GHC_DOCDIR 13 | # NIX_GHC_LIBDIR 14 | # 15 | # instead of hard-coding the paths. The wrapper sets these variables 16 | # appropriately to configure ghc-paths to point back to the wrapper 17 | # instead of to the pristine GHC package, which doesn't know any of the 18 | # additional libraries. 19 | # 20 | # A good way to import the environment set by the wrapper below into 21 | # your shell is to add the following snippet to your ~/.bashrc: 22 | # 23 | # if [ -e ~/.nix-profile/bin/ghc ]; then 24 | # eval $(grep export ~/.nix-profile/bin/ghc) 25 | # fi 26 | 27 | let 28 | ghc761OrLater = stdenv.lib.versionOlder "7.6.1" ghc.version; 29 | packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf"; 30 | libDir = "$out/lib/ghc-${ghc.version}"; 31 | docDir = "$out/share/doc/ghc/html"; 32 | packageCfgDir = "${libDir}/package.conf.d"; 33 | isHaskellPkg = x: (x ? pname) && (x ? version); 34 | in 35 | if packages == [] then ghc else 36 | buildEnv { 37 | name = "haskell-env-${ghc.name}"; 38 | paths = stdenv.lib.filter isHaskellPkg (stdenv.lib.closePropagation packages) ++ [ghc]; 39 | inherit ignoreCollisions; 40 | postBuild = '' 41 | . ${makeWrapper}/nix-support/setup-hook 42 | 43 | for prg in ghc ghci ghc-${ghc.version} ghci-${ghc.version}; do 44 | rm -f $out/bin/$prg 45 | makeWrapper ${ghc}/bin/$prg $out/bin/$prg \ 46 | --add-flags '"-B$NIX_GHC_LIBDIR"' \ 47 | --set "NIX_GHC" "$out/bin/ghc" \ 48 | --set "NIX_GHCPKG" "$out/bin/ghc-pkg" \ 49 | --set "NIX_GHC_DOCDIR" "${docDir}" \ 50 | --set "NIX_GHC_LIBDIR" "${libDir}" 51 | done 52 | 53 | for prg in runghc runhaskell; do 54 | rm -f $out/bin/$prg 55 | makeWrapper ${ghc}/bin/$prg $out/bin/$prg \ 56 | --add-flags "-f $out/bin/ghc" \ 57 | --set "NIX_GHC" "$out/bin/ghc" \ 58 | --set "NIX_GHCPKG" "$out/bin/ghc-pkg" \ 59 | --set "NIX_GHC_DOCDIR" "${docDir}" \ 60 | --set "NIX_GHC_LIBDIR" "${libDir}" 61 | done 62 | 63 | for prg in ghc-pkg ghc-pkg-${ghc.version}; do 64 | rm -f $out/bin/$prg 65 | makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}" 66 | done 67 | 68 | $out/bin/ghc-pkg recache 69 | ''; 70 | } 71 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/configuration-common.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | with import ./lib.nix { inherit pkgs; }; 4 | 5 | self: super: { 6 | 7 | # Some packages need a non-core version of Cabal. 8 | Cabal_1_18_1_6 = dontCheck super.Cabal_1_18_1_6; 9 | Cabal_1_20_0_3 = dontCheck super.Cabal_1_20_0_3; 10 | Cabal_1_22_4_0 = dontCheck super.Cabal_1_22_4_0; 11 | cabal-install = (dontCheck super.cabal-install).overrideScope (self: super: { Cabal = self.Cabal_1_22_4_0; zlib = self.zlib_0_5_4_2; }); 12 | cabal-install_1_18_1_0 = (dontCheck super.cabal-install_1_18_1_0).overrideScope (self: super: { Cabal = self.Cabal_1_18_1_6; zlib = self.zlib_0_5_4_2; }); 13 | 14 | # Link statically to avoid runtime dependency on GHC. 15 | jailbreak-cabal = disableSharedExecutables super.jailbreak-cabal; 16 | 17 | # Apply NixOS-specific patches. 18 | ghc-paths = appendPatch super.ghc-paths ./patches/ghc-paths-nix.patch; 19 | 20 | # Break infinite recursions. 21 | Dust-crypto = dontCheck super.Dust-crypto; 22 | hasql-postgres = dontCheck super.hasql-postgres; 23 | hspec = super.hspec.override { stringbuilder = dontCheck super.stringbuilder; }; 24 | HTTP = dontCheck super.HTTP; 25 | mwc-random = dontCheck super.mwc-random; 26 | nanospec = dontCheck super.nanospec; 27 | options = dontCheck super.options; 28 | statistics = dontCheck super.statistics; 29 | text = dontCheck super.text; 30 | 31 | # The package doesn't compile with ruby 1.9, which is our default at the moment. 32 | hruby = super.hruby.override { ruby = pkgs.ruby_2_1; }; 33 | 34 | # Doesn't compile with lua 5.2. 35 | hslua = super.hslua.override { lua = pkgs.lua5_1; }; 36 | 37 | # Use the default version of mysql to build this package (which is actually mariadb). 38 | mysql = super.mysql.override { mysql = pkgs.mysql.lib; }; 39 | 40 | # Link the proper version. 41 | zeromq4-haskell = super.zeromq4-haskell.override { zeromq = pkgs.zeromq4; }; 42 | 43 | # These changes are required to support Darwin. 44 | git-annex = (disableSharedExecutables super.git-annex).override { 45 | dbus = if pkgs.stdenv.isLinux then self.dbus else null; 46 | fdo-notify = if pkgs.stdenv.isLinux then self.fdo-notify else null; 47 | hinotify = if pkgs.stdenv.isLinux then self.hinotify else self.fsnotify; 48 | }; 49 | 50 | # CUDA needs help finding the SDK headers and libraries. 51 | cuda = overrideCabal super.cuda (drv: { 52 | extraLibraries = (drv.extraLibraries or []) ++ [pkgs.linuxPackages.nvidia_x11]; 53 | configureFlags = (drv.configureFlags or []) ++ 54 | pkgs.lib.optional pkgs.stdenv.is64bit "--extra-lib-dirs=${pkgs.cudatoolkit}/lib64" ++ [ 55 | "--extra-lib-dirs=${pkgs.cudatoolkit}/lib" 56 | "--extra-include-dirs=${pkgs.cudatoolkit}/usr_include" 57 | ]; 58 | preConfigure = '' 59 | unset CC # unconfuse the haskell-cuda configure script 60 | sed -i -e 's|/usr/local/cuda|${pkgs.cudatoolkit}|g' configure 61 | ''; 62 | }); 63 | 64 | # The package doesn't know about the AL include hierarchy. 65 | # https://github.com/phaazon/al/issues/1 66 | al = appendConfigureFlag super.al "--extra-include-dirs=${pkgs.openal}/include/AL"; 67 | 68 | # Depends on code distributed under a non-free license. 69 | accelerate-cublas = dontDistribute super.accelerate-cublas; 70 | accelerate-cuda = dontDistribute super.accelerate-cuda; 71 | accelerate-cufft = dontDistribute super.accelerate-cufft; 72 | accelerate-examples = dontDistribute super.accelerate-examples; 73 | accelerate-fft = dontDistribute super.accelerate-fft; 74 | accelerate-fourier-benchmark = dontDistribute super.accelerate-fourier-benchmark; 75 | AttoJson = markBroken super.AttoJson; 76 | bindings-yices = dontDistribute super.bindings-yices; 77 | cublas = dontDistribute super.cublas; 78 | cufft = dontDistribute super.cufft; 79 | gloss-accelerate = dontDistribute super.gloss-accelerate; 80 | gloss-raster-accelerate = dontDistribute super.gloss-raster-accelerate; 81 | GoogleTranslate = dontDistribute super.GoogleTranslate; 82 | GoogleDirections = dontDistribute super.GoogleDirections; 83 | libnvvm = dontDistribute super.libnvvm; 84 | manatee-all = dontDistribute super.manatee-all; 85 | manatee-ircclient = dontDistribute super.manatee-ircclient; 86 | Obsidian = dontDistribute super.Obsidian; 87 | patch-image = dontDistribute super.patch-image; 88 | yices = dontDistribute super.yices; 89 | yices-easy = dontDistribute super.yices-easy; 90 | yices-painless = dontDistribute super.yices-painless; 91 | 92 | # https://github.com/GaloisInc/RSA/issues/9 93 | RSA = dontCheck super.RSA; 94 | 95 | # https://github.com/froozen/kademlia/issues/2 96 | kademlia = dontCheck super.kademlia; 97 | 98 | # Won't find it's header files without help. 99 | sfml-audio = appendConfigureFlag super.sfml-audio "--extra-include-dirs=${pkgs.openal}/include/AL"; 100 | 101 | hzk = overrideCabal super.hzk (drv: { 102 | preConfigure = "sed -i -e /include-dirs/d hzk.cabal"; 103 | configureFlags = "--extra-include-dirs=${pkgs.zookeeper_mt}/include/zookeeper"; 104 | doCheck = false; 105 | }); 106 | 107 | haskakafka = overrideCabal super.haskakafka (drv: { 108 | preConfigure = "sed -i -e /extra-lib-dirs/d -e /include-dirs/d haskakafka.cabal"; 109 | configureFlags = "--extra-include-dirs=${pkgs.rdkafka}/include/librdkafka"; 110 | doCheck = false; 111 | }); 112 | 113 | # Foreign dependency name clashes with another Haskell package. 114 | libarchive-conduit = super.libarchive-conduit.override { archive = pkgs.libarchive; }; 115 | 116 | # https://github.com/haskell/time/issues/23 117 | time_1_5_0_1 = dontCheck super.time_1_5_0_1; 118 | 119 | # Help libconfig find it's C language counterpart. 120 | libconfig = (dontCheck super.libconfig).override { config = pkgs.libconfig; }; 121 | 122 | hmatrix = overrideCabal super.hmatrix (drv: { 123 | configureFlags = (drv.configureFlags or []) ++ [ "-fopenblas" ]; 124 | extraLibraries = [ pkgs.openblasCompat ]; 125 | preConfigure = '' 126 | sed -i hmatrix.cabal -e 's@/usr/lib/openblas/lib@${pkgs.openblasCompat}/lib@' 127 | ''; 128 | }); 129 | 130 | bindings-levmar = overrideCabal super.bindings-levmar (drv: { 131 | preConfigure = '' 132 | sed -i bindings-levmar.cabal \ 133 | -e 's,extra-libraries: lapack blas,extra-libraries: openblas,' 134 | ''; 135 | extraLibraries = [ pkgs.openblasCompat ]; 136 | }); 137 | 138 | # The Haddock phase fails for one reason or another. 139 | acme-one = dontHaddock super.acme-one; 140 | attoparsec-conduit = dontHaddock super.attoparsec-conduit; 141 | base-noprelude = dontHaddock super.base-noprelude; 142 | blaze-builder-conduit = dontHaddock super.blaze-builder-conduit; 143 | BNFC-meta = dontHaddock super.BNFC-meta; 144 | bytestring-progress = dontHaddock super.bytestring-progress; 145 | comonads-fd = dontHaddock super.comonads-fd; 146 | comonad-transformers = dontHaddock super.comonad-transformers; 147 | deepseq-magic = dontHaddock super.deepseq-magic; 148 | diagrams = dontHaddock super.diagrams; 149 | either = dontHaddock super.either; 150 | feldspar-signal = dontHaddock super.feldspar-signal; # https://github.com/markus-git/feldspar-signal/issues/1 151 | gl = dontHaddock super.gl; 152 | groupoids = dontHaddock super.groupoids; 153 | hamlet = dontHaddock super.hamlet; 154 | haste-compiler = dontHaddock super.haste-compiler; 155 | HaXml = dontHaddock super.HaXml; 156 | HDBC-odbc = dontHaddock super.HDBC-odbc; 157 | hoodle-core = dontHaddock super.hoodle-core; 158 | hsc3-db = dontHaddock super.hsc3-db; 159 | hspec-discover = dontHaddock super.hspec-discover; 160 | http-client-conduit = dontHaddock super.http-client-conduit; 161 | http-client-multipart = dontHaddock super.http-client-multipart; 162 | markdown-unlit = dontHaddock super.markdown-unlit; 163 | network-conduit = dontHaddock super.network-conduit; 164 | shakespeare-js = dontHaddock super.shakespeare-js; 165 | shakespeare-text = dontHaddock super.shakespeare-text; 166 | wai-test = dontHaddock super.wai-test; 167 | zlib-conduit = dontHaddock super.zlib-conduit; 168 | 169 | # Jailbreak doesn't get the job done because the Cabal file uses conditionals a lot. 170 | darcs = (overrideCabal super.darcs (drv: { 171 | doCheck = false; # The test suite won't even start. 172 | postPatch = "sed -i -e 's|attoparsec .*,|attoparsec,|' -e 's|vector .*,|vector,|' darcs.cabal"; 173 | })).overrideScope (self: super: { zlib = self.zlib_0_5_4_2; }); 174 | 175 | # https://github.com/massysett/rainbox/issues/1 176 | rainbox = dontCheck super.rainbox; 177 | 178 | # https://github.com/techtangents/ablist/issues/1 179 | ABList = dontCheck super.ABList; 180 | 181 | # These packages have broken dependencies. 182 | ASN1 = dontDistribute super.ASN1; # NewBinary 183 | frame-markdown = dontDistribute super.frame-markdown; # frame 184 | hails-bin = dontDistribute super.hails-bin; # Hails 185 | lss = markBrokenVersion "0.1.0.0" super.lss; # https://github.com/dbp/lss/issues/2 186 | snaplet-lss = markBrokenVersion "0.1.0.0" super.snaplet-lss; # https://github.com/dbp/lss/issues/2 187 | 188 | # https://github.com/haskell/vector/issues/47 189 | vector = if pkgs.stdenv.isi686 then appendConfigureFlag super.vector "--ghc-options=-msse2" else super.vector; 190 | 191 | # cabal2nix likes to generate dependencies on hinotify when hfsevents is really required 192 | # on darwin: https://github.com/NixOS/cabal2nix/issues/146. 193 | hinotify = if pkgs.stdenv.isDarwin then self.hfsevents else super.hinotify; 194 | 195 | # hfsevents needs CoreServices in scope 196 | hfsevents = if pkgs.stdenv.isDarwin 197 | then addBuildTool super.hfsevents pkgs.darwin.apple_sdk.frameworks.CoreServices 198 | else super.hfsevents; 199 | 200 | # FSEvents API is very buggy and tests are unreliable. See 201 | # http://openradar.appspot.com/10207999 and similar issues. 202 | # https://github.com/haskell-fswatch/hfsnotify/issues/62 203 | fsnotify = dontCheck super.fsnotify; # if pkgs.stdenv.isDarwin then dontCheck super.fsnotify else super.fsnotify; 204 | 205 | # the system-fileio tests use canonicalizePath, which fails in the sandbox 206 | system-fileio = if pkgs.stdenv.isDarwin then dontCheck super.system-fileio else super.system-fileio; 207 | 208 | # Prevents needing to add security_tool as a build tool to all of x509-system's 209 | # dependencies. 210 | x509-system = if pkgs.stdenv.isDarwin && !pkgs.stdenv.cc.nativeLibc 211 | then let inherit (pkgs.darwin) security_tool; 212 | in pkgs.lib.overrideDerivation (addBuildDepend super.x509-system security_tool) (drv: { 213 | postPatch = (drv.postPatch or "") + '' 214 | substituteInPlace System/X509/MacOS.hs --replace security ${security_tool}/bin/security 215 | ''; 216 | }) 217 | else super.x509-system; 218 | 219 | double-conversion = if !pkgs.stdenv.isDarwin 220 | then super.double-conversion 221 | else overrideCabal super.double-conversion (drv: 222 | { 223 | postPatch = '' 224 | substituteInPlace double-conversion.cabal --replace stdc++ c++ 225 | ''; 226 | }); 227 | 228 | # Does not compile: "fatal error: ieee-flpt.h: No such file or directory" 229 | base_4_8_1_0 = markBroken super.base_4_8_1_0; 230 | 231 | # Obsolete: https://github.com/massysett/prednote/issues/1. 232 | prednote-test = markBrokenVersion "0.26.0.4" super.prednote-test; 233 | 234 | # Doesn't compile: "Setup: can't find include file ghc-gmp.h" 235 | integer-gmp_1_0_0_0 = markBroken super.integer-gmp_1_0_0_0; 236 | 237 | # Obsolete. 238 | lushtags = markBrokenVersion "0.0.1" super.lushtags; 239 | 240 | # https://github.com/haskell/bytestring/issues/41 241 | bytestring_0_10_6_0 = dontCheck super.bytestring_0_10_6_0; 242 | 243 | # tests don't compile for some odd reason 244 | jwt = dontCheck super.jwt; 245 | 246 | # https://github.com/NixOS/cabal2nix/issues/136 247 | glib = addBuildDepends super.glib [pkgs.pkgconfig pkgs.glib]; 248 | gtk3 = super.gtk3.override { inherit (pkgs) gtk3; }; 249 | gtk = addBuildDepends super.gtk [pkgs.pkgconfig pkgs.gtk]; 250 | gtksourceview3 = super.gtksourceview3.override { inherit (pkgs.gnome3) gtksourceview; }; 251 | 252 | # Need WebkitGTK, not just webkit. 253 | webkit = super.webkit.override { webkit = pkgs.webkitgtk2; }; 254 | webkitgtk3 = super.webkitgtk3.override { webkit = pkgs.webkitgtk24x; }; 255 | webkitgtk3-javascriptcore = super.webkitgtk3-javascriptcore.override { webkit = pkgs.webkitgtk24x; }; 256 | websnap = super.websnap.override { webkit = pkgs.webkitgtk24x; }; 257 | 258 | # While waiting for https://github.com/jwiegley/gitlib/pull/53 to be merged 259 | hlibgit2 = addBuildTool super.hlibgit2 pkgs.git; 260 | 261 | # https://github.com/mvoidex/hsdev/issues/11 262 | hsdev = dontHaddock super.hsdev; 263 | 264 | hs-mesos = overrideCabal super.hs-mesos (drv: { 265 | # Pass _only_ mesos; the correct protobuf is propagated. 266 | extraLibraries = [ pkgs.mesos ]; 267 | preConfigure = "sed -i -e /extra-lib-dirs/d -e 's|, /usr/include, /usr/local/include/mesos||' hs-mesos.cabal"; 268 | }); 269 | 270 | # Upstream notified by e-mail. 271 | permutation = dontCheck super.permutation; 272 | 273 | # https://github.com/vincenthz/hs-tls/issues/102 274 | tls = dontCheck super.tls; 275 | 276 | # https://github.com/jputcu/serialport/issues/25 277 | serialport = dontCheck super.serialport; 278 | 279 | # https://github.com/kazu-yamamoto/simple-sendfile/issues/17 280 | simple-sendfile = dontCheck super.simple-sendfile; 281 | 282 | # Fails no apparent reason. Upstream has been notified by e-mail. 283 | assertions = dontCheck super.assertions; 284 | 285 | # https://github.com/vincenthz/tasty-kat/issues/1 286 | tasty-kat = dontCheck super.tasty-kat; 287 | 288 | # These packages try to execute non-existent external programs. 289 | cmaes = dontCheck super.cmaes; # http://hydra.cryp.to/build/498725/log/raw 290 | dbmigrations = dontCheck super.dbmigrations; 291 | euler = dontCheck super.euler; # https://github.com/decomputed/euler/issues/1 292 | filestore = dontCheck super.filestore; 293 | getopt-generics = dontCheck super.getopt-generics; 294 | graceful = dontCheck super.graceful; 295 | hakyll = dontCheck super.hakyll; 296 | Hclip = dontCheck super.Hclip; 297 | HList = dontCheck super.HList; 298 | ide-backend = dontCheck super.ide-backend; 299 | marquise = dontCheck super.marquise; # https://github.com/anchor/marquise/issues/69 300 | memcached-binary = dontCheck super.memcached-binary; 301 | msgpack-rpc = dontCheck super.msgpack-rpc; 302 | persistent-zookeeper = dontCheck super.persistent-zookeeper; 303 | pocket-dns = dontCheck super.pocket-dns; 304 | postgresql-simple = dontCheck super.postgresql-simple; 305 | postgrest = dontCheck super.postgrest; 306 | snowball = dontCheck super.snowball; 307 | sophia = dontCheck super.sophia; 308 | test-sandbox = dontCheck super.test-sandbox; 309 | users-postgresql-simple = dontCheck super.users-postgresql-simple; 310 | wai-middleware-hmac = dontCheck super.wai-middleware-hmac; 311 | wai-middleware-throttle = dontCheck super.wai-middleware-throttle; # https://github.com/creichert/wai-middleware-throttle/issues/1 312 | xkbcommon = dontCheck super.xkbcommon; 313 | xmlgen = dontCheck super.xmlgen; 314 | 315 | # These packages try to access the network. 316 | amqp = dontCheck super.amqp; 317 | amqp-conduit = dontCheck super.amqp-conduit; 318 | bitcoin-api = dontCheck super.bitcoin-api; 319 | bitcoin-api-extra = dontCheck super.bitcoin-api-extra; 320 | bitx-bitcoin = dontCheck super.bitx-bitcoin; # http://hydra.cryp.to/build/926187/log/raw 321 | concurrent-dns-cache = dontCheck super.concurrent-dns-cache; 322 | dbus = dontCheck super.dbus; # http://hydra.cryp.to/build/498404/log/raw 323 | digitalocean-kzs = dontCheck super.digitalocean-kzs; # https://github.com/KazumaSATO/digitalocean-kzs/issues/1 324 | github-types = dontCheck super.github-types; # http://hydra.cryp.to/build/1114046/nixlog/1/raw 325 | hadoop-rpc = dontCheck super.hadoop-rpc; # http://hydra.cryp.to/build/527461/nixlog/2/raw 326 | hasql = dontCheck super.hasql; # http://hydra.cryp.to/build/502489/nixlog/4/raw 327 | hjsonschema = overrideCabal super.hjsonschema (drv: { testTarget = "local"; }); 328 | holy-project = dontCheck super.holy-project; # http://hydra.cryp.to/build/502002/nixlog/1/raw 329 | hoogle = overrideCabal super.hoogle (drv: { testTarget = "--test-option=--no-net"; }); 330 | http-client = dontCheck super.http-client; # http://hydra.cryp.to/build/501430/nixlog/1/raw 331 | http-conduit = dontCheck super.http-conduit; # http://hydra.cryp.to/build/501966/nixlog/1/raw 332 | js-jquery = dontCheck super.js-jquery; 333 | marmalade-upload = dontCheck super.marmalade-upload; # http://hydra.cryp.to/build/501904/nixlog/1/raw 334 | network-transport-tcp = dontCheck super.network-transport-tcp; 335 | network-transport-zeromq = dontCheck super.network-transport-zeromq; # https://github.com/tweag/network-transport-zeromq/issues/30 336 | pipes-mongodb = dontCheck super.pipes-mongodb; # http://hydra.cryp.to/build/926195/log/raw 337 | raven-haskell = dontCheck super.raven-haskell; # http://hydra.cryp.to/build/502053/log/raw 338 | riak = dontCheck super.riak; # http://hydra.cryp.to/build/498763/log/raw 339 | scotty-binding-play = dontCheck super.scotty-binding-play; 340 | serversession-backend-redis = dontCheck super.serversession-backend-redis; 341 | slack-api = dontCheck super.slack-api; # https://github.com/mpickering/slack-api/issues/5 342 | socket = dontCheck super.socket; 343 | stackage = dontCheck super.stackage; # http://hydra.cryp.to/build/501867/nixlog/1/raw 344 | textocat-api = dontCheck super.textocat-api; # http://hydra.cryp.to/build/887011/log/raw 345 | warp = dontCheck super.warp; # http://hydra.cryp.to/build/501073/nixlog/5/raw 346 | wreq = dontCheck super.wreq; # http://hydra.cryp.to/build/501895/nixlog/1/raw 347 | wreq-sb = dontCheck super.wreq-sb; # http://hydra.cryp.to/build/783948/log/raw 348 | wuss = dontCheck super.wuss; # http://hydra.cryp.to/build/875964/nixlog/2/raw 349 | 350 | # https://github.com/NICTA/digit/issues/3 351 | digit = dontCheck super.digit; 352 | 353 | # Fails for non-obvious reasons while attempting to use doctest. 354 | search = dontCheck super.search; 355 | 356 | # https://github.com/ekmett/structures/issues/3 357 | structures = dontCheck super.structures; 358 | 359 | # Tries to mess with extended POSIX attributes, but can't in our chroot environment. 360 | xattr = dontCheck super.xattr; 361 | 362 | # Disable test suites to fix the build. 363 | acme-year = dontCheck super.acme-year; # http://hydra.cryp.to/build/497858/log/raw 364 | aeson-lens = dontCheck super.aeson-lens; # http://hydra.cryp.to/build/496769/log/raw 365 | aeson-schema = dontCheck super.aeson-schema; # https://github.com/timjb/aeson-schema/issues/9 366 | apache-md5 = dontCheck super.apache-md5; # http://hydra.cryp.to/build/498709/nixlog/1/raw 367 | app-settings = dontCheck super.app-settings; # http://hydra.cryp.to/build/497327/log/raw 368 | aws = dontCheck super.aws; # needs aws credentials 369 | aws-kinesis = dontCheck super.aws-kinesis; # needs aws credentials for testing 370 | binary-protocol = dontCheck super.binary-protocol; # http://hydra.cryp.to/build/499749/log/raw 371 | bindings-GLFW = dontCheck super.bindings-GLFW; # requires an active X11 display 372 | bits = dontCheck super.bits; # http://hydra.cryp.to/build/500239/log/raw 373 | bloodhound = dontCheck super.bloodhound; 374 | buildwrapper = dontCheck super.buildwrapper; 375 | burst-detection = dontCheck super.burst-detection; # http://hydra.cryp.to/build/496948/log/raw 376 | cabal-bounds = dontCheck super.cabal-bounds; # http://hydra.cryp.to/build/496935/nixlog/1/raw 377 | cabal-meta = dontCheck super.cabal-meta; # http://hydra.cryp.to/build/497892/log/raw 378 | cautious-file = dontCheck super.cautious-file; # http://hydra.cryp.to/build/499730/log/raw 379 | CLI = dontCheck super.CLI; # Upstream has no issue tracker. 380 | cjk = dontCheck super.cjk; 381 | command-qq = dontCheck super.command-qq; # http://hydra.cryp.to/build/499042/log/raw 382 | conduit-connection = dontCheck super.conduit-connection; 383 | craftwerk = dontCheck super.craftwerk; 384 | damnpacket = dontCheck super.damnpacket; # http://hydra.cryp.to/build/496923/log 385 | data-hash = dontCheck super.data-hash; 386 | Deadpan-DDP = dontCheck super.Deadpan-DDP; # http://hydra.cryp.to/build/496418/log/raw 387 | DigitalOcean = dontCheck super.DigitalOcean; 388 | directory-layout = dontCheck super.directory-layout; 389 | docopt = dontCheck super.docopt; # http://hydra.cryp.to/build/499172/log/raw 390 | dom-selector = dontCheck super.dom-selector; # http://hydra.cryp.to/build/497670/log/raw 391 | dotfs = dontCheck super.dotfs; # http://hydra.cryp.to/build/498599/log/raw 392 | DRBG = dontCheck super.DRBG; # http://hydra.cryp.to/build/498245/nixlog/1/raw 393 | either-unwrap = dontCheck super.either-unwrap; # http://hydra.cryp.to/build/498782/log/raw 394 | etcd = dontCheck super.etcd; 395 | fb = dontCheck super.fb; # needs credentials for Facebook 396 | fptest = dontCheck super.fptest; # http://hydra.cryp.to/build/499124/log/raw 397 | ghc-events = dontCheck super.ghc-events; # http://hydra.cryp.to/build/498226/log/raw 398 | ghc-events-parallel = dontCheck super.ghc-events-parallel; # http://hydra.cryp.to/build/496828/log/raw 399 | ghcid = dontCheck super.ghcid; 400 | ghc-imported-from = dontCheck super.ghc-imported-from; 401 | ghc-parmake = dontCheck super.ghc-parmake; 402 | gitlib-cmdline = dontCheck super.gitlib-cmdline; 403 | git-vogue = dontCheck super.git-vogue; 404 | GLFW-b = dontCheck super.GLFW-b; # https://github.com/bsl/GLFW-b/issues/50 405 | hackport = dontCheck super.hackport; 406 | hadoop-formats = dontCheck super.hadoop-formats; 407 | haeredes = dontCheck super.haeredes; 408 | hashed-storage = dontCheck super.hashed-storage; 409 | hashring = dontCheck super.hashring; 410 | hath = dontCheck super.hath; 411 | haxl-facebook = dontCheck super.haxl-facebook; # needs facebook credentials for testing 412 | hdbi-postgresql = dontCheck super.hdbi-postgresql; 413 | hedis = dontCheck super.hedis; 414 | hedis-pile = dontCheck super.hedis-pile; 415 | hedis-tags = dontCheck super.hedis-tags; 416 | hedn = dontCheck super.hedn; 417 | hgdbmi = dontCheck super.hgdbmi; 418 | hi = dontCheck super.hi; 419 | hierarchical-clustering = dontCheck super.hierarchical-clustering; 420 | hmatrix-tests = dontCheck super.hmatrix-tests; 421 | hPDB-examples = dontCheck super.hPDB-examples; 422 | hquery = dontCheck super.hquery; 423 | hs2048 = dontCheck super.hs2048; 424 | hsbencher = dontCheck super.hsbencher; 425 | hsexif = dontCheck super.hsexif; 426 | hspec-server = dontCheck super.hspec-server; 427 | HTF = dontCheck super.HTF; 428 | htsn = dontCheck super.htsn; 429 | htsn-import = dontCheck super.htsn-import; 430 | http2 = dontCheck super.http2; 431 | http-client-openssl = dontCheck super.http-client-openssl; 432 | http-client-tls = dontCheck super.http-client-tls; 433 | ihaskell = dontCheck super.ihaskell; 434 | influxdb = dontCheck super.influxdb; 435 | itanium-abi = dontCheck super.itanium-abi; 436 | katt = dontCheck super.katt; 437 | language-slice = dontCheck super.language-slice; 438 | lensref = dontCheck super.lensref; 439 | liquidhaskell = dontCheck super.liquidhaskell; 440 | lucid = dontCheck super.lucid; #https://github.com/chrisdone/lucid/issues/25 441 | lvmrun = dontCheck super.lvmrun; 442 | memcache = dontCheck super.memcache; 443 | milena = dontCheck super.milena; 444 | nats-queue = dontCheck super.nats-queue; 445 | netpbm = dontCheck super.netpbm; 446 | network-dbus = dontCheck super.network-dbus; 447 | notcpp = dontCheck super.notcpp; 448 | ntp-control = dontCheck super.ntp-control; 449 | numerals = dontCheck super.numerals; 450 | opaleye = dontCheck super.opaleye; 451 | openpgp = dontCheck super.openpgp; 452 | optional = dontCheck super.optional; 453 | os-release = dontCheck super.os-release; 454 | pandoc-citeproc = dontCheck super.pandoc-citeproc; 455 | persistent-redis = dontCheck super.persistent-redis; 456 | pipes-extra = dontCheck super.pipes-extra; 457 | pipes-websockets = dontCheck super.pipes-websockets; 458 | postgresql-binary = dontCheck super.postgresql-binary; # needs a running postgresql server 459 | postgresql-simple-migration = dontCheck super.postgresql-simple-migration; 460 | process-streaming = dontCheck super.process-streaming; 461 | punycode = dontCheck super.punycode; 462 | pwstore-cli = dontCheck super.pwstore-cli; 463 | quantities = dontCheck super.quantities; 464 | redis-io = dontCheck super.redis-io; 465 | rethinkdb = dontCheck super.rethinkdb; 466 | Rlang-QQ = dontCheck super.Rlang-QQ; 467 | sai-shape-syb = dontCheck super.sai-shape-syb; 468 | scp-streams = dontCheck super.scp-streams; 469 | sdl2-ttf = dontCheck super.sdl2-ttf; # as of version 0.2.1, the test suite requires user intervention 470 | separated = dontCheck super.separated; 471 | shadowsocks = dontCheck super.shadowsocks; 472 | shake-language-c = dontCheck super.shake-language-c; 473 | static-resources = dontCheck super.static-resources; 474 | strive = dontCheck super.strive; # fails its own hlint test with tons of warnings 475 | svndump = dontCheck super.svndump; 476 | tar = dontCheck super.tar; #http://hydra.nixos.org/build/25088435/nixlog/2 (fails only on 32-bit) 477 | thumbnail-plus = dontCheck super.thumbnail-plus; 478 | tickle = dontCheck super.tickle; 479 | tpdb = dontCheck super.tpdb; 480 | translatable-intset = dontCheck super.translatable-intset; 481 | ua-parser = dontCheck super.ua-parser; 482 | unagi-chan = dontCheck super.unagi-chan; 483 | wai-app-file-cgi = dontCheck super.wai-app-file-cgi; 484 | wai-logger = dontCheck super.wai-logger; 485 | WebBits = dontCheck super.WebBits; # http://hydra.cryp.to/build/499604/log/raw 486 | webdriver-angular = dontCheck super.webdriver-angular; 487 | webdriver = dontCheck super.webdriver; 488 | xsd = dontCheck super.xsd; 489 | 490 | # https://bitbucket.org/wuzzeb/webdriver-utils/issue/1/hspec-webdriver-101-cant-compile-its-test 491 | hspec-webdriver = markBroken super.hspec-webdriver; 492 | 493 | # Needs access to locale data, but looks for it in the wrong place. 494 | scholdoc-citeproc = dontCheck super.scholdoc-citeproc; 495 | 496 | # These test suites run for ages, even on a fast machine. This is nuts. 497 | Random123 = dontCheck super.Random123; 498 | systemd = dontCheck super.systemd; 499 | 500 | # https://github.com/eli-frey/cmdtheline/issues/28 501 | cmdtheline = dontCheck super.cmdtheline; 502 | 503 | # https://github.com/bos/snappy/issues/1 504 | snappy = dontCheck super.snappy; 505 | 506 | # Expect to find sendmail(1) in $PATH. 507 | mime-mail = appendConfigureFlag super.mime-mail "--ghc-option=-DMIME_MAIL_SENDMAIL_PATH=\"sendmail\""; 508 | 509 | # Help the test suite find system timezone data. 510 | tz = overrideCabal super.tz (drv: { preConfigure = "export TZDIR=${pkgs.tzdata}/share/zoneinfo"; }); 511 | 512 | # Deprecated upstream and doesn't compile. 513 | BASIC = dontDistribute super.BASIC; 514 | bytestring-arbitrary = dontDistribute (addBuildTool super.bytestring-arbitrary self.llvm); 515 | llvm = dontDistribute super.llvm; 516 | llvm-base = markBroken super.llvm-base; 517 | llvm-base-util = dontDistribute super.llvm-base-util; 518 | llvm-extra = dontDistribute super.llvm-extra; 519 | llvm-tf = dontDistribute super.llvm-tf; 520 | objectid = dontDistribute super.objectid; 521 | saltine-quickcheck = dontDistribute super.saltine-quickcheck; 522 | stable-tree = dontDistribute super.stable-tree; 523 | synthesizer-llvm = dontDistribute super.synthesizer-llvm; 524 | optimal-blocks = dontDistribute super.optimal-blocks; 525 | hs-blake2 = dontDistribute super.hs-blake2; 526 | 527 | # https://ghc.haskell.org/trac/ghc/ticket/9625 528 | vty = dontCheck super.vty; 529 | 530 | # https://github.com/vincenthz/hs-crypto-pubkey/issues/20 531 | crypto-pubkey = dontCheck super.crypto-pubkey; 532 | 533 | # https://github.com/zouppen/stratum-tool/issues/14 534 | stratum-tool = markBrokenVersion "0.0.4" super.stratum-tool; 535 | 536 | # https://github.com/Gabriel439/Haskell-Turtle-Library/issues/1 537 | turtle = dontCheck super.turtle; 538 | 539 | # https://github.com/Philonous/xml-picklers/issues/5 540 | xml-picklers = dontCheck super.xml-picklers; 541 | 542 | # https://github.com/joeyadams/haskell-stm-delay/issues/3 543 | stm-delay = dontCheck super.stm-delay; 544 | 545 | # https://github.com/cgaebel/stm-conduit/issues/33 546 | stm-conduit = dontCheck super.stm-conduit; 547 | 548 | # The install target tries to run lots of commands as "root". WTF??? 549 | hannahci = markBroken super.hannahci; 550 | 551 | # https://github.com/jkarni/th-alpha/issues/1 552 | th-alpha = markBrokenVersion "0.2.0.0" super.th-alpha; 553 | 554 | # https://github.com/haskell-hub/hub-src/issues/24 555 | hub = markBrokenVersion "1.4.0" super.hub; 556 | 557 | # https://github.com/pixbi/duplo/issues/25 558 | duplo = dontCheck super.duplo; 559 | 560 | # Nix-specific workaround 561 | xmonad = appendPatch super.xmonad ./patches/xmonad-nix.patch; 562 | 563 | # https://github.com/evanrinehart/mikmod/issues/1 564 | mikmod = addExtraLibrary super.mikmod pkgs.libmikmod; 565 | 566 | # https://github.com/basvandijk/threads/issues/10 567 | threads = dontCheck super.threads; 568 | 569 | # https://github.com/ucsd-progsys/liquid-fixpoint/issues/44 570 | liquid-fixpoint = overrideCabal super.liquid-fixpoint (drv: { preConfigure = "patchShebangs ."; }); 571 | 572 | # Missing module. 573 | rematch = dontCheck super.rematch; # https://github.com/tcrayford/rematch/issues/5 574 | rematch-text = dontCheck super.rematch-text; # https://github.com/tcrayford/rematch/issues/6 575 | 576 | # Upstream notified by e-mail. 577 | MonadCompose = markBrokenVersion "0.2.0.0" super.MonadCompose; 578 | 579 | # no haddock since this is an umbrella package. 580 | cloud-haskell = dontHaddock super.cloud-haskell; 581 | 582 | # This packages compiles 4+ hours on a fast machine. That's just unreasonable. 583 | CHXHtml = dontDistribute super.CHXHtml; 584 | 585 | # https://github.com/NixOS/nixpkgs/issues/6350 586 | paypal-adaptive-hoops = overrideCabal super.paypal-adaptive-hoops (drv: { testTarget = "local"; }); 587 | 588 | # https://github.com/jwiegley/simple-conduit/issues/2 589 | simple-conduit = markBroken super.simple-conduit; 590 | 591 | # https://code.google.com/p/linux-music-player/issues/detail?id=1 592 | mp = markBroken super.mp; 593 | 594 | # https://github.com/afcowie/http-streams/issues/80 595 | http-streams = dontCheck super.http-streams; 596 | 597 | # https://github.com/vincenthz/hs-asn1/issues/12 598 | asn1-encoding = dontCheck super.asn1-encoding; 599 | 600 | # wxc supports wxGTX >= 3.0, but our current default version points to 2.8. 601 | wxc = super.wxc.override { wxGTK = pkgs.wxGTK30; }; 602 | wxcore = super.wxcore.override { wxGTK = pkgs.wxGTK30; }; 603 | 604 | # Depends on QuickCheck 1.x. 605 | HaVSA = super.HaVSA.override { QuickCheck = self.QuickCheck_1_2_0_1; }; 606 | test-framework-quickcheck = super.test-framework-quickcheck.override { QuickCheck = self.QuickCheck_1_2_0_1; }; 607 | 608 | # Doesn't support "this system". Linux? Needs investigation. 609 | lhc = markBroken (super.lhc.override { QuickCheck = self.QuickCheck_1_2_0_1; }); 610 | 611 | # Depends on broken test-framework-quickcheck. 612 | apiary = dontCheck super.apiary; 613 | apiary-authenticate = dontCheck super.apiary-authenticate; 614 | apiary-clientsession = dontCheck super.apiary-clientsession; 615 | apiary-cookie = dontCheck super.apiary-cookie; 616 | apiary-eventsource = dontCheck super.apiary-eventsource; 617 | apiary-logger = dontCheck super.apiary-logger; 618 | apiary-memcached = dontCheck super.apiary-memcached; 619 | apiary-mongoDB = dontCheck super.apiary-mongoDB; 620 | apiary-persistent = dontCheck super.apiary-persistent; 621 | apiary-purescript = dontCheck super.apiary-purescript; 622 | apiary-session = dontCheck super.apiary-session; 623 | apiary-websockets = dontCheck super.apiary-websockets; 624 | 625 | # https://github.com/mikeizbicki/hmm/issues/12 626 | hmm = markBroken super.hmm; 627 | 628 | # https://github.com/alephcloud/hs-configuration-tools/issues/40 629 | configuration-tools = dontCheck super.configuration-tools; 630 | 631 | # https://github.com/fumieval/karakuri/issues/1 632 | karakuri = markBroken super.karakuri; 633 | 634 | # Upstream notified by e-mail. 635 | gearbox = markBroken super.gearbox; 636 | 637 | # https://github.com/deech/fltkhs/issues/7 638 | fltkhs = markBroken super.fltkhs; 639 | 640 | # Build fails, but there seems to be no issue tracker available. :-( 641 | hmidi = markBrokenVersion "0.2.1.0" super.hmidi; 642 | padKONTROL = markBroken super.padKONTROL; 643 | Bang = dontDistribute super.Bang; 644 | launchpad-control = dontDistribute super.launchpad-control; 645 | 646 | # Upstream provides no issue tracker and no contact details. 647 | vivid = markBroken super.vivid; 648 | 649 | # Test suite wants to connect to $DISPLAY. 650 | hsqml = dontCheck (super.hsqml.override { qt5 = pkgs.qt53; }); 651 | 652 | # https://github.com/lookunder/RedmineHs/issues/4 653 | Redmine = markBroken super.Redmine; 654 | 655 | # HsColour: Language/Unlambda.hs: hGetContents: invalid argument (invalid byte sequence) 656 | unlambda = dontHyperlinkSource super.unlambda; 657 | 658 | # https://github.com/megantti/rtorrent-rpc/issues/2 659 | rtorrent-rpc = markBroken super.rtorrent-rpc; 660 | 661 | # https://github.com/PaulJohnson/geodetics/issues/1 662 | geodetics = dontCheck super.geodetics; 663 | 664 | # https://github.com/AndrewRademacher/aeson-casing/issues/1 665 | aeson-casing = dontCheck super.aeson-casing; 666 | 667 | # https://github.com/junjihashimoto/test-sandbox-compose/issues/2 668 | test-sandbox-compose = dontCheck super.test-sandbox-compose; 669 | 670 | # https://github.com/jgm/pandoc/issues/2190 671 | pandoc = overrideCabal super.pandoc (drv: { 672 | enableSharedExecutables = false; 673 | postInstall = '' # install man pages 674 | mv man $out/ 675 | find $out/man -type f ! -name "*.[0-9]" -exec rm {} + 676 | ''; 677 | }); 678 | 679 | # Tests attempt to use NPM to install from the network into 680 | # /homeless-shelter. Disabled. 681 | purescript = dontCheck super.purescript; 682 | 683 | # Broken by GLUT update. 684 | Monadius = markBroken super.Monadius; 685 | 686 | # We don't have the groonga package these libraries bind to. 687 | haroonga = markBroken super.haroonga; 688 | haroonga-httpd = markBroken super.haroonga-httpd; 689 | 690 | # Build is broken and no contact info available. 691 | hopenpgp-tools = markBroken super.hopenpgp-tools; 692 | 693 | # https://github.com/hunt-framework/hunt/issues/99 694 | hunt-server = markBrokenVersion "0.3.0.2" super.hunt-server; 695 | 696 | # https://github.com/bjpop/blip/issues/16 697 | blip = markBroken super.blip; 698 | 699 | # https://github.com/tych0/xcffib/issues/37 700 | xcffib = dontCheck super.xcffib; 701 | 702 | # https://github.com/afcowie/locators/issues/1 703 | locators = dontCheck super.locators; 704 | 705 | # https://github.com/scravy/hydrogen-syntax/issues/1 706 | hydrogen-syntax = markBroken super.hydrogen-syntax; 707 | hydrogen-cli = dontDistribute super.hydrogen-cli; 708 | 709 | # https://github.com/meteficha/Hipmunk/issues/8 710 | Hipmunk = markBroken super.Hipmunk; 711 | HipmunkPlayground = dontDistribute super.HipmunkPlayground; 712 | click-clack = dontDistribute super.click-clack; 713 | 714 | # https://github.com/fumieval/audiovisual/issues/1 715 | audiovisual = markBroken super.audiovisual; 716 | call = dontDistribute super.call; 717 | rhythm-game-tutorial = dontDistribute super.rhythm-game-tutorial; 718 | 719 | # https://github.com/haskell/haddock/issues/378 720 | haddock-library = dontCheck super.haddock-library; 721 | 722 | # Already fixed in upstream darcs repo. 723 | xmonad-contrib = overrideCabal super.xmonad-contrib (drv: { 724 | postPatch = '' 725 | sed -i -e '24iimport Control.Applicative' XMonad/Util/Invisible.hs 726 | sed -i -e '22iimport Control.Applicative' XMonad/Hooks/DebugEvents.hs 727 | ''; 728 | }); 729 | 730 | # https://github.com/anton-k/csound-expression-dynamic/issues/1 731 | csound-expression-dynamic = dontHaddock super.csound-expression-dynamic; 732 | 733 | # Hardcoded include path 734 | poppler = overrideCabal super.poppler (drv: { 735 | postPatch = '' 736 | sed -i -e 's,glib/poppler.h,poppler.h,' poppler.cabal 737 | sed -i -e 's,glib/poppler.h,poppler.h,' Graphics/UI/Gtk/Poppler/Structs.hsc 738 | ''; 739 | }); 740 | 741 | # Uses OpenGL in testing 742 | caramia = dontCheck super.caramia; 743 | 744 | # Needs help finding LLVM. 745 | llvm-general = super.llvm-general.override { llvm-config = self.llvmPackages.llvm; }; 746 | spaceprobe = addBuildTool super.spaceprobe self.llvmPackages.llvm; 747 | 748 | # Tries to run GUI in tests 749 | leksah = dontCheck super.leksah; 750 | 751 | # Patch to consider NIX_GHC just like xmonad does 752 | dyre = appendPatch super.dyre ./patches/dyre-nix.patch; 753 | 754 | # Test suite won't compile against tasty-hunit 0.9.x. 755 | zlib = dontCheck super.zlib; 756 | 757 | # Override the obsolete version from Hackage with our more up-to-date copy. 758 | cabal2nix = self.callPackage ../tools/haskell/cabal2nix/cabal2nix.nix {}; 759 | hackage2nix = self.callPackage ../tools/haskell/cabal2nix/hackage2nix.nix {}; 760 | language-nix = self.callPackage ../tools/haskell/cabal2nix/language-nix.nix {}; 761 | distribution-nixpkgs = self.callPackage ../tools/haskell/cabal2nix/distribution-nixpkgs.nix {}; 762 | 763 | # https://github.com/urs-of-the-backwoods/HGamer3D/issues/7 764 | HGamer3D-Bullet-Binding = dontDistribute super.HGamer3D-Bullet-Binding; 765 | HGamer3D-Common = dontDistribute super.HGamer3D-Common; 766 | HGamer3D-Data = markBroken super.HGamer3D-Data; 767 | 768 | # https://github.com/ndmitchell/shake/issues/206 769 | # https://github.com/ndmitchell/shake/issues/267 770 | shake = overrideCabal super.shake (drv: { doCheck = !pkgs.stdenv.isDarwin && false; }); 771 | 772 | # https://github.com/nushio3/doctest-prop/issues/1 773 | doctest-prop = dontCheck super.doctest-prop; 774 | 775 | # https://github.com/goldfirere/singletons/issues/117 776 | clash-lib = dontDistribute super.clash-lib; 777 | clash-verilog = dontDistribute super.clash-verilog; 778 | Frames = dontDistribute super.Frames; 779 | hgeometry = dontDistribute super.hgeometry; 780 | hipe = dontDistribute super.hipe; 781 | hsqml-datamodel-vinyl = dontDistribute super.hsqml-datamodel-vinyl; 782 | singleton-nats = dontDistribute super.singleton-nats; 783 | singletons = markBroken super.singletons; 784 | units-attoparsec = dontDistribute super.units-attoparsec; 785 | ihaskell-widgets = dontDistribute super.ihaskell-widgets; 786 | exinst-bytes = dontDistribute super.exinst-bytes; 787 | exinst-deepseq = dontDistribute super.exinst-deepseq; 788 | exinst-aeson = dontDistribute super.exinst-aeson; 789 | exinst = dontDistribute super.exinst; 790 | exinst-hashable = dontDistribute super.exinst-hashable; 791 | 792 | # https://github.com/anton-k/temporal-music-notation/issues/1 793 | temporal-music-notation = markBroken super.temporal-music-notation; 794 | temporal-music-notation-demo = dontDistribute super.temporal-music-notation-demo; 795 | temporal-music-notation-western = dontDistribute super.temporal-music-notation-western; 796 | 797 | # https://github.com/adamwalker/sdr/issues/1 798 | sdr = dontCheck super.sdr; 799 | 800 | # https://github.com/bos/aeson/issues/253 801 | aeson = dontCheck super.aeson; 802 | 803 | # Won't compile with recent versions of QuickCheck. 804 | testpack = markBroken super.testpack; 805 | inilist = dontCheck super.inilist; 806 | MissingH = dontCheck super.MissingH; 807 | 808 | # Obsolete for GHC versions after GHC 6.10.x. 809 | utf8-prelude = markBroken super.utf8-prelude; 810 | 811 | # https://github.com/yaccz/saturnin/issues/3 812 | Saturnin = dontCheck super.Saturnin; 813 | 814 | # https://github.com/kkardzis/curlhs/issues/6 815 | curlhs = dontCheck super.curlhs; 816 | 817 | # https://github.com/hvr/token-bucket/issues/3 818 | token-bucket = dontCheck super.token-bucket; 819 | 820 | # https://github.com/alphaHeavy/lzma-enumerator/issues/3 821 | lzma-enumerator = dontCheck super.lzma-enumerator; 822 | 823 | # https://github.com/BNFC/bnfc/issues/140 824 | BNFC = dontCheck super.BNFC; 825 | 826 | # FPCO's fork of Cabal won't succeed its test suite. 827 | Cabal-ide-backend = dontCheck super.Cabal-ide-backend; 828 | 829 | # https://github.com/jaspervdj/websockets/issues/104 830 | websockets = dontCheck super.websockets; 831 | 832 | # Avoid spurious test suite failures. 833 | fft = dontCheck super.fft; 834 | 835 | # This package can't be built on non-Windows systems. 836 | Win32 = overrideCabal super.Win32 (drv: { broken = !pkgs.stdenv.isCygwin; }); 837 | inline-c-win32 = dontDistribute super.inline-c-win32; 838 | Southpaw = dontDistribute super.Southpaw; 839 | 840 | # Doesn't work with recent versions of mtl. 841 | cron-compat = markBroken super.cron-compat; 842 | 843 | # https://github.com/yesodweb/serversession/issues/1 844 | serversession = dontCheck super.serversession; 845 | 846 | yesod-bin = if pkgs.stdenv.isDarwin 847 | then addBuildDepend super.yesod-bin pkgs.darwin.apple_sdk.frameworks.Cocoa 848 | else super.yesod-bin; 849 | 850 | # https://github.com/commercialhaskell/stack/issues/408 851 | # https://github.com/commercialhaskell/stack/issues/409 852 | stack = overrideCabal super.stack (drv: { preCheck = "export HOME=$TMPDIR"; doCheck = false; }); 853 | 854 | # Missing dependency on some hid-usb library. 855 | hid = markBroken super.hid; 856 | msi-kb-backlit = dontDistribute super.msi-kb-backlit; 857 | 858 | # Hydra no longer allows building texlive packages. 859 | lhs2tex = dontDistribute super.lhs2tex; 860 | 861 | # https://ghc.haskell.org/trac/ghc/ticket/9825 862 | vimus = overrideCabal super.vimus (drv: { broken = pkgs.stdenv.isLinux && pkgs.stdenv.isi686; }); 863 | 864 | # https://github.com/hspec/mockery/issues/6 865 | mockery = overrideCabal super.mockery (drv: { preCheck = "export TRAVIS=true"; }); 866 | 867 | # https://github.com/alphaHeavy/lzma-conduit/issues/5 868 | lzma-conduit = dontCheck super.lzma-conduit; 869 | 870 | # https://github.com/kazu-yamamoto/logger/issues/42 871 | logger = dontCheck super.logger; 872 | 873 | # https://github.com/edwinb/EpiVM/issues/13 874 | # https://github.com/edwinb/EpiVM/issues/14 875 | epic = addExtraLibraries (addBuildTool super.epic self.happy) [pkgs.boehmgc pkgs.gmp]; 876 | 877 | # Upstream has no issue tracker. 878 | dpkg = markBroken super.dpkg; 879 | 880 | # https://github.com/ekmett/wl-pprint-terminfo/issues/7 881 | wl-pprint-terminfo = addExtraLibrary super.wl-pprint-terminfo pkgs.ncurses; 882 | 883 | # https://github.com/bos/pcap/issues/5 884 | pcap = addExtraLibrary super.pcap pkgs.libpcap; 885 | 886 | # https://github.com/skogsbaer/hscurses/issues/24 887 | hscurses = markBroken super.hscurses; 888 | 889 | # https://github.com/qnikst/imagemagick/issues/34 890 | imagemagick = dontCheck super.imagemagick; 891 | 892 | # https://github.com/liyang/thyme/issues/36 893 | thyme = dontCheck super.thyme; 894 | 895 | # https://github.com/k0ral/hbro-contrib/issues/1 896 | hbro-contrib = dontDistribute super.hbro-contrib; 897 | 898 | # https://github.com/aka-bash0r/multi-cabal/issues/4 899 | multi-cabal = markBroken super.multi-cabal; 900 | 901 | # Elm is no longer actively maintained on Hackage: https://github.com/NixOS/nixpkgs/pull/9233. 902 | Elm = markBroken super.Elm; 903 | elm-build-lib = markBroken super.elm-build-lib; 904 | elm-compiler = markBroken super.elm-compiler; 905 | elm-get = markBroken super.elm-get; 906 | elm-make = markBroken super.elm-make; 907 | elm-package = markBroken super.elm-package; 908 | elm-reactor = markBroken super.elm-reactor; 909 | elm-repl = markBroken super.elm-repl; 910 | elm-server = markBroken super.elm-server; 911 | elm-yesod = markBroken super.elm-yesod; 912 | 913 | # https://github.com/GaloisInc/HaNS/pull/8 914 | hans = appendPatch super.hans ./patches/hans-disable-webserver.patch; 915 | 916 | # https://github.com/athanclark/sets/issues/2 917 | sets = dontCheck super.sets; 918 | 919 | # https://github.com/lens/lens-aeson/issues/18 920 | lens-aeson = dontCheck super.lens-aeson; 921 | 922 | # Byte-compile elisp code for Emacs. 923 | ghc-mod = overrideCabal super.ghc-mod (drv: { 924 | preCheck = "export HOME=$TMPDIR"; 925 | testToolDepends = drv.testToolDepends or [] ++ [self.cabal-install]; 926 | doCheck = false; # https://github.com/kazu-yamamoto/ghc-mod/issues/335 927 | executableToolDepends = drv.executableToolDepends or [] ++ [pkgs.emacs]; 928 | postInstall = '' 929 | local lispdir=( "$out/share/"*"-${self.ghc.name}/${drv.pname}-${drv.version}/elisp" ) 930 | make -C $lispdir 931 | mkdir -p $out/share/emacs/site-lisp 932 | ln -s "$lispdir/"*.el{,c} $out/share/emacs/site-lisp/ 933 | ''; 934 | }); 935 | 936 | # Byte-compile elisp code for Emacs. 937 | structured-haskell-mode = overrideCabal super.structured-haskell-mode (drv: { 938 | executableToolDepends = drv.executableToolDepends or [] ++ [pkgs.emacs]; 939 | postInstall = '' 940 | local lispdir=( "$out/share/"*"-${self.ghc.name}/${drv.pname}-${drv.version}/elisp" ) 941 | pushd >/dev/null $lispdir 942 | for i in *.el; do 943 | emacs -Q -L . -L ${pkgs.emacs24Packages.haskellMode}/share/emacs/site-lisp \ 944 | --batch --eval "(byte-compile-disable-warning 'cl-functions)" \ 945 | -f batch-byte-compile $i 946 | done 947 | popd >/dev/null 948 | mkdir -p $out/share/emacs 949 | ln -s $lispdir $out/share/emacs/site-lisp 950 | ''; 951 | }); 952 | 953 | # Byte-compile elisp code for Emacs. 954 | hindent = overrideCabal super.hindent (drv: { 955 | executableToolDepends = drv.executableToolDepends or [] ++ [pkgs.emacs]; 956 | postInstall = '' 957 | local lispdir=( "$out/share/"*"-${self.ghc.name}/${drv.pname}-${drv.version}/elisp" ) 958 | pushd >/dev/null $lispdir 959 | for i in *.el; do 960 | emacs -Q -L . -L ${pkgs.emacs24Packages.haskellMode}/share/emacs/site-lisp \ 961 | --batch --eval "(byte-compile-disable-warning 'cl-functions)" \ 962 | -f batch-byte-compile $i 963 | done 964 | popd >/dev/null 965 | mkdir -p $out/share/emacs 966 | ln -s $lispdir $out/share/emacs/site-lisp 967 | ''; 968 | }); 969 | 970 | # https://github.com/yesodweb/Shelly.hs/issues/106 971 | # https://github.com/yesodweb/Shelly.hs/issues/108 972 | shelly = dontCheck super.shelly; 973 | 974 | # https://github.com/bos/configurator/issues/22 975 | configurator = dontCheck super.configurator; 976 | 977 | # https://github.com/thoughtpolice/hs-ed25519/issues/9 978 | ed25519 = markBroken super.ed25519; 979 | hackage-repo-tool = dontDistribute super.hackage-repo-tool; 980 | hackage-security = dontDistribute super.hackage-security; 981 | hackage-security-HTTP = dontDistribute super.hackage-security-HTTP; 982 | 983 | # The cabal files for these libraries do not list the required system dependencies. 984 | SDL-image = overrideCabal super.SDL-image (drv: { 985 | librarySystemDepends = [ pkgs.SDL pkgs.SDL_image ] ++ drv.librarySystemDepends or []; 986 | }); 987 | SDL-ttf = overrideCabal super.SDL-ttf (drv: { 988 | librarySystemDepends = [ pkgs.SDL pkgs.SDL_ttf ]; 989 | }); 990 | SDL-mixer = overrideCabal super.SDL-mixer (drv: { 991 | librarySystemDepends = [ pkgs.SDL pkgs.SDL_mixer ]; 992 | }); 993 | SDL-gfx = overrideCabal super.SDL-gfx (drv: { 994 | librarySystemDepends = [ pkgs.SDL pkgs.SDL_gfx ]; 995 | }); 996 | SDL-mpeg = overrideCabal super.SDL-mpeg (drv: { 997 | configureFlags = (drv.configureFlags or []) ++ [ 998 | "--extra-lib-dirs=${pkgs.smpeg}/lib" 999 | "--extra-include-dirs=${pkgs.smpeg}/include/smpeg" 1000 | ]; 1001 | }); 1002 | 1003 | # https://github.com/chrisdone/freenect/pull/11 1004 | freenect = overrideCabal super.freenect (drv: { 1005 | libraryPkgconfigDepends = [ pkgs.freenect ]; 1006 | prePatch = '' echo " Pkgconfig-Depends: libfreenect" >> freenect.cabal ''; 1007 | }); 1008 | 1009 | # https://github.com/ivanperez-keera/hcwiid/pull/4 1010 | hcwiid = overrideCabal super.hcwiid (drv: { 1011 | configureFlags = (drv.configureFlags or []) ++ [ 1012 | "--extra-lib-dirs=${pkgs.bluez}/lib" 1013 | "--extra-lib-dirs=${pkgs.cwiid}/lib" 1014 | "--extra-include-dirs=${pkgs.cwiid}/include" 1015 | "--extra-include-dirs=${pkgs.bluez}/include" 1016 | ]; 1017 | prePatch = '' sed -i -e "/Extra-Lib-Dirs/d" -e "/Include-Dirs/d" "hcwiid.cabal" ''; 1018 | }); 1019 | 1020 | # https://github.com/basvandijk/concurrent-extra/issues/12 1021 | concurrent-extra = dontCheck super.concurrent-extra; 1022 | 1023 | # https://github.com/bos/bloomfilter/issues/7 1024 | bloomfilter = appendPatch super.bloomfilter ./patches/bloomfilter-fix-on-32bit.patch; 1025 | 1026 | # https://github.com/pxqr/base32-bytestring/issues/4 1027 | base32-bytestring = dontCheck super.base32-bytestring; 1028 | 1029 | } 1030 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/configuration-ghc-7.10.x.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | with import ./lib.nix { inherit pkgs; }; 4 | 5 | self: super: { 6 | 7 | # Suitable LLVM version. 8 | llvmPackages = pkgs.llvmPackages_35; 9 | 10 | # Disable GHC 7.10.x core libraries. 11 | array = null; 12 | base = null; 13 | binary = null; 14 | bin-package-db = null; 15 | bytestring = null; 16 | Cabal = null; 17 | containers = null; 18 | deepseq = null; 19 | directory = null; 20 | filepath = null; 21 | ghc-prim = null; 22 | haskeline = null; 23 | hoopl = null; 24 | hpc = null; 25 | integer-gmp = null; 26 | pretty = null; 27 | process = null; 28 | rts = null; 29 | template-haskell = null; 30 | terminfo = null; 31 | time = null; 32 | transformers = null; 33 | unix = null; 34 | xhtml = null; 35 | 36 | # ekmett/linear#74 37 | linear = overrideCabal super.linear (drv: { 38 | prePatch = "sed -i 's/-Werror//g' linear.cabal"; 39 | }); 40 | 41 | # Cabal_1_22_1_1 requires filepath >=1 && <1.4 42 | cabal-install = dontCheck (super.cabal-install.override { Cabal = null; }); 43 | 44 | # Don't use jailbreak built with Cabal 1.22.x because of https://github.com/peti/jailbreak-cabal/issues/9. 45 | Cabal_1_23_0_0 = overrideCabal super.Cabal_1_22_4_0 (drv: { 46 | version = "1.23.0.0"; 47 | src = pkgs.fetchFromGitHub { 48 | owner = "haskell"; 49 | repo = "cabal"; 50 | rev = "fe7b8784ac0a5848974066bdab76ce376ba67277"; 51 | sha256 = "1d70ryz1l49pkr70g8r9ysqyg1rnx84wwzx8hsg6vwnmg0l5am7s"; 52 | }; 53 | jailbreak = false; 54 | doHaddock = false; 55 | postUnpack = "sourceRoot+=/Cabal"; 56 | }); 57 | jailbreak-cabal = overrideCabal super.jailbreak-cabal (drv: { 58 | executableHaskellDepends = [ self.Cabal_1_23_0_0 ]; 59 | preConfigure = "sed -i -e 's/Cabal == 1.20\\.\\*/Cabal >= 1.23/' jailbreak-cabal.cabal"; 60 | }); 61 | 62 | idris = 63 | let idris' = overrideCabal super.idris (drv: { 64 | # "idris" binary cannot find Idris library otherwise while building. 65 | # After installing it's completely fine though. Seems like Nix-specific 66 | # issue so not reported. 67 | preBuild = "export LD_LIBRARY_PATH=$PWD/dist/build:$LD_LIBRARY_PATH"; 68 | # https://github.com/idris-lang/Idris-dev/issues/2499 69 | librarySystemDepends = (drv.librarySystemDepends or []) ++ [pkgs.gmp]; 70 | }); 71 | in idris'.overrideScope (self: super: { 72 | # https://github.com/idris-lang/Idris-dev/issues/2500 73 | zlib = self.zlib_0_5_4_2; 74 | }); 75 | 76 | Extra = appendPatch super.Extra (pkgs.fetchpatch { 77 | url = "https://github.com/seereason/sr-extra/commit/29787ad4c20c962924b823d02a7335da98143603.patch"; 78 | sha256 = "193i1xmq6z0jalwmq0mhqk1khz6zz0i1hs6lgfd7ybd6qyaqnf5f"; 79 | }); 80 | 81 | # haddock: No input file(s). 82 | nats = dontHaddock super.nats; 83 | bytestring-builder = dontHaddock super.bytestring-builder; 84 | 85 | # We have time 1.5 86 | aeson = disableCabalFlag super.aeson "old-locale"; 87 | 88 | # requires filepath >=1.1 && <1.4 89 | Glob = doJailbreak super.Glob; 90 | 91 | # Setup: At least the following dependencies are missing: base <4.8 92 | hspec-expectations = overrideCabal super.hspec-expectations (drv: { 93 | postPatch = "sed -i -e 's|base < 4.8|base|' hspec-expectations.cabal"; 94 | }); 95 | utf8-string = overrideCabal super.utf8-string (drv: { 96 | postPatch = "sed -i -e 's|base >= 3 && < 4.8|base|' utf8-string.cabal"; 97 | }); 98 | pointfree = doJailbreak super.pointfree; 99 | 100 | # acid-state/safecopy#25 acid-state/safecopy#26 101 | safecopy = dontCheck (super.safecopy); 102 | 103 | # test suite broken, some instance is declared twice. 104 | # https://bitbucket.org/FlorianHartwig/attobencode/issue/1 105 | AttoBencode = dontCheck super.AttoBencode; 106 | 107 | # Test suite fails with some (seemingly harmless) error. 108 | # https://code.google.com/p/scrapyourboilerplate/issues/detail?id=24 109 | syb = dontCheck super.syb; 110 | 111 | # Test suite has stricter version bounds 112 | retry = dontCheck super.retry; 113 | 114 | # test/System/Posix/Types/OrphansSpec.hs:19:13: 115 | # Not in scope: type constructor or class ‘Int32’ 116 | base-orphans = dontCheck super.base-orphans; 117 | 118 | # Test suite fails with time >= 1.5 119 | http-date = dontCheck super.http-date; 120 | 121 | # Version 1.19.5 fails its test suite. 122 | happy = dontCheck super.happy; 123 | 124 | # Test suite fails in "/tokens_bytestring_unicode.g.bin". 125 | alex = dontCheck super.alex; 126 | 127 | # Upstream was notified about the over-specified constraint on 'base' 128 | # but refused to do anything about it because he "doesn't want to 129 | # support a moving target". Go figure. 130 | barecheck = doJailbreak super.barecheck; 131 | 132 | # https://github.com/kazu-yamamoto/unix-time/issues/30 133 | unix-time = dontCheck super.unix-time; 134 | 135 | present = appendPatch super.present (pkgs.fetchpatch { 136 | url = "https://github.com/chrisdone/present/commit/6a61f099bf01e2127d0c68f1abe438cd3eaa15f7.patch"; 137 | sha256 = "1vn3xm38v2f4lzyzkadvq322f3s2yf8c88v56wpdpzfxmvlzaqr8"; 138 | }); 139 | 140 | ghcjs-prim = self.callPackage ({ mkDerivation, fetchgit, primitive }: mkDerivation { 141 | pname = "ghcjs-prim"; 142 | version = "0.1.0.0"; 143 | src = fetchgit { 144 | url = git://github.com/ghcjs/ghcjs-prim.git; 145 | rev = "dfeaab2aafdfefe46bf12960d069f28d2e5f1454"; # ghc-7.10 branch 146 | sha256 = "19kyb26nv1hdpp0kc2gaxkq5drw5ib4za0641py5i4bbf1g58yvy"; 147 | }; 148 | buildDepends = [ primitive ]; 149 | license = pkgs.stdenv.lib.licenses.bsd3; 150 | }) {}; 151 | 152 | # diagrams/monoid-extras#19 153 | monoid-extras = overrideCabal super.monoid-extras (drv: { 154 | prePatch = "sed -i 's|4\.8|4.9|' monoid-extras.cabal"; 155 | }); 156 | 157 | # diagrams/statestack#5 158 | statestack = overrideCabal super.statestack (drv: { 159 | prePatch = "sed -i 's|4\.8|4.9|' statestack.cabal"; 160 | }); 161 | 162 | # diagrams/diagrams-core#83 163 | diagrams-core = overrideCabal super.diagrams-core (drv: { 164 | prePatch = "sed -i 's|4\.8|4.9|' diagrams-core.cabal"; 165 | }); 166 | 167 | timezone-series = doJailbreak super.timezone-series; 168 | timezone-olson = doJailbreak super.timezone-olson; 169 | libmpd = dontCheck super.libmpd; 170 | xmonad-extras = overrideCabal super.xmonad-extras (drv: { 171 | postPatch = '' 172 | sed -i -e "s,<\*,<¤,g" XMonad/Actions/Volume.hs 173 | ''; 174 | }); 175 | 176 | # Workaround for a workaround, see comment for "ghcjs" flag. 177 | jsaddle = let jsaddle' = disableCabalFlag super.jsaddle "ghcjs"; 178 | in addBuildDepends jsaddle' [ self.glib self.gtk3 self.webkitgtk3 179 | self.webkitgtk3-javascriptcore ]; 180 | 181 | # https://github.com/cartazio/arithmoi/issues/1 182 | arithmoi = markBroken super.arithmoi; 183 | NTRU = dontDistribute super.NTRU; 184 | arith-encode = dontDistribute super.arith-encode; 185 | barchart = dontDistribute super.barchart; 186 | constructible = dontDistribute super.constructible; 187 | cyclotomic = dontDistribute super.cyclotomic; 188 | diagrams = dontDistribute super.diagrams; 189 | diagrams-contrib = dontDistribute super.diagrams-contrib; 190 | enumeration = dontDistribute super.enumeration; 191 | ghci-diagrams = dontDistribute super.ghci-diagrams; 192 | ihaskell-diagrams = dontDistribute super.ihaskell-diagrams; 193 | nimber = dontDistribute super.nimber; 194 | pell = dontDistribute super.pell; 195 | quadratic-irrational = dontDistribute super.quadratic-irrational; 196 | 197 | # https://github.com/lymar/hastache/issues/47 198 | hastache = dontCheck super.hastache; 199 | 200 | # The compat library is empty in the presence of mtl 2.2.x. 201 | mtl-compat = dontHaddock super.mtl-compat; 202 | 203 | # https://github.com/bos/bloomfilter/issues/11 204 | bloomfilter = dontHaddock (appendConfigureFlag super.bloomfilter "--ghc-option=-XFlexibleContexts"); 205 | 206 | # https://github.com/ocharles/tasty-rerun/issues/5 207 | tasty-rerun = dontHaddock (appendConfigureFlag super.tasty-rerun "--ghc-option=-XFlexibleContexts"); 208 | 209 | # http://hub.darcs.net/ivanm/graphviz/issue/5 210 | graphviz = dontCheck (dontJailbreak (appendPatch super.graphviz ./patches/graphviz-fix-ghc710.patch)); 211 | 212 | # Broken with GHC 7.10.x. 213 | aeson_0_7_0_6 = markBroken super.aeson_0_7_0_6; 214 | Cabal_1_20_0_3 = markBroken super.Cabal_1_20_0_3; 215 | cabal-install_1_18_1_0 = markBroken super.cabal-install_1_18_1_0; 216 | containers_0_4_2_1 = markBroken super.containers_0_4_2_1; 217 | control-monad-free_0_5_3 = markBroken super.control-monad-free_0_5_3; 218 | haddock-api_2_15_0_2 = markBroken super.haddock-api_2_15_0_2; 219 | QuickCheck_1_2_0_1 = markBroken super.QuickCheck_1_2_0_1; 220 | seqid-streams_0_1_0 = markBroken super.seqid-streams_0_1_0; 221 | vector_0_10_9_2 = markBroken super.vector_0_10_9_2; 222 | hoopl_3_10_2_0 = markBroken super.hoopl_3_10_2_0; 223 | 224 | # https://github.com/HugoDaniel/RFC3339/issues/14 225 | timerep = dontCheck super.timerep; 226 | 227 | # Upstream has no issue tracker. 228 | llvm-base-types = markBroken super.llvm-base-types; 229 | llvm-analysis = dontDistribute super.llvm-analysis; 230 | llvm-data-interop = dontDistribute super.llvm-data-interop; 231 | llvm-tools = dontDistribute super.llvm-tools; 232 | 233 | # Upstream has no issue tracker. 234 | MaybeT = markBroken super.MaybeT; 235 | grammar-combinators = dontDistribute super.grammar-combinators; 236 | 237 | # Required to fix version 0.91.0.0. 238 | wx = dontHaddock (appendConfigureFlag super.wx "--ghc-option=-XFlexibleContexts"); 239 | 240 | # Upstream has no issue tracker. 241 | Graphalyze = markBroken super.Graphalyze; 242 | gbu = dontDistribute super.gbu; 243 | SourceGraph = dontDistribute super.SourceGraph; 244 | 245 | # Upstream has no issue tracker. 246 | markBroken = super.protocol-buffers; 247 | caffegraph = dontDistribute super.caffegraph; 248 | 249 | # Deprecated: https://github.com/mikeizbicki/ConstraintKinds/issues/8 250 | ConstraintKinds = markBroken super.ConstraintKinds; 251 | HLearn-approximation = dontDistribute super.HLearn-approximation; 252 | HLearn-distributions = dontDistribute super.HLearn-distributions; 253 | HLearn-classification = dontDistribute super.HLearn-classification; 254 | 255 | # Doesn't work with LLVM 3.5. 256 | llvm-general = markBroken super.llvm-general; 257 | 258 | # Inexplicable haddock failure 259 | # https://github.com/gregwebs/aeson-applicative/issues/2 260 | aeson-applicative = dontHaddock super.aeson-applicative; 261 | 262 | # GHC 7.10.1 is affected by https://github.com/srijs/hwsl2/issues/1. 263 | hwsl2 = dontCheck super.hwsl2; 264 | 265 | # https://github.com/haskell/haddock/issues/427 266 | haddock = dontCheck super.haddock; 267 | 268 | # The tests in vty-ui do not build, but vty-ui itself builds. 269 | vty-ui = enableCabalFlag super.vty-ui "no-tests"; 270 | 271 | # https://github.com/DanielG/cabal-helper/issues/10 272 | cabal-helper = dontCheck super.cabal-helper; 273 | 274 | } 275 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/configuration-ghc-7.4.x.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | with import ./lib.nix { inherit pkgs; }; 4 | 5 | self: super: { 6 | 7 | # Suitable LLVM version. 8 | llvmPackages = pkgs.llvmPackages_34; 9 | 10 | # Disable GHC 7.4.x core libraries. 11 | array = null; 12 | base = null; 13 | binary = null; 14 | bin-package-db = null; 15 | bytestring = null; 16 | Cabal = null; 17 | containers = null; 18 | deepseq = null; 19 | directory = null; 20 | extensible-exceptions = null; 21 | filepath = null; 22 | ghc-prim = null; 23 | haskell2010 = null; 24 | haskell98 = null; 25 | hoopl = null; 26 | hpc = null; 27 | integer-gmp = null; 28 | old-locale = null; 29 | old-time = null; 30 | pretty = null; 31 | process = null; 32 | rts = null; 33 | template-haskell = null; 34 | time = null; 35 | unix = null; 36 | 37 | # transformers is not a core library for this compiler. 38 | transformers = self.transformers_0_4_3_0; 39 | 40 | # https://github.com/haskell/cabal/issues/2322 41 | Cabal_1_22_4_0 = super.Cabal_1_22_4_0.override { binary = dontCheck self.binary_0_7_6_1; }; 42 | 43 | # Avoid inconsistent 'binary' versions from 'text' and 'Cabal'. 44 | cabal-install = super.cabal-install.overrideScope (self: super: { binary = dontCheck self.binary_0_7_6_1; }); 45 | 46 | # https://github.com/tibbe/hashable/issues/85 47 | hashable = dontCheck super.hashable; 48 | 49 | # https://github.com/peti/jailbreak-cabal/issues/9 50 | jailbreak-cabal = super.jailbreak-cabal.override { Cabal = dontJailbreak self.Cabal_1_20_0_3; }; 51 | 52 | # Haddock chokes on the prologue from the cabal file. 53 | ChasingBottoms = dontHaddock super.ChasingBottoms; 54 | 55 | # https://github.com/haskell/primitive/issues/16 56 | primitive = dontCheck super.primitive; 57 | 58 | # https://github.com/tibbe/unordered-containers/issues/96 59 | unordered-containers = dontCheck super.unordered-containers; 60 | 61 | # The test suite depends on time >=1.4.0.2. 62 | cookie = dontCheck super.cookie ; 63 | 64 | # Work around bytestring >=0.10.2.0 requirement. 65 | streaming-commons = addBuildDepend super.streaming-commons self.bytestring-builder; 66 | 67 | # Choose appropriate flags for our version of 'bytestring'. 68 | bytestring-builder = disableCabalFlag super.bytestring-builder "bytestring_has_builder"; 69 | 70 | # Newer versions require a more recent compiler. 71 | control-monad-free = super.control-monad-free_0_5_3; 72 | 73 | # Needs hashable on pre 7.10.x compilers. 74 | nats = addBuildDepend super.nats self.hashable; 75 | 76 | # Test suite won't compile. 77 | unix-time = dontCheck super.unix-time; 78 | 79 | # Avoid depending on tasty-golden. 80 | monad-par = dontCheck super.monad-par; 81 | 82 | # Newer versions require bytestring >=0.10. 83 | tar = super.tar_0_4_1_0; 84 | 85 | } 86 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/configuration-ghc-7.8.x.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | with import ./lib.nix { inherit pkgs; }; 4 | 5 | self: super: { 6 | 7 | # Suitable LLVM version. 8 | llvmPackages = pkgs.llvmPackages_34; 9 | 10 | # Disable GHC 7.8.x core libraries. 11 | array = null; 12 | base = null; 13 | binary = null; 14 | bin-package-db = null; 15 | bytestring = null; 16 | Cabal = null; 17 | containers = null; 18 | deepseq = null; 19 | directory = null; 20 | filepath = null; 21 | ghc-prim = null; 22 | haskeline = null; 23 | haskell2010 = null; 24 | haskell98 = null; 25 | hoopl = null; 26 | hpc = null; 27 | integer-gmp = null; 28 | old-locale = null; 29 | old-time = null; 30 | pretty = null; 31 | process = null; 32 | rts = null; 33 | template-haskell = null; 34 | terminfo = null; 35 | time = null; 36 | transformers = null; 37 | unix = null; 38 | xhtml = null; 39 | 40 | # https://github.com/peti/jailbreak-cabal/issues/9 41 | jailbreak-cabal = super.jailbreak-cabal.override { Cabal = dontJailbreak self.Cabal_1_20_0_3; }; 42 | 43 | # mtl 2.2.x needs the latest transformers. 44 | mtl_2_2_1 = super.mtl.override { transformers = self.transformers_0_4_3_0; }; 45 | 46 | # Configure mtl 2.1.x. 47 | mtl = self.mtl_2_1_3_1; 48 | transformers-compat = addBuildDepend (enableCabalFlag super.transformers-compat "three") self.mtl; 49 | mtl-compat = addBuildDepend (enableCabalFlag super.mtl-compat "two-point-one") self.transformers-compat; 50 | 51 | # haddock-api 2.16 requires ghc>=7.10 52 | haddock-api = super.haddock-api_2_15_0_2; 53 | 54 | # This is part of bytestring in our compiler. 55 | bytestring-builder = triggerRebuild (dontHaddock super.bytestring-builder) 1; 56 | 57 | # Won't compile against mtl 2.1.x. 58 | imports = super.imports.override { mtl = self.mtl_2_2_1; }; 59 | 60 | # Newer versions require mtl 2.2.x. 61 | mtl-prelude = self.mtl-prelude_1_0_3; 62 | 63 | # purescript requires mtl 2.2.x. 64 | purescript = overrideCabal (super.purescript.overrideScope (self: super: { 65 | mkDerivation = drv: super.mkDerivation (drv // { doCheck = false; }); 66 | mtl = super.mtl_2_2_1; 67 | transformers = super.transformers_0_4_3_0; 68 | haskeline = self.haskeline_0_7_2_1; 69 | transformers-compat = disableCabalFlag super.transformers-compat "three"; 70 | })) (drv: {}); 71 | 72 | # The test suite pulls in mtl 2.2.x 73 | command-qq = dontCheck super.command-qq; 74 | 75 | # Doesn't support GHC < 7.10.x. 76 | bound-gen = dontDistribute super.bound-gen; 77 | ghc-exactprint = dontDistribute super.ghc-exactprint; 78 | ghc-typelits-natnormalise = dontDistribute super.ghc-typelits-natnormalise; 79 | 80 | # Needs directory >= 1.2.2.0. 81 | idris = markBroken super.idris; 82 | 83 | # Newer versions require transformers 0.4.x. 84 | seqid = super.seqid_0_1_0; 85 | seqid-streams = super.seqid-streams_0_1_0; 86 | 87 | # Need binary >= 0.7.2, but our compiler has only 0.7.1.0. 88 | hosc = super.hosc.overrideScope (self: super: { binary = self.binary_0_7_6_1; }); 89 | tidal-midi = super.tidal-midi.overrideScope (self: super: { binary = self.binary_0_7_6_1; }); 90 | 91 | # These packages need mtl 2.2.x directly or indirectly via dependencies. 92 | amazonka = markBroken super.amazonka; 93 | apiary-purescript = markBroken super.apiary-purescript; 94 | clac = dontDistribute super.clac; 95 | highlighter2 = markBroken super.highlighter2; 96 | hypher = markBroken super.hypher; 97 | miniforth = markBroken super.miniforth; 98 | xhb-atom-cache = markBroken super.xhb-atom-cache; 99 | xhb-ewmh = markBroken super.xhb-ewmh; 100 | yesod-purescript = markBroken super.yesod-purescript; 101 | yet-another-logger = markBroken super.yet-another-logger; 102 | 103 | # https://github.com/frosch03/arrowVHDL/issues/2 104 | ArrowVHDL = markBroken super.ArrowVHDL; 105 | 106 | # https://ghc.haskell.org/trac/ghc/ticket/9625 107 | wai-middleware-preprocessor = dontCheck super.wai-middleware-preprocessor; 108 | incremental-computing = dontCheck super.incremental-computing; 109 | 110 | # Newer versions require base > 4.7 111 | gloss = super.gloss_1_9_2_1; 112 | 113 | # Workaround for a workaround, see comment for "ghcjs" flag. 114 | jsaddle = let jsaddle' = disableCabalFlag super.jsaddle "ghcjs"; 115 | in addBuildDepends jsaddle' [ self.glib self.gtk3 self.webkitgtk3 116 | self.webkitgtk3-javascriptcore ]; 117 | 118 | # Needs hashable on pre 7.10.x compilers. 119 | nats = addBuildDepend super.nats self.hashable; 120 | 121 | # needs mtl-compat to build with mtl 2.1.x 122 | cgi = addBuildDepend super.cgi self.mtl-compat; 123 | 124 | # Newer versions always trigger the non-deterministic library ID bug 125 | # and are virtually impossible to compile on Hydra. 126 | conduit = super.conduit_1_2_4_1; 127 | 128 | # https://github.com/magthe/sandi/issues/7 129 | sandi = overrideCabal super.sandi (drv: { 130 | postPatch = "sed -i -e 's|base ==4.8.*,|base,|' sandi.cabal"; 131 | }); 132 | 133 | # Overriding mtl 2.2.x is fine here because ghc-events is an stand-alone executable. 134 | ghc-events = super.ghc-events.override { mtl = self.mtl_2_2_1; }; 135 | 136 | } 137 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/configuration-ghc-android.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | with import ./lib.nix { inherit pkgs; }; 4 | 5 | self: super: { 6 | 7 | mkDerivation = drv: super.mkDerivation (drv // { doHaddock = false; }); 8 | 9 | # Suitable LLVM version. 10 | llvmPackages = pkgs.llvmPackages_35; 11 | 12 | inherit (pkgs.haskell.packages.ghc7102) jailbreak-cabal alex happy; 13 | 14 | 15 | # Disable GHC 7.10.x core libraries. 16 | array = null; 17 | base = null; 18 | binary = null; 19 | bin-package-db = null; 20 | bytestring = null; 21 | Cabal = null; 22 | containers = null; 23 | deepseq = null; 24 | directory = null; 25 | filepath = null; 26 | ghc-prim = null; 27 | haskeline = null; 28 | hoopl = null; 29 | hpc = null; 30 | integer-gmp = null; 31 | pretty = null; 32 | process = null; 33 | rts = null; 34 | template-haskell = null; 35 | terminfo = null; 36 | time = null; 37 | transformers = null; 38 | unix = null; 39 | xhtml = null; 40 | 41 | cmdargs = disableCabalFlag super.cmdargs "quotation"; 42 | 43 | # ekmett/linear#74 44 | linear = overrideCabal super.linear (drv: { 45 | prePatch = "sed -i 's/-Werror//g' linear.cabal"; 46 | }); 47 | 48 | # Cabal_1_22_1_1 requires filepath >=1 && <1.4 49 | cabal-install = dontCheck (super.cabal-install.override { Cabal = null; }); 50 | 51 | # Don't use jailbreak built with Cabal 1.22.x because of https://github.com/peti/jailbreak-cabal/issues/9. 52 | Cabal_1_23_0_0 = overrideCabal super.Cabal_1_22_4_0 (drv: { 53 | version = "1.23.0.0"; 54 | src = pkgs.fetchFromGitHub { 55 | owner = "haskell"; 56 | repo = "cabal"; 57 | rev = "fe7b8784ac0a5848974066bdab76ce376ba67277"; 58 | sha256 = "1d70ryz1l49pkr70g8r9ysqyg1rnx84wwzx8hsg6vwnmg0l5am7s"; 59 | }; 60 | jailbreak = false; 61 | doHaddock = false; 62 | postUnpack = "sourceRoot+=/Cabal"; 63 | }); 64 | 65 | idris = 66 | let idris' = overrideCabal super.idris (drv: { 67 | # "idris" binary cannot find Idris library otherwise while building. 68 | # After installing it's completely fine though. Seems like Nix-specific 69 | # issue so not reported. 70 | preBuild = "export LD_LIBRARY_PATH=$PWD/dist/build:$LD_LIBRARY_PATH"; 71 | # https://github.com/idris-lang/Idris-dev/issues/2499 72 | librarySystemDepends = (drv.librarySystemDepends or []) ++ [pkgs.gmp]; 73 | }); 74 | in idris'.overrideScope (self: super: { 75 | # https://github.com/idris-lang/Idris-dev/issues/2500 76 | zlib = self.zlib_0_5_4_2; 77 | }); 78 | 79 | Extra = appendPatch super.Extra (pkgs.fetchpatch { 80 | url = "https://github.com/seereason/sr-extra/commit/29787ad4c20c962924b823d02a7335da98143603.patch"; 81 | sha256 = "193i1xmq6z0jalwmq0mhqk1khz6zz0i1hs6lgfd7ybd6qyaqnf5f"; 82 | }); 83 | 84 | # haddock: No input file(s). 85 | nats = dontHaddock super.nats; 86 | bytestring-builder = dontHaddock super.bytestring-builder; 87 | 88 | # We have time 1.5 89 | aeson = let aeson' = overrideCabal super.aeson (drv: { postPatch = "sed -i -e 's|Data.Aeson.TH|--Data.Aeson.TH|' aeson.cabal"; }); 90 | in disableCabalFlag aeson' "old-locale"; 91 | 92 | # requires filepath >=1.1 && <1.4 93 | Glob = doJailbreak super.Glob; 94 | 95 | # Setup: At least the following dependencies are missing: base <4.8 96 | hspec-expectations = overrideCabal super.hspec-expectations (drv: { 97 | postPatch = "sed -i -e 's|base < 4.8|base|' hspec-expectations.cabal"; 98 | }); 99 | utf8-string = overrideCabal super.utf8-string (drv: { 100 | postPatch = "sed -i -e 's|base >= 3 && < 4.8|base|' utf8-string.cabal"; 101 | }); 102 | pointfree = doJailbreak super.pointfree; 103 | 104 | # acid-state/safecopy#25 acid-state/safecopy#26 105 | safecopy = dontCheck (super.safecopy); 106 | 107 | # test suite broken, some instance is declared twice. 108 | # https://bitbucket.org/FlorianHartwig/attobencode/issue/1 109 | AttoBencode = dontCheck super.AttoBencode; 110 | 111 | # Test suite fails with some (seemingly harmless) error. 112 | # https://code.google.com/p/scrapyourboilerplate/issues/detail?id=24 113 | syb = dontCheck super.syb; 114 | 115 | # Test suite has stricter version bounds 116 | retry = dontCheck super.retry; 117 | 118 | # test/System/Posix/Types/OrphansSpec.hs:19:13: 119 | # Not in scope: type constructor or class ‘Int32’ 120 | base-orphans = dontCheck super.base-orphans; 121 | 122 | # Test suite fails with time >= 1.5 123 | http-date = dontCheck super.http-date; 124 | 125 | 126 | # Upstream was notified about the over-specified constraint on 'base' 127 | # but refused to do anything about it because he "doesn't want to 128 | # support a moving target". Go figure. 129 | barecheck = doJailbreak super.barecheck; 130 | 131 | # https://github.com/kazu-yamamoto/unix-time/issues/30 132 | unix-time = dontCheck super.unix-time; 133 | 134 | present = appendPatch super.present (pkgs.fetchpatch { 135 | url = "https://github.com/chrisdone/present/commit/6a61f099bf01e2127d0c68f1abe438cd3eaa15f7.patch"; 136 | sha256 = "1vn3xm38v2f4lzyzkadvq322f3s2yf8c88v56wpdpzfxmvlzaqr8"; 137 | }); 138 | 139 | ghcjs-prim = self.callPackage ({ mkDerivation, fetchgit, primitive }: mkDerivation { 140 | pname = "ghcjs-prim"; 141 | version = "0.1.0.0"; 142 | src = fetchgit { 143 | url = git://github.com/ghcjs/ghcjs-prim.git; 144 | rev = "dfeaab2aafdfefe46bf12960d069f28d2e5f1454"; # ghc-7.10 branch 145 | sha256 = "19kyb26nv1hdpp0kc2gaxkq5drw5ib4za0641py5i4bbf1g58yvy"; 146 | }; 147 | buildDepends = [ primitive ]; 148 | license = pkgs.stdenv.lib.licenses.bsd3; 149 | }) {}; 150 | 151 | # diagrams/monoid-extras#19 152 | monoid-extras = overrideCabal super.monoid-extras (drv: { 153 | prePatch = "sed -i 's|4\.8|4.9|' monoid-extras.cabal"; 154 | }); 155 | 156 | # diagrams/statestack#5 157 | statestack = overrideCabal super.statestack (drv: { 158 | prePatch = "sed -i 's|4\.8|4.9|' statestack.cabal"; 159 | }); 160 | 161 | # diagrams/diagrams-core#83 162 | diagrams-core = overrideCabal super.diagrams-core (drv: { 163 | prePatch = "sed -i 's|4\.8|4.9|' diagrams-core.cabal"; 164 | }); 165 | 166 | timezone-series = doJailbreak super.timezone-series; 167 | timezone-olson = doJailbreak super.timezone-olson; 168 | libmpd = dontCheck super.libmpd; 169 | xmonad-extras = overrideCabal super.xmonad-extras (drv: { 170 | postPatch = '' 171 | sed -i -e "s,<\*,<¤,g" XMonad/Actions/Volume.hs 172 | ''; 173 | }); 174 | 175 | # Workaround for a workaround, see comment for "ghcjs" flag. 176 | jsaddle = let jsaddle' = disableCabalFlag super.jsaddle "ghcjs"; 177 | in addBuildDepends jsaddle' [ self.glib self.gtk3 self.webkitgtk3 178 | self.webkitgtk3-javascriptcore ]; 179 | 180 | # https://github.com/cartazio/arithmoi/issues/1 181 | arithmoi = markBroken super.arithmoi; 182 | NTRU = dontDistribute super.NTRU; 183 | arith-encode = dontDistribute super.arith-encode; 184 | barchart = dontDistribute super.barchart; 185 | constructible = dontDistribute super.constructible; 186 | cyclotomic = dontDistribute super.cyclotomic; 187 | diagrams = dontDistribute super.diagrams; 188 | diagrams-contrib = dontDistribute super.diagrams-contrib; 189 | enumeration = dontDistribute super.enumeration; 190 | ghci-diagrams = dontDistribute super.ghci-diagrams; 191 | ihaskell-diagrams = dontDistribute super.ihaskell-diagrams; 192 | nimber = dontDistribute super.nimber; 193 | pell = dontDistribute super.pell; 194 | quadratic-irrational = dontDistribute super.quadratic-irrational; 195 | 196 | # https://github.com/lymar/hastache/issues/47 197 | hastache = dontCheck super.hastache; 198 | 199 | # The compat library is empty in the presence of mtl 2.2.x. 200 | mtl-compat = dontHaddock super.mtl-compat; 201 | 202 | # https://github.com/bos/bloomfilter/issues/11 203 | bloomfilter = dontHaddock (appendConfigureFlag super.bloomfilter "--ghc-option=-XFlexibleContexts"); 204 | 205 | # https://github.com/ocharles/tasty-rerun/issues/5 206 | tasty-rerun = dontHaddock (appendConfigureFlag super.tasty-rerun "--ghc-option=-XFlexibleContexts"); 207 | 208 | # http://hub.darcs.net/ivanm/graphviz/issue/5 209 | graphviz = dontCheck (dontJailbreak (appendPatch super.graphviz ./patches/graphviz-fix-ghc710.patch)); 210 | 211 | # Broken with GHC 7.10.x. 212 | aeson_0_7_0_6 = markBroken super.aeson_0_7_0_6; 213 | Cabal_1_20_0_3 = markBroken super.Cabal_1_20_0_3; 214 | cabal-install_1_18_1_0 = markBroken super.cabal-install_1_18_1_0; 215 | containers_0_4_2_1 = markBroken super.containers_0_4_2_1; 216 | control-monad-free_0_5_3 = markBroken super.control-monad-free_0_5_3; 217 | haddock-api_2_15_0_2 = markBroken super.haddock-api_2_15_0_2; 218 | QuickCheck_1_2_0_1 = markBroken super.QuickCheck_1_2_0_1; 219 | seqid-streams_0_1_0 = markBroken super.seqid-streams_0_1_0; 220 | vector_0_10_9_2 = markBroken super.vector_0_10_9_2; 221 | hoopl_3_10_2_0 = markBroken super.hoopl_3_10_2_0; 222 | 223 | # https://github.com/HugoDaniel/RFC3339/issues/14 224 | timerep = dontCheck super.timerep; 225 | 226 | # Upstream has no issue tracker. 227 | llvm-base-types = markBroken super.llvm-base-types; 228 | llvm-analysis = dontDistribute super.llvm-analysis; 229 | llvm-data-interop = dontDistribute super.llvm-data-interop; 230 | llvm-tools = dontDistribute super.llvm-tools; 231 | 232 | # Upstream has no issue tracker. 233 | MaybeT = markBroken super.MaybeT; 234 | grammar-combinators = dontDistribute super.grammar-combinators; 235 | 236 | # Required to fix version 0.91.0.0. 237 | wx = dontHaddock (appendConfigureFlag super.wx "--ghc-option=-XFlexibleContexts"); 238 | 239 | # Upstream has no issue tracker. 240 | Graphalyze = markBroken super.Graphalyze; 241 | gbu = dontDistribute super.gbu; 242 | SourceGraph = dontDistribute super.SourceGraph; 243 | 244 | # Upstream has no issue tracker. 245 | markBroken = super.protocol-buffers; 246 | caffegraph = dontDistribute super.caffegraph; 247 | 248 | # Deprecated: https://github.com/mikeizbicki/ConstraintKinds/issues/8 249 | ConstraintKinds = markBroken super.ConstraintKinds; 250 | HLearn-approximation = dontDistribute super.HLearn-approximation; 251 | HLearn-distributions = dontDistribute super.HLearn-distributions; 252 | HLearn-classification = dontDistribute super.HLearn-classification; 253 | 254 | # Doesn't work with LLVM 3.5. 255 | llvm-general = markBroken super.llvm-general; 256 | 257 | # Inexplicable haddock failure 258 | # https://github.com/gregwebs/aeson-applicative/issues/2 259 | aeson-applicative = dontHaddock super.aeson-applicative; 260 | 261 | # GHC 7.10.1 is affected by https://github.com/srijs/hwsl2/issues/1. 262 | hwsl2 = dontCheck super.hwsl2; 263 | 264 | # https://github.com/haskell/haddock/issues/427 265 | haddock = dontCheck super.haddock; 266 | 267 | # The tests in vty-ui do not build, but vty-ui itself builds. 268 | vty-ui = enableCabalFlag super.vty-ui "no-tests"; 269 | 270 | # https://github.com/DanielG/cabal-helper/issues/10 271 | cabal-helper = dontCheck super.cabal-helper; 272 | 273 | # no integer-gmp 274 | cryptonite = disableCabalFlag super.cryptonite "integer-gmp"; 275 | 276 | # no use of const_str 277 | zlib = overrideCabal super.zlib (drv: { 278 | prePatch = ''sed -i 's|#{const_str ZLIB_VERSION}|\"${pkgs.zlib.version}\"|' Codec/Compression/Zlib/Stream.hsc''; 279 | }); 280 | 281 | # no template haskell 282 | monad-logger = disableCabalFlag super.monad-logger "template_haskell"; 283 | 284 | # do not use getProtocolNumber 285 | network = appendPatch (appendPatch super.network ./patches/network-android.patch) ./patches/network-tcp-for-bionic.patch; 286 | 287 | double-conversion = overrideCabal super.double-conversion (drv: { 288 | version = "2.0.1.1"; 289 | src = pkgs.fetchFromGitHub { 290 | owner = "bos"; 291 | repo = "double-conversion"; 292 | rev = "f4c29ec8faca989b988788651e0286e94439a1c6"; 293 | sha256 = "1i1q0vq7yxsaik7jcbjr26wgpkf5nx21yx1k1crcnrkdivaskfgh"; 294 | }; 295 | }); 296 | 297 | hlint = overrideCabal super.hlint (drv: { 298 | version = "1.9.28"; 299 | sha256 = "047pqyjf13ma2f3igk7vrrlaz42sbrnmljfw4bss2qn33656a1pb"; 300 | }); 301 | 302 | reflection = disableCabalFlag super.reflection "template-haskell"; 303 | } 304 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs, stdenv, ghc 2 | , packageSetConfig ? (self: super: {}) 3 | , overrides ? (self: super: {}) 4 | }: 5 | 6 | let 7 | 8 | fix = f: let x = f x // { __unfix__ = f; }; in x; 9 | 10 | extend = rattrs: f: self: let super = rattrs self; in super // f self super; 11 | 12 | haskellPackages = self: 13 | let 14 | 15 | mkDerivation = pkgs.callPackage ./generic-builder.nix { 16 | inherit stdenv; 17 | inherit (pkgs) fetchurl pkgconfig glibcLocales coreutils gnugrep gnused; 18 | inherit (self) ghc jailbreak-cabal; 19 | hscolour = pkgs.haskell.ghc7102.hscolour; 20 | #hscolour = overrideCabal self.hscolour (drv: { 21 | # isLibrary = false; 22 | # doHaddock = false; 23 | # hyperlinkSource = false; # Avoid depending on hscolour for this build. 24 | # postFixup = "rm -rf $out/lib $out/share $out/nix-support"; 25 | #}); 26 | cpphs = overrideCabal (self.cpphs.overrideScope (self: super: { 27 | mkDerivation = drv: super.mkDerivation (drv // { 28 | enableSharedExecutables = false; 29 | enableSharedLibraries = false; 30 | doHaddock = false; 31 | useCpphs = false; 32 | }); 33 | })) (drv: { 34 | isLibrary = false; 35 | postFixup = "rm -rf $out/lib $out/share $out/nix-support"; 36 | }); 37 | }; 38 | 39 | overrideCabal = drv: f: drv.override (args: args // { 40 | mkDerivation = drv: args.mkDerivation (drv // f drv); 41 | }); 42 | 43 | callPackageWithScope = scope: drv: args: (stdenv.lib.callPackageWith scope drv args) // { 44 | overrideScope = f: callPackageWithScope (mkScope (fix (extend scope.__unfix__ f))) drv args; 45 | }; 46 | 47 | mkScope = scope: pkgs // pkgs.xlibs // pkgs.gnome // scope; 48 | defaultScope = mkScope self; 49 | callPackage = drv: args: callPackageWithScope defaultScope drv args; 50 | 51 | withPackages = packages: callPackage ./with-packages-wrapper.nix { 52 | inherit (self) llvmPackages; 53 | haskellPackages = self; 54 | inherit packages; 55 | }; 56 | 57 | in 58 | import ./hackage-packages.nix { inherit pkgs stdenv callPackage; } self // { 59 | 60 | inherit mkDerivation callPackage; 61 | 62 | ghcWithPackages = selectFrom: withPackages (selectFrom self); 63 | 64 | ghcWithHoogle = selectFrom: 65 | let 66 | packages = selectFrom self; 67 | hoogle = callPackage ./hoogle.nix { inherit packages; }; 68 | in withPackages (packages ++ [ hoogle ]); 69 | 70 | ghc = ghc // { 71 | withPackages = self.ghcWithPackages; 72 | withHoogle = self.ghcWithHoogle; 73 | }; 74 | 75 | }; 76 | 77 | commonConfiguration = import ./configuration-common.nix { inherit pkgs; }; 78 | 79 | in 80 | 81 | fix (extend (extend (extend haskellPackages commonConfiguration) packageSetConfig) overrides) 82 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/generic-builder.nix: -------------------------------------------------------------------------------- 1 | { stdenv, fetchurl, ghc, pkgconfig, glibcLocales, coreutils, gnugrep, gnused 2 | , jailbreak-cabal , hscolour 3 | , cpphs 4 | }: 5 | 6 | { pname 7 | , version, revision ? null 8 | , sha256 ? null 9 | , src ? fetchurl { url = "mirror://hackage/${pname}-${version}.tar.gz"; inherit sha256; } 10 | , buildDepends ? [], libraryHaskellDepends ? [], executableHaskellDepends ? [] 11 | , buildTarget ? "" 12 | , buildTools ? [], libraryToolDepends ? [], executableToolDepends ? [], testToolDepends ? [] 13 | , configureFlags ? [] 14 | , description ? "" 15 | , doCheck ? if ghc.isGhcAndroid then false else stdenv.lib.versionOlder "7.4" ghc.version 16 | , doHoogle ? true 17 | , editedCabalFile ? null 18 | , enableLibraryProfiling ? false 19 | , enableExecutableProfiling ? false 20 | , enableSharedExecutables ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version) 21 | , enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version) 22 | , enableSplitObjs ? !stdenv.isDarwin # http://hackage.haskell.org/trac/ghc/ticket/4013 23 | , enableStaticLibraries ? true 24 | , extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? [] 25 | , homepage ? "http://hackage.haskell.org/package/${pname}" 26 | , platforms ? ghc.meta.platforms 27 | , hydraPlatforms ? platforms 28 | , hyperlinkSource ? true 29 | , isExecutable ? false, isLibrary ? !isExecutable 30 | , jailbreak ? false 31 | , license 32 | , maintainers ? [] 33 | , doHaddock ? !stdenv.isDarwin || stdenv.lib.versionAtLeast ghc.version "7.8" 34 | , passthru ? {} 35 | , pkgconfigDepends ? [], libraryPkgconfigDepends ? [], executablePkgconfigDepends ? [], testPkgconfigDepends ? [] 36 | , testDepends ? [], testHaskellDepends ? [], testSystemDepends ? [] 37 | , testTarget ? "" 38 | , broken ? false 39 | , preUnpack ? "", postUnpack ? "" 40 | , patches ? [], patchPhase ? "", prePatch ? "", postPatch ? "" 41 | , preConfigure ? "", postConfigure ? "" 42 | , preBuild ? "", postBuild ? "" 43 | , installPhase ? "", preInstall ? "", postInstall ? "" 44 | , checkPhase ? "", preCheck ? "", postCheck ? "" 45 | , preFixup ? "", postFixup ? "" 46 | , coreSetup ? false # Use only core packages to build Setup.hs. 47 | , useCpphs ? false 48 | } @ args: 49 | 50 | assert editedCabalFile != null -> revision != null; 51 | 52 | let 53 | 54 | inherit (stdenv.lib) optional optionals optionalString versionOlder 55 | concatStringsSep enableFeature optionalAttrs toUpper; 56 | 57 | isGhcjs = ghc.isGhcjs or false; 58 | isGhcAndroid = ghc.isGhcAndroid or false; 59 | 60 | newCabalFileUrl = "http://hackage.haskell.org/package/${pname}-${version}/revision/${revision}.cabal"; 61 | newCabalFile = fetchurl { 62 | url = newCabalFileUrl; 63 | sha256 = editedCabalFile; 64 | name = "${pname}-${version}-r${revision}.cabal"; 65 | }; 66 | 67 | defaultSetupHs = builtins.toFile "Setup.hs" '' 68 | import Distribution.Simple 69 | main = defaultMain 70 | ''; 71 | 72 | ghc76xOrLater = isGhcjs || stdenv.lib.versionOlder "7.6" ghc.version; 73 | packageDbFlag = if ghc76xOrLater then "package-db" else "package-conf"; 74 | 75 | hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling); 76 | 77 | # We cannot enable -j parallelism for libraries because GHC is far more 78 | # likely to generate a non-determistic library ID in that case. Further 79 | # details are at . 80 | enableParallelBuilding = versionOlder "7.8" ghc.version && !hasActiveLibrary; 81 | 82 | defaultConfigureFlags = [ 83 | "--verbose" "--prefix=$out" "--libdir=\\$prefix/lib/${ghcUnderLib}" "--libsubdir=\\$pkgid" 84 | "--package-db=$packageConfDir" 85 | (optionalString (enableSharedExecutables && stdenv.isLinux) "--ghc-option=-optl=-Wl,-rpath=$out/lib/${ghcUnderLib}/${pname}-${version}") 86 | (optionalString (enableSharedExecutables && stdenv.isDarwin) "--ghc-option=-optl=-Wl,-headerpad_max_install_names") 87 | (optionalString enableParallelBuilding "--ghc-option=-j$NIX_BUILD_CORES") 88 | (optionalString useCpphs "--with-cpphs=${cpphs}/bin/cpphs --ghc-options=-cpp --ghc-options=-pgmP${cpphs}/bin/cpphs --ghc-options=-optP--cpp") 89 | (enableFeature enableLibraryProfiling "library-profiling") 90 | (enableFeature enableExecutableProfiling "executable-profiling") 91 | (optionalString (isGhcjs || versionOlder "7" ghc.version) (enableFeature enableStaticLibraries "library-vanilla")) 92 | (optionalString ((isGhcjs || versionOlder "7.4" ghc.version) && !isGhcAndroid ) (enableFeature enableSharedExecutables "executable-dynamic")) 93 | (optionalString (isGhcjs || versionOlder "7" ghc.version) (enableFeature doCheck "tests")) 94 | ] ++ optionals isGhcjs [ 95 | "--with-hsc2hs=${ghc.nativeGhc}/bin/hsc2hs" 96 | "--ghcjs" 97 | ] ++ optionals isGhcAndroid [ 98 | "--with-hsc2hs=${ghc.nativeGhc}/bin/hsc2hs" 99 | "--with-ghc=${ghc}/bin/arm-unknown-linux-androideabi-ghc" 100 | "--with-ghc-pkg=${ghc}/bin/arm-unknown-linux-androideabi-ghc-pkg" 101 | ] ++ (if isGhcAndroid 102 | then [ "--with-gcc=${ghc.androidndk}/bin/arm-linux-androideabi-gcc" 103 | "--with-ld=${ghc.androidndk}/bin/arm-linux-androideabi-ld.gold" 104 | "--with-strip=${ghc.androidndk}/bin/arm-linux-androideabi-strip" 105 | "--hsc2hs-options=--cross-compile" 106 | ] 107 | else [ "--with-gcc=$CC" # Clang won't work without that extra information. 108 | (enableFeature enableSharedLibraries "shared") 109 | (enableFeature enableSplitObjs "split-objs") 110 | ]); 111 | 112 | 113 | 114 | setupCompileFlags = [ 115 | (optionalString (!coreSetup) "-${packageDbFlag}=$packageConfDir") 116 | (optionalString (isGhcjs || versionOlder "7.8" ghc.version) "-j$NIX_BUILD_CORES") 117 | (optionalString (versionOlder "7.10" ghc.version) "-threaded") # https://github.com/haskell/cabal/issues/2398 118 | ]; 119 | 120 | isHaskellPkg = x: (x ? pname) && (x ? version) && (x ? env); 121 | isSystemPkg = x: !isHaskellPkg x; 122 | 123 | allPkgconfigDepends = pkgconfigDepends ++ libraryPkgconfigDepends ++ executablePkgconfigDepends ++ 124 | optionals doCheck testPkgconfigDepends; 125 | 126 | propagatedBuildInputs = buildDepends ++ libraryHaskellDepends ++ executableHaskellDepends; 127 | otherBuildInputs = extraLibraries ++ librarySystemDepends ++ executableSystemDepends ++ 128 | buildTools ++ libraryToolDepends ++ executableToolDepends ++ 129 | optionals (allPkgconfigDepends != []) ([pkgconfig] ++ allPkgconfigDepends) ++ 130 | optionals doCheck (testDepends ++ testHaskellDepends ++ testSystemDepends ++ testToolDepends); 131 | allBuildInputs = propagatedBuildInputs ++ otherBuildInputs; 132 | 133 | haskellBuildInputs = stdenv.lib.filter isHaskellPkg allBuildInputs; 134 | systemBuildInputs = stdenv.lib.filter isSystemPkg allBuildInputs; 135 | 136 | ghcEnv = ghc.withPackages (p: haskellBuildInputs); 137 | 138 | setupCommand = if isGhcjs then "${ghc.nodejs}/bin/node ./Setup.jsexe/all.js" else "./Setup"; 139 | ghcCommand = if isGhcjs then "ghcjs" else if isGhcAndroid then "arm-unknown-linux-androideabi-ghc" else "ghc"; 140 | ghcCommandCaps = toUpper ghcCommand; 141 | ghcUnderLib = if isGhcAndroid then "arm-unknown-linux-androideabi-ghc-" + ghc.version else ghc.name; 142 | 143 | in 144 | 145 | assert allPkgconfigDepends != [] -> pkgconfig != null; 146 | 147 | stdenv.mkDerivation ({ 148 | name = "${pname}-${version}"; 149 | 150 | pos = builtins.unsafeGetAttrPos "pname" args; 151 | 152 | prePhases = ["setupCompilerEnvironmentPhase"]; 153 | preConfigurePhases = ["compileBuildDriverPhase"]; 154 | preInstallPhases = if isGhcAndroid then [] else ["haddockPhase"]; 155 | 156 | inherit src; 157 | 158 | nativeBuildInputs = otherBuildInputs ++ optionals (!hasActiveLibrary) propagatedBuildInputs; 159 | propagatedNativeBuildInputs = optionals hasActiveLibrary propagatedBuildInputs; 160 | 161 | LANG = "en_US.UTF-8"; # GHC needs the locale configured during the Haddock phase. 162 | 163 | prePatch = optionalString (editedCabalFile != null) '' 164 | echo "Replace Cabal file with edited version from ${newCabalFileUrl}." 165 | cp ${newCabalFile} ${pname}.cabal 166 | '' + prePatch; 167 | 168 | postPatch = optionalString jailbreak '' 169 | echo "Run jailbreak-cabal to lift version restrictions on build inputs." 170 | ${jailbreak-cabal}/bin/jailbreak-cabal ${pname}.cabal 171 | '' + postPatch; 172 | #${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"} 173 | 174 | setupCompilerEnvironmentPhase = '' 175 | runHook preSetupCompilerEnvironment 176 | 177 | echo "Build with ${ghc}." 178 | export PATH="${ghc}/bin:$PATH" 179 | 180 | packageConfDir="$TMPDIR/package.conf.d" 181 | mkdir -p $packageConfDir 182 | 183 | setupCompileFlags="${concatStringsSep " " setupCompileFlags}" 184 | configureFlags="${concatStringsSep " " defaultConfigureFlags} $configureFlags" 185 | 186 | local inputClosure="" 187 | for i in $propagatedNativeBuildInputs $nativeBuildInputs; do 188 | findInputs $i inputClosure propagated-native-build-inputs 189 | done 190 | for p in $inputClosure; do 191 | if [ -d "$p/lib/${ghcUnderLib}/package.conf.d" ]; then 192 | cp -f "$p/lib/${ghcUnderLib}/package.conf.d/"*.conf $packageConfDir/ 193 | continue 194 | fi 195 | if [ -d "$p/include" ]; then 196 | configureFlags+=" --extra-include-dirs=$p/include" 197 | fi 198 | if [ -d "$p/lib" ]; then 199 | configureFlags+=" --extra-lib-dirs=$p/lib" 200 | fi 201 | done 202 | ${ghcCommand}-pkg --${packageDbFlag}="$packageConfDir" recache 203 | 204 | runHook postSetupCompilerEnvironment 205 | ''; 206 | 207 | compileBuildDriverPhase = 208 | let setupGhcCommand=if isGhcAndroid then "${ghc.nativeGhc}/bin/ghc" else ghcCommand; 209 | in '' 210 | runHook preCompileBuildDriver 211 | 212 | for i in Setup.hs Setup.lhs ${defaultSetupHs}; do 213 | test -f $i && break 214 | done 215 | 216 | echo setupCompileFlags: $setupCompileFlags 217 | ${setupGhcCommand} $setupCompileFlags --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i 218 | 219 | runHook postCompileBuildDriver 220 | ''; 221 | 222 | configurePhase = '' 223 | runHook preConfigure 224 | 225 | unset GHC_PACKAGE_PATH # Cabal complains if this variable is set during configure. 226 | 227 | echo configureFlags: $configureFlags 228 | ${setupCommand} configure $configureFlags 2>&1 | ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log" 229 | if ${gnugrep}/bin/egrep -q '^Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then 230 | echo >&2 "*** abort because of serious configure-time warning from Cabal" 231 | exit 1 232 | fi 233 | 234 | export GHC_PACKAGE_PATH="$packageConfDir:" 235 | 236 | runHook postConfigure 237 | ''; 238 | 239 | buildPhase = '' 240 | runHook preBuild 241 | ${setupCommand} build ${buildTarget} 242 | runHook postBuild 243 | ''; 244 | 245 | checkPhase = '' 246 | runHook preCheck 247 | ${setupCommand} test ${testTarget} 248 | runHook postCheck 249 | ''; 250 | 251 | haddockPhase = '' 252 | runHook preHaddock 253 | ${optionalString (doHaddock && hasActiveLibrary) '' 254 | ${setupCommand} haddock --html \ 255 | ${optionalString doHoogle "--hoogle"} \ 256 | ${optionalString (hasActiveLibrary && hyperlinkSource) "--hyperlink-source"} 257 | ''} 258 | runHook postHaddock 259 | ''; 260 | 261 | installPhase = '' 262 | runHook preInstall 263 | 264 | ${if !hasActiveLibrary then "${setupCommand} install" else '' 265 | ${setupCommand} copy 266 | local packageConfDir="$out/lib/${ghcUnderLib}/package.conf.d" 267 | local packageConfFile="$packageConfDir/${pname}-${version}.conf" 268 | mkdir -p "$packageConfDir" 269 | ${setupCommand} register --gen-pkg-config=$packageConfFile 270 | local pkgId=$( ${gnused}/bin/sed -n -e 's|^id: ||p' $packageConfFile ) 271 | mv $packageConfFile $packageConfDir/$pkgId.conf 272 | ''} 273 | 274 | ${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && stdenv.lib.versionOlder ghc.version "7.10") '' 275 | for exe in "$out/bin/"* ; do 276 | install_name_tool -add_rpath "$out/lib/ghc-${ghc.version}/${pname}-${version}" "$exe" 277 | done 278 | ''} 279 | 280 | runHook postInstall 281 | ''; 282 | 283 | dontStrip = isGhcAndroid ; 284 | 285 | passthru = passthru // { 286 | 287 | inherit pname version; 288 | 289 | isHaskellLibrary = hasActiveLibrary; 290 | 291 | env = stdenv.mkDerivation { 292 | name = "interactive-${optionalString (hasActiveLibrary && pname != "ghcjs") "haskell-"}${pname}-${version}-environment"; 293 | nativeBuildInputs = [ ghcEnv systemBuildInputs ]; 294 | LANG = "en_US.UTF-8"; 295 | LOCALE_ARCHIVE = optionalString stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive"; 296 | shellHook = '' 297 | export NIX_${ghcCommandCaps}="${ghcEnv}/bin/${ghcCommand}" 298 | export NIX_${ghcCommandCaps}PKG="${ghcEnv}/bin/${ghcCommand}-pkg" 299 | export NIX_${ghcCommandCaps}_DOCDIR="${ghcEnv}/share/doc/ghc/html" 300 | export NIX_${ghcCommandCaps}_LIBDIR="${ghcEnv}/lib/${ghcEnv.name}" 301 | ''; 302 | }; 303 | 304 | }; 305 | 306 | meta = { inherit homepage license platforms; } 307 | // optionalAttrs broken { inherit broken; } 308 | // optionalAttrs (description != "") { inherit description; } 309 | // optionalAttrs (maintainers != []) { inherit maintainers; } 310 | // optionalAttrs (hydraPlatforms != platforms) { inherit hydraPlatforms; } 311 | ; 312 | 313 | } 314 | // optionalAttrs (preUnpack != "") { inherit preUnpack; } 315 | // optionalAttrs (postUnpack != "") { inherit postUnpack; } 316 | // optionalAttrs (configureFlags != []) { inherit configureFlags; } 317 | // optionalAttrs (patches != []) { inherit patches; } 318 | // optionalAttrs (patchPhase != "") { inherit patchPhase; } 319 | // optionalAttrs (postPatch != "") { inherit postPatch; } 320 | // optionalAttrs (preConfigure != "") { inherit preConfigure; } 321 | // optionalAttrs (postConfigure != "") { inherit postConfigure; } 322 | // optionalAttrs (preBuild != "") { inherit preBuild; } 323 | // optionalAttrs (postBuild != "") { inherit postBuild; } 324 | // optionalAttrs (doCheck) { inherit doCheck; } 325 | // optionalAttrs (checkPhase != "") { inherit checkPhase; } 326 | // optionalAttrs (preCheck != "") { inherit preCheck; } 327 | // optionalAttrs (postCheck != "") { inherit postCheck; } 328 | // optionalAttrs (preInstall != "") { inherit preInstall; } 329 | // optionalAttrs (installPhase != "") { inherit installPhase; } 330 | // optionalAttrs (postInstall != "") { inherit postInstall; } 331 | // optionalAttrs (preFixup != "") { inherit preFixup; } 332 | // optionalAttrs (postFixup != "") { inherit postFixup; } 333 | // optionalAttrs (stdenv.isLinux) { LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; } 334 | ) 335 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/hoogle-local-wrapper.sh: -------------------------------------------------------------------------------- 1 | #! @shell@ 2 | 3 | COMMAND=$1 4 | shift 5 | exec @hoogle@/bin/hoogle "$COMMAND" -d @out@/share/doc/hoogle "$@" 6 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/hoogle.nix: -------------------------------------------------------------------------------- 1 | # Install not only the Hoogle library and executable, but also a local Hoogle 2 | # database which provides "Source" links to all specified 'packages' -- or the 3 | # current Haskell Platform if no custom package set is provided. 4 | # 5 | # It is intended to be used in config.nix similarly to: 6 | # 7 | # { packageOverrides = pkgs: rec { 8 | # 9 | # haskellPackages = 10 | # let callPackage = pkgs.lib.callPackageWith haskellPackages; 11 | # in pkgs.recurseIntoAttrs (pkgs.haskellPackages.override { 12 | # extension = self: super: { 13 | # hoogleLocal = pkgs.haskellPackages.hoogleLocal.override { 14 | # packages = with pkgs.haskellPackages; [ 15 | # mmorph 16 | # monadControl 17 | # ]; 18 | # }; 19 | # }; 20 | # }); 21 | # }} 22 | # 23 | # This will build mmorph and monadControl, and have the hoogle installation 24 | # refer to their documentation via symlink so they are not garbage collected. 25 | 26 | { lib, stdenv, hoogle, rehoo 27 | , ghc, packages ? [ ghc.ghc ] 28 | }: 29 | 30 | let 31 | inherit (stdenv.lib) optional; 32 | wrapper = ./hoogle-local-wrapper.sh; 33 | in 34 | stdenv.mkDerivation { 35 | name = "hoogle-local-0.1"; 36 | buildInputs = [hoogle rehoo]; 37 | 38 | phases = [ "buildPhase" ]; 39 | 40 | docPackages = (lib.closePropagation packages); 41 | 42 | buildPhase = '' 43 | if [ -z "$docPackages" ]; then 44 | echo "ERROR: The packages attribute has not been set" 45 | exit 1 46 | fi 47 | 48 | mkdir -p $out/share/doc/hoogle 49 | 50 | function import_dbs() { 51 | find $1 -name '*.txt' | while read f; do 52 | newname=$(basename "$f" | tr '[:upper:]' '[:lower:]') 53 | if [[ -f $f && ! -f ./$newname ]]; then 54 | cp -p $f "./$newname" 55 | hoogle convert -d "$(dirname $f)" "./$newname" 56 | fi 57 | done 58 | } 59 | 60 | echo importing builtin packages 61 | for docdir in ${ghc}/share/doc/ghc*/html/libraries/*; do 62 | if [[ -d $docdir ]]; then 63 | import_dbs $docdir 64 | ln -sfn $docdir $out/share/doc/hoogle 65 | fi 66 | done 67 | 68 | echo importing other packages 69 | for i in $docPackages; do 70 | if [[ ! $i == $out ]]; then 71 | for docdir in $i/share/doc/*-ghc-*/* $i/share/doc/*; do 72 | name=`basename $docdir` 73 | docdir=$docdir/html 74 | if [[ -d $docdir ]]; then 75 | import_dbs $docdir 76 | ln -sfn $docdir $out/share/doc/hoogle/$name 77 | fi 78 | done 79 | fi 80 | done 81 | 82 | echo building hoogle database 83 | # FIXME: rehoo is marked as depricated on Hackage 84 | chmod 644 *.hoo *.txt 85 | rehoo -j$NIX_BUILD_CORES -c64 . 86 | 87 | mv default.hoo .x 88 | rm -fr downloads *.dep *.txt *.hoo 89 | mv .x $out/share/doc/hoogle/default.hoo 90 | 91 | echo building haddock index 92 | # adapted from GHC's gen_contents_index 93 | cd $out/share/doc/hoogle 94 | 95 | args= 96 | for hdfile in `ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort` 97 | do 98 | name_version=`echo "$hdfile" | sed 's#/.*##'` 99 | args="$args --read-interface=$name_version,$hdfile" 100 | done 101 | 102 | ${ghc}/bin/haddock --gen-index --gen-contents -o . \ 103 | -t "Haskell Hierarchical Libraries" \ 104 | -p ${ghc}/share/doc/ghc*/html/libraries/prologue.txt \ 105 | $args 106 | 107 | echo finishing up 108 | mkdir -p $out/bin 109 | substitute ${wrapper} $out/bin/hoogle \ 110 | --subst-var out --subst-var-by shell ${stdenv.shell} \ 111 | --subst-var-by hoogle ${hoogle} 112 | chmod +x $out/bin/hoogle 113 | ''; 114 | 115 | passthru = { 116 | isHaskellLibrary = false; # for the filter in ./with-packages-wrapper.nix 117 | }; 118 | 119 | meta = { 120 | description = "A local Hoogle database"; 121 | platforms = ghc.meta.platforms; 122 | hydraPlatforms = with stdenv.lib.platforms; none; 123 | maintainers = with stdenv.lib.maintainers; [ ttuegel ]; 124 | }; 125 | } 126 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/lib.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: 2 | 3 | rec { 4 | 5 | overrideCabal = drv: f: (drv.override (args: args // { 6 | mkDerivation = drv: args.mkDerivation (drv // f drv); 7 | })) // { 8 | overrideScope = scope: overrideCabal (drv.overrideScope scope) f; 9 | }; 10 | 11 | doHaddock = drv: overrideCabal drv (drv: { doHaddock = true; }); 12 | dontHaddock = drv: overrideCabal drv (drv: { doHaddock = false; }); 13 | 14 | doJailbreak = drv: overrideCabal drv (drv: { jailbreak = true; }); 15 | dontJailbreak = drv: overrideCabal drv (drv: { jailbreak = false; }); 16 | 17 | doCheck = drv: overrideCabal drv (drv: { doCheck = true; }); 18 | dontCheck = drv: overrideCabal drv (drv: { doCheck = false; }); 19 | 20 | dontDistribute = drv: overrideCabal drv (drv: { hydraPlatforms = []; }); 21 | 22 | appendConfigureFlag = drv: x: overrideCabal drv (drv: { configureFlags = (drv.configureFlags or []) ++ [x]; }); 23 | removeConfigureFlag = drv: x: overrideCabal drv (drv: { configureFlags = pkgs.stdenv.lib.remove x (drv.configureFlags or []); }); 24 | 25 | addBuildTool = drv: x: addBuildTools drv [x]; 26 | addBuildTools = drv: xs: overrideCabal drv (drv: { buildTools = (drv.buildTools or []) ++ xs; }); 27 | 28 | addExtraLibrary = drv: x: addExtraLibraries drv [x]; 29 | addExtraLibraries = drv: xs: overrideCabal drv (drv: { extraLibraries = (drv.extraLibraries or []) ++ xs; }); 30 | 31 | addBuildDepend = drv: x: addBuildDepends drv [x]; 32 | addBuildDepends = drv: xs: overrideCabal drv (drv: { buildDepends = (drv.buildDepends or []) ++ xs; }); 33 | 34 | addPkgconfigDepend = drv: x: addPkgconfigDepends drv [x]; 35 | addPkgconfigDepends = drv: xs: overrideCabal drv (drv: { buildDepends = (drv.pkgconfigDepends or []) ++ xs; }); 36 | 37 | enableCabalFlag = drv: x: appendConfigureFlag (removeConfigureFlag drv "-f-${x}") "-f${x}"; 38 | disableCabalFlag = drv: x: appendConfigureFlag (removeConfigureFlag drv "-f${x}") "-f-${x}"; 39 | 40 | markBroken = drv: overrideCabal drv (drv: { broken = true; }); 41 | markBrokenVersion = version: drv: assert drv.version == version; markBroken drv; 42 | 43 | enableLibraryProfiling = drv: overrideCabal drv (drv: { enableLibraryProfiling = true; }); 44 | disableLibraryProfiling = drv: overrideCabal drv (drv: { enableLibraryProfiling = false; }); 45 | 46 | enableSharedExecutables = drv: overrideCabal drv (drv: { enableSharedExecutables = true; }); 47 | disableSharedExecutables = drv: overrideCabal drv (drv: { enableSharedExecutables = false; }); 48 | 49 | enableSharedLibraries = drv: overrideCabal drv (drv: { enableSharedLibraries = true; }); 50 | disableSharedLibraries = drv: overrideCabal drv (drv: { enableSharedLibraries = false; }); 51 | 52 | enableSplitObjs = drv: overrideCabal drv (drv: { enableSplitObjs = true; }); 53 | disableSplitObjs = drv: overrideCabal drv (drv: { enableSplitObjs = false; }); 54 | 55 | enableStaticLibraries = drv: overrideCabal drv (drv: { enableStaticLibraries = true; }); 56 | disableStaticLibraries = drv: overrideCabal drv (drv: { enableStaticLibraries = false; }); 57 | 58 | appendPatch = drv: x: appendPatches drv [x]; 59 | appendPatches = drv: xs: overrideCabal drv (drv: { patches = (drv.patches or []) ++ xs; }); 60 | 61 | doHyperlinkSource = drv: overrideCabal drv (drv: { hyperlinkSource = true; }); 62 | dontHyperlinkSource = drv: overrideCabal drv (drv: { hyperlinkSource = false; }); 63 | 64 | sdistTarball = pkg: pkgs.lib.overrideDerivation pkg (drv: { 65 | name = "${drv.pname}-source-${drv.version}"; 66 | buildPhase = "./Setup sdist"; 67 | haddockPhase = ":"; 68 | checkPhase = ":"; 69 | installPhase = "install -D dist/${drv.pname}-*.tar.gz $out/${drv.pname}-${drv.version}.tar.gz"; 70 | fixupPhase = ":"; 71 | }); 72 | 73 | buildFromSdist = pkg: pkgs.lib.overrideDerivation pkg (drv: { 74 | unpackPhase = let src = sdistTarball pkg; tarname = "${pkg.pname}-${pkg.version}"; in '' 75 | echo "Source tarball is at ${src}/${tarname}.tar.gz" 76 | tar xf ${src}/${tarname}.tar.gz 77 | cd ${pkg.pname}-* 78 | ''; 79 | }); 80 | 81 | buildStrictly = pkg: buildFromSdist (appendConfigureFlag pkg "--ghc-option=-Wall --ghc-option=-Werror"); 82 | 83 | triggerRebuild = drv: i: overrideCabal drv (drv: { postUnpack = ": trigger rebuild ${toString i}"; }); 84 | 85 | #FIXME: throw this away sometime in the future. added 2015-08-18 86 | withHoogle = throw "withHoogle is no longer supported, use ghcWithHoogle instead"; 87 | } 88 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/patches/bloomfilter-fix-on-32bit.patch: -------------------------------------------------------------------------------- 1 | From 35d972b3dc5056110d55315f2256d9c5046299c7 Mon Sep 17 00:00:00 2001 2 | From: Peter Simons 3 | Date: Tue, 1 Sep 2015 17:58:36 +0200 4 | Subject: [PATCH] Revert "Fix maximum sizing calculation." 5 | 6 | This reverts commit 44b01ba38b4fcdb5a85f44fa2f3af1f29cde8f40. The change breaks 7 | this package on 32 bit platforms. See https://github.com/bos/bloomfilter/issues/7 8 | for further details. 9 | --- 10 | Data/BloomFilter/Easy.hs | 2 +- 11 | 1 file changed, 1 insertion(+), 1 deletion(-) 12 | 13 | diff --git a/Data/BloomFilter/Easy.hs b/Data/BloomFilter/Easy.hs 14 | index 5143c6e..a349168 100644 15 | --- a/Data/BloomFilter/Easy.hs 16 | +++ b/Data/BloomFilter/Easy.hs 17 | @@ -72,7 +72,7 @@ safeSuggestSizing capacity errRate 18 | minimum [((-k) * cap / log (1 - (errRate ** (1 / k))), k) 19 | | k <- [1..100]] 20 | roundedBits = nextPowerOfTwo (ceiling bits) 21 | - in if roundedBits <= 0 || roundedBits > 0xffffffff 22 | + in if roundedBits <= 0 23 | then Left "capacity too large to represent" 24 | else Right (roundedBits, truncate hashes) 25 | 26 | -- 27 | 2.5.1 28 | 29 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/patches/dyre-nix.patch: -------------------------------------------------------------------------------- 1 | --- dyre-0.8.12/Config/Dyre/Compile.hs 2015-04-13 11:00:20.794278350 +0100 2 | +++ dyre-0.8.12-patched/Config/Dyre/Compile.hs 2015-04-13 11:07:26.938893502 +0100 3 | @@ -10,11 +10,13 @@ 4 | import System.FilePath ( () ) 5 | import System.Directory ( getCurrentDirectory, doesFileExist 6 | , createDirectoryIfMissing ) 7 | +import System.Environment ( lookupEnv ) 8 | +import Control.Applicative ((<$>)) 9 | import Control.Exception ( bracket ) 10 | -import GHC.Paths ( ghc ) 11 | 12 | import Config.Dyre.Paths ( getPaths ) 13 | import Config.Dyre.Params ( Params(..) ) 14 | +import Data.Maybe ( fromMaybe ) 15 | 16 | -- | Return the path to the error file. 17 | getErrorPath :: Params cfgType -> IO FilePath 18 | @@ -47,6 +49,7 @@ 19 | errFile <- getErrorPath params 20 | result <- bracket (openFile errFile WriteMode) hClose $ \errHandle -> do 21 | ghcOpts <- makeFlags params configFile tempBinary cacheDir libsDir 22 | + ghc <- fromMaybe "ghc" <$> lookupEnv "NIX_GHC" 23 | ghcProc <- runProcess ghc ghcOpts (Just cacheDir) Nothing 24 | Nothing Nothing (Just errHandle) 25 | waitForProcess ghcProc 26 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/patches/ghc-paths-nix-ghcjs.patch: -------------------------------------------------------------------------------- 1 | diff --git a/GHC/Paths.hs b/GHC/Paths.hs 2 | index c87565d..88b3db4 100644 3 | --- a/GHC/Paths.hs 4 | +++ b/GHC/Paths.hs 5 | @@ -1,13 +1,35 @@ 6 | {-# LANGUAGE CPP #-} 7 | +{-# LANGUAGE ScopedTypeVariables #-} 8 | 9 | module GHC.Paths ( 10 | ghc, ghc_pkg, libdir, docdir 11 | ) where 12 | 13 | +import Control.Exception as E 14 | +import Data.Maybe 15 | +import System.Environment 16 | +import System.IO.Unsafe 17 | + 18 | +-- Yes, there's lookupEnv now, but we want to be compatible 19 | +-- with older GHCs. 20 | +checkEnv :: String -> IO (Maybe String) 21 | +checkEnv var = E.catch (fmap Just (getEnv var)) 22 | + (\ (e :: IOException) -> return Nothing) 23 | + 24 | +nixLibdir, nixDocdir, nixGhc, nixGhcPkg :: Maybe FilePath 25 | +nixLibdir = unsafePerformIO (checkEnv "NIX_GHCJS_LIBDIR") 26 | +nixDocdir = unsafePerformIO (checkEnv "NIX_GHCJS_DOCDIR") 27 | +nixGhc = unsafePerformIO (checkEnv "NIX_GHCJS") 28 | +nixGhcPkg = unsafePerformIO (checkEnv "NIX_GHCJSPKG") 29 | +{-# NOINLINE nixLibdir #-} 30 | +{-# NOINLINE nixDocdir #-} 31 | +{-# NOINLINE nixGhc #-} 32 | +{-# NOINLINE nixGhcPkg #-} 33 | + 34 | libdir, docdir, ghc, ghc_pkg :: FilePath 35 | 36 | -libdir = GHC_PATHS_LIBDIR 37 | -docdir = GHC_PATHS_DOCDIR 38 | +libdir = fromMaybe GHC_PATHS_LIBDIR nixLibdir 39 | +docdir = fromMaybe GHC_PATHS_DOCDIR nixDocdir 40 | 41 | -ghc = GHC_PATHS_GHC 42 | -ghc_pkg = GHC_PATHS_GHC_PKG 43 | +ghc = fromMaybe GHC_PATHS_GHC nixGhc 44 | +ghc_pkg = fromMaybe GHC_PATHS_GHC_PKG nixGhcPkg 45 | diff --git a/Setup.hs b/Setup.hs 46 | index fad5026..1651650 100644 47 | --- a/Setup.hs 48 | +++ b/Setup.hs 49 | @@ -27,13 +27,13 @@ main = defaultMainWithHooks simpleUserHooks { 50 | defaultPostConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO () 51 | defaultPostConf args flags pkgdescr lbi = do 52 | libdir_ <- rawSystemProgramStdoutConf (fromFlag (configVerbosity flags)) 53 | - ghcProgram (withPrograms lbi) ["--print-libdir"] 54 | + ghcjsProgram (withPrograms lbi) ["--print-libdir"] 55 | let libdir = reverse $ dropWhile isSpace $ reverse libdir_ 56 | 57 | - ghc_pkg = case lookupProgram ghcPkgProgram (withPrograms lbi) of 58 | + ghc_pkg = case lookupProgram ghcjsPkgProgram (withPrograms lbi) of 59 | Just p -> programPath p 60 | Nothing -> error "ghc-pkg was not found" 61 | - ghc = case lookupProgram ghcProgram (withPrograms lbi) of 62 | + ghc = case lookupProgram ghcjsProgram (withPrograms lbi) of 63 | Just p -> programPath p 64 | Nothing -> error "ghc was not found" 65 | 66 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/patches/ghc-paths-nix.patch: -------------------------------------------------------------------------------- 1 | diff -Naur ghc-paths-0.1.0.9/GHC/Paths.hs ghc-paths-0.1.0.9-new/GHC/Paths.hs 2 | --- ghc-paths-0.1.0.9/GHC/Paths.hs 2012-12-16 13:53:45.720148396 +0100 3 | +++ ghc-paths-0.1.0.9-new/GHC/Paths.hs 2012-12-16 17:22:12.765576568 +0100 4 | @@ -1,13 +1,35 @@ 5 | {-# LANGUAGE CPP #-} 6 | +{-# LANGUAGE ScopedTypeVariables #-} 7 | 8 | module GHC.Paths ( 9 | ghc, ghc_pkg, libdir, docdir 10 | ) where 11 | 12 | +import Control.Exception as E 13 | +import Data.Maybe 14 | +import System.Environment 15 | +import System.IO.Unsafe 16 | + 17 | +-- Yes, there's lookupEnv now, but we want to be compatible 18 | +-- with older GHCs. 19 | +checkEnv :: String -> IO (Maybe String) 20 | +checkEnv var = E.catch (fmap Just (getEnv var)) 21 | + (\ (e :: IOException) -> return Nothing) 22 | + 23 | +nixLibdir, nixDocdir, nixGhc, nixGhcPkg :: Maybe FilePath 24 | +nixLibdir = unsafePerformIO (checkEnv "NIX_GHC_LIBDIR") 25 | +nixDocdir = unsafePerformIO (checkEnv "NIX_GHC_DOCDIR") 26 | +nixGhc = unsafePerformIO (checkEnv "NIX_GHC") 27 | +nixGhcPkg = unsafePerformIO (checkEnv "NIX_GHCPKG") 28 | +{-# NOINLINE nixLibdir #-} 29 | +{-# NOINLINE nixDocdir #-} 30 | +{-# NOINLINE nixGhc #-} 31 | +{-# NOINLINE nixGhcPkg #-} 32 | + 33 | libdir, docdir, ghc, ghc_pkg :: FilePath 34 | 35 | -libdir = GHC_PATHS_LIBDIR 36 | -docdir = GHC_PATHS_DOCDIR 37 | +libdir = fromMaybe GHC_PATHS_LIBDIR nixLibdir 38 | +docdir = fromMaybe GHC_PATHS_DOCDIR nixDocdir 39 | 40 | -ghc = GHC_PATHS_GHC 41 | -ghc_pkg = GHC_PATHS_GHC_PKG 42 | +ghc = fromMaybe GHC_PATHS_GHC nixGhc 43 | +ghc_pkg = fromMaybe GHC_PATHS_GHC_PKG nixGhcPkg 44 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/patches/graphviz-fix-ghc710.patch: -------------------------------------------------------------------------------- 1 | diff -ru3 graphviz.old/Data/GraphViz/Algorithms.hs graphviz/Data/GraphViz/Algorithms.hs 2 | --- graphviz.old/Data/GraphViz/Algorithms.hs 2015-05-18 15:21:38.379771357 +0300 3 | +++ graphviz/Data/GraphViz/Algorithms.hs 2015-05-18 15:01:01.940122684 +0300 4 | @@ -38,6 +38,7 @@ 5 | import Data.GraphViz.Types.Canonical 6 | import Data.GraphViz.Types.Internal.Common 7 | 8 | +import Prelude hiding (traverse) 9 | import Control.Arrow (first, second, (***)) 10 | import Control.Monad (unless) 11 | import Control.Monad.Trans.State 12 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/patches/hans-disable-webserver.patch: -------------------------------------------------------------------------------- 1 | diff -Naur hans-2.5.0.0/hans.cabal hans-2.5.0.1/hans.cabal 2 | --- hans-2.5.0.0/hans.cabal 2015-08-06 14:48:45.453072822 +0300 3 | +++ hans-2.5.0.1/hans.cabal 2015-08-06 14:49:13.044391528 +0300 4 | @@ -30,6 +30,7 @@ 5 | description: Build the example program 6 | 7 | flag web-server 8 | + default: False 9 | description: Build a simple web-server example 10 | 11 | flag word32-in-random 12 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/patches/network-android.patch: -------------------------------------------------------------------------------- 1 | diff -rupN a/Network/BSD.hsc b/Network/BSD.hsc 2 | --- a/Network/BSD.hsc 2016-01-07 23:49:58.387087802 +0000 3 | +++ b/Network/BSD.hsc 2016-01-08 00:10:38.353877230 +0000 4 | @@ -27,7 +27,7 @@ module Network.BSD 5 | , getHostByAddr 6 | , hostAddress 7 | 8 | -#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) 9 | +#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) && !defined(__ANDROID__) 10 | , getHostEntries 11 | 12 | -- ** Low level functionality 13 | @@ -43,7 +43,7 @@ module Network.BSD 14 | , getServiceByPort 15 | , getServicePortNumber 16 | 17 | -#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) 18 | +#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) && !defined(__ANDROID__) 19 | , getServiceEntries 20 | 21 | -- ** Low level functionality 22 | @@ -61,7 +61,7 @@ module Network.BSD 23 | , getProtocolNumber 24 | , defaultProtocol 25 | 26 | -#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) 27 | +#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) && !defined(__ANDROID__) 28 | , getProtocolEntries 29 | -- ** Low level functionality 30 | , setProtocolEntry 31 | @@ -77,7 +77,7 @@ module Network.BSD 32 | , NetworkAddr 33 | , NetworkEntry(..) 34 | 35 | -#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) 36 | +#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) && !defined(__ANDROID__) 37 | , getNetworkByName 38 | , getNetworkByAddr 39 | , getNetworkEntries 40 | @@ -298,7 +298,7 @@ getProtocolNumber proto = do 41 | (ProtocolEntry _ _ num) <- getProtocolByName proto 42 | return num 43 | 44 | -#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) 45 | +#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) && !defined(__ANDROID__) 46 | getProtocolEntry :: IO ProtocolEntry -- Next Protocol Entry from DB 47 | getProtocolEntry = withLock $ do 48 | ent <- throwNoSuchThingIfNull "getProtocolEntry" "no such protocol entry" 49 | @@ -397,7 +397,7 @@ getHostByAddr family addr = do 50 | foreign import CALLCONV safe "gethostbyaddr" 51 | c_gethostbyaddr :: Ptr HostAddress -> CInt -> CInt -> IO (Ptr HostEntry) 52 | 53 | -#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) 54 | +#if defined(HAVE_GETHOSTENT) && !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) && !defined(__ANDROID__) 55 | getHostEntry :: IO HostEntry 56 | getHostEntry = withLock $ do 57 | throwNoSuchThingIfNull "getHostEntry" "unable to retrieve host entry" 58 | @@ -463,7 +463,7 @@ instance Storable NetworkEntry where 59 | poke _p = error "Storable.poke(BSD.NetEntry) not implemented" 60 | 61 | 62 | -#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) 63 | +#if !defined(cygwin32_HOST_OS) && !defined(mingw32_HOST_OS) && !defined(_WIN32) && !defined(__ANDROID__) 64 | getNetworkByName :: NetworkName -> IO NetworkEntry 65 | getNetworkByName name = withLock $ do 66 | withCString name $ \ name_cstr -> do 67 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/patches/network-tcp-for-bionic.patch: -------------------------------------------------------------------------------- 1 | diff -rupN a/Network.hs b/Network.hs 2 | --- a/Network.hs 2016-01-07 23:49:58.386087797 +0000 3 | +++ b/Network.hs 2016-01-07 23:51:39.725538317 +0000 4 | @@ -107,7 +107,8 @@ connectTo hostname (PortNumber port) = c 5 | -- IPv4 only. 6 | 7 | connectTo hostname (Service serv) = do 8 | - proto <- getProtocolNumber "tcp" 9 | + -- proto <- getProtocolNumber "tcp" 10 | + let proto = 6 11 | bracketOnError 12 | (socket AF_INET Stream proto) 13 | (sClose) -- only done if there's an error 14 | @@ -119,7 +120,8 @@ connectTo hostname (Service serv) = do 15 | ) 16 | 17 | connectTo hostname (PortNumber port) = do 18 | - proto <- getProtocolNumber "tcp" 19 | + -- proto <- getProtocolNumber "tcp" 20 | + let proto = 6 21 | bracketOnError 22 | (socket AF_INET Stream proto) 23 | (sClose) -- only done if there's an error 24 | @@ -145,7 +147,8 @@ connectTo _ (UnixSocket path) = do 25 | connect' :: HostName -> ServiceName -> IO Handle 26 | 27 | connect' host serv = do 28 | - proto <- getProtocolNumber "tcp" 29 | + -- proto <- getProtocolNumber "tcp" 30 | + let proto = 6 31 | let hints = defaultHints { addrFlags = [AI_ADDRCONFIG] 32 | , addrProtocol = proto 33 | , addrSocketType = Stream } 34 | @@ -191,7 +194,8 @@ listenOn (PortNumber port) = listen' (sh 35 | -- IPv4 only. 36 | 37 | listenOn (Service serv) = do 38 | - proto <- getProtocolNumber "tcp" 39 | + -- proto <- getProtocolNumber "tcp" 40 | + let proto = 6 41 | bracketOnError 42 | (socket AF_INET Stream proto) 43 | (sClose) 44 | @@ -204,7 +208,8 @@ listenOn (Service serv) = do 45 | ) 46 | 47 | listenOn (PortNumber port) = do 48 | - proto <- getProtocolNumber "tcp" 49 | + -- proto <- getProtocolNumber "tcp" 50 | + let proto = 6 51 | bracketOnError 52 | (socket AF_INET Stream proto) 53 | (sClose) 54 | @@ -233,7 +238,8 @@ listenOn (UnixSocket path) = 55 | listen' :: ServiceName -> IO Socket 56 | 57 | listen' serv = do 58 | - proto <- getProtocolNumber "tcp" 59 | + -- proto <- getProtocolNumber "tcp" 60 | + let proto = 6 61 | -- We should probably specify addrFamily = AF_INET6 and the filter 62 | -- code below should be removed. AI_ADDRCONFIG is probably not 63 | -- necessary. But this code is well-tested. So, let's keep it. 64 | @@ -345,7 +351,8 @@ recvFrom :: HostName -- Hostname 65 | 66 | #if defined(IPV6_SOCKET_SUPPORT) 67 | recvFrom host port = do 68 | - proto <- getProtocolNumber "tcp" 69 | + -- proto <- getProtocolNumber "tcp" 70 | + let proto = 6 71 | let hints = defaultHints { addrFlags = [AI_ADDRCONFIG] 72 | , addrProtocol = proto 73 | , addrSocketType = Stream } 74 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/patches/regex-tdfa-text.patch: -------------------------------------------------------------------------------- 1 | --- regex-tdfa-text-1.0.0.2/Text/Regex/TDFA/Text/Lazy.orig.hs 2015-08-05 20:30:01.228983428 +0100 2 | +++ regex-tdfa-text-1.0.0.2/Text/Regex/TDFA/Text/Lazy.hs 2015-08-05 20:39:25.682563005 +0100 3 | @@ -26,7 +26,7 @@ 4 | import Data.Array.IArray((!),elems,amap) 5 | import qualified Data.Text.Lazy as L(Text,empty,take,drop,uncons,unpack) 6 | 7 | -import Text.Regex.Base(MatchArray,RegexContext(..),Extract(..),RegexMaker(..),RegexLike(..)) 8 | +import Text.Regex.Base(MatchText,MatchArray,RegexContext(..),Extract(..),RegexMaker(..),RegexLike(..)) 9 | import Text.Regex.Base.Impl(polymatch,polymatchM) 10 | import Text.Regex.TDFA.ReadRegex(parseRegex) 11 | import Text.Regex.TDFA.String() -- piggyback on RegexMaker for String 12 | @@ -74,7 +74,8 @@ 13 | ,after (o+l) source)) 14 | (matchOnce regex source) 15 | matchAllText regex source = 16 | - let go i _ _ | i `seq` False = undefined 17 | + let go :: Int -> L.Text -> [MatchArray] -> [MatchText L.Text] 18 | + go i _ _ | i `seq` False = undefined 19 | go _i _t [] = [] 20 | go i t (x:xs) = 21 | let (off0,len0) = x!0 22 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/patches/xmonad-nix.patch: -------------------------------------------------------------------------------- 1 | --- xmonad-0.11/XMonad/Core.hs 2013-01-01 01:31:47.000000000 +0000 2 | +++ new-xmonad/XMonad/Core.hs 2013-12-23 17:36:40.862146910 +0000 3 | @@ -47,6 +47,7 @@ 4 | import System.Process 5 | import System.Directory 6 | import System.Exit 7 | +import System.Environment (lookupEnv) 8 | import Graphics.X11.Xlib 9 | import Graphics.X11.Xlib.Extras (Event) 10 | import Data.Typeable 11 | @@ -452,6 +453,7 @@ 12 | err = base ++ ".errors" 13 | src = base ++ ".hs" 14 | lib = dir "lib" 15 | + ghc <- fromMaybe "ghc" <$> liftIO (lookupEnv "NIX_GHC") 16 | libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib 17 | srcT <- getModTime src 18 | binT <- getModTime bin 19 | @@ -460,7 +462,7 @@ 20 | -- temporarily disable SIGCHLD ignoring: 21 | uninstallSignalHandlers 22 | status <- bracket (openFile err WriteMode) hClose $ \h -> 23 | - waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-v0", "-o",binn] (Just dir) 24 | + waitForProcess =<< runProcess ghc ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-v0", "-o",binn] (Just dir) 25 | Nothing Nothing Nothing (Just h) 26 | 27 | -- re-enable SIGCHLD: 28 | @@ -469,6 +471,7 @@ 29 | -- now, if it fails, run xmessage to let the user know: 30 | when (status /= ExitSuccess) $ do 31 | ghcErr <- readFile err 32 | + xmessage <- fromMaybe "xmessage" <$> liftIO (lookupEnv "XMONAD_XMESSAGE") 33 | let msg = unlines $ 34 | ["Error detected while loading xmonad configuration file: " ++ src] 35 | ++ lines (if null ghcErr then show status else ghcErr) 36 | @@ -476,7 +479,7 @@ 37 | -- nb, the ordering of printing, then forking, is crucial due to 38 | -- lazy evaluation 39 | hPutStrLn stderr msg 40 | - forkProcess $ executeFile "xmessage" True ["-default", "okay", msg] Nothing 41 | + forkProcess $ executeFile xmessage True ["-default", "okay", msg] Nothing 42 | return () 43 | return (status == ExitSuccess) 44 | else return True 45 | -------------------------------------------------------------------------------- /nixpkgs/development/haskell-modules/with-packages-wrapper.nix: -------------------------------------------------------------------------------- 1 | { stdenv, lib, ghc, llvmPackages, packages, buildEnv, makeWrapper 2 | , ignoreCollisions ? false, withLLVM ? false 3 | , postBuild ? "" 4 | , haskellPackages 5 | }: 6 | 7 | # This wrapper works only with GHC 6.12 or later. 8 | assert lib.versionOlder "6.12" ghc.version || ghc.isGhcjs; 9 | 10 | # It's probably a good idea to include the library "ghc-paths" in the 11 | # compiler environment, because we have a specially patched version of 12 | # that package in Nix that honors these environment variables 13 | # 14 | # NIX_GHC 15 | # NIX_GHCPKG 16 | # NIX_GHC_DOCDIR 17 | # NIX_GHC_LIBDIR 18 | # 19 | # instead of hard-coding the paths. The wrapper sets these variables 20 | # appropriately to configure ghc-paths to point back to the wrapper 21 | # instead of to the pristine GHC package, which doesn't know any of the 22 | # additional libraries. 23 | # 24 | # A good way to import the environment set by the wrapper below into 25 | # your shell is to add the following snippet to your ~/.bashrc: 26 | # 27 | # if [ -e ~/.nix-profile/bin/ghc ]; then 28 | # eval $(grep export ~/.nix-profile/bin/ghc) 29 | # fi 30 | 31 | let 32 | isGhcjs = ghc.isGhcjs or false; 33 | isGhcAndroid = ghc.isGhcAndroid or false; 34 | ghc761OrLater = isGhcjs || lib.versionOlder "7.6.1" ghc.version; 35 | packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf"; 36 | ghcCommand = if isGhcjs then "ghcjs" else if isGhcAndroid then "arm-unknown-linux-androideabi-ghc" else "ghc"; 37 | ghcCommandCaps= if isGhcAndroid then "GHC" else lib.toUpper ghcCommand; 38 | libDir = "$out/lib/${ghcCommand}-${ghc.version}"; 39 | docDir = "$out/share/doc/ghc/html"; 40 | packageCfgDir = "${libDir}/package.conf.d"; 41 | paths = lib.filter (x: x ? isHaskellLibrary) (lib.closePropagation packages); 42 | hasLibraries = lib.any (x: x.isHaskellLibrary) paths; 43 | # CLang is needed on Darwin for -fllvm to work: 44 | # https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/code-generators.html 45 | llvm = lib.makeSearchPath "bin" 46 | ([ llvmPackages.llvm ] 47 | ++ lib.optional stdenv.isDarwin llvmPackages.clang); 48 | in 49 | if paths == [] && !withLLVM then ghc else 50 | buildEnv { 51 | inherit (ghc) name; 52 | paths = paths ++ [ghc]; 53 | inherit ignoreCollisions; 54 | postBuild = '' 55 | . ${makeWrapper}/nix-support/setup-hook 56 | 57 | if test -L "$out/bin"; then 58 | binTarget="$(readlink -f "$out/bin")" 59 | rm "$out/bin" 60 | cp -r "$binTarget" "$out/bin" 61 | chmod u+w "$out/bin" 62 | fi 63 | 64 | for prg in ${ghcCommand} ${ghcCommand}i ${ghcCommand}-${ghc.version} ${ghcCommand}i-${ghc.version}; do 65 | if [[ -x "${ghc}/bin/$prg" ]]; then 66 | rm -f $out/bin/$prg 67 | makeWrapper ${ghc}/bin/$prg $out/bin/$prg \ 68 | --add-flags '"-B$NIX_${ghcCommandCaps}_LIBDIR"' \ 69 | --set "NIX_${ghcCommandCaps}" "$out/bin/${ghcCommand}" \ 70 | --set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \ 71 | --set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \ 72 | --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" \ 73 | ${lib.optionalString withLLVM ''--prefix "PATH" ":" "${llvm}"''} 74 | fi 75 | done 76 | 77 | for prg in runghc runhaskell; do 78 | if [[ -x "${ghc}/bin/$prg" ]]; then 79 | rm -f $out/bin/$prg 80 | makeWrapper ${ghc}/bin/$prg $out/bin/$prg \ 81 | --add-flags "-f $out/bin/${ghcCommand}" \ 82 | --set "NIX_${ghcCommandCaps}" "$out/bin/${ghcCommand}" \ 83 | --set "NIX_${ghcCommandCaps}PKG" "$out/bin/${ghcCommand}-pkg" \ 84 | --set "NIX_${ghcCommandCaps}_DOCDIR" "${docDir}" \ 85 | --set "NIX_${ghcCommandCaps}_LIBDIR" "${libDir}" 86 | fi 87 | done 88 | 89 | for prg in ${ghcCommand}-pkg ${ghcCommand}-pkg-${ghc.version}; do 90 | if [[ -x "${ghc}/bin/$prg" ]]; then 91 | rm -f $out/bin/$prg 92 | makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}" 93 | fi 94 | done 95 | 96 | echo "${ghcCommand}-pkg" 97 | ${lib.optionalString hasLibraries "$out/bin/${ghcCommand}-pkg recache"} 98 | $out/bin/${ghcCommand}-pkg check 99 | '' + postBuild; 100 | passthru = { 101 | preferLocalBuild = true; 102 | inherit (ghc) version meta; 103 | inherit haskellPackages; 104 | }; 105 | } 106 | -------------------------------------------------------------------------------- /nixpkgs/top-level/haskell-packages.nix: -------------------------------------------------------------------------------- 1 | { pkgs, callPackage, stdenv }: 2 | 3 | rec { 4 | 5 | lib = import ../development/haskell-modules/lib.nix { inherit pkgs; }; 6 | 7 | compiler = { 8 | ghc742Binary = callPackage ../development/compilers/ghc/7.4.2-binary.nix ({ gmp = pkgs.gmp4; } // stdenv.lib.optionalAttrs stdenv.isDarwin { 9 | libiconv = pkgs.darwin.libiconv; 10 | }); 11 | ghc784 = callPackage ../development/compilers/ghc/7.8.4.nix ({ ghc = compiler.ghc742Binary; } // stdenv.lib.optionalAttrs stdenv.isDarwin { 12 | libiconv = pkgs.darwin.libiconv; 13 | }); 14 | ghc7102 = callPackage ../development/compilers/ghc/7.10.2.nix ({ ghc = compiler.ghc784; inherit (packages.ghc784) hscolour; } // stdenv.lib.optionalAttrs stdenv.isDarwin { 15 | libiconv = pkgs.darwin.libiconv; 16 | }); 17 | ghc-android = callPackage ../../ghc-android.nix { 18 | inherit (pkgs) fetchurl haskell makeWrapper autoconf automake llvm_35 ncurses perl; 19 | #haskell = packages.haskell; 20 | inherit stdenv; 21 | androidndk = pkgs.androidenv.androidndk; 22 | ghc = compiler.ghc784; 23 | }; 24 | }; 25 | 26 | packages = { 27 | 28 | ghc784 = callPackage ../development/haskell-modules { 29 | ghc = compiler.ghc784; 30 | packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-7.8.x.nix { }; 31 | }; 32 | ghc7102 = callPackage ../development/haskell-modules { 33 | ghc = compiler.ghc7102; 34 | packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; 35 | }; 36 | ghc-android = callPackage ../development/haskell-modules { 37 | ghc = compiler.ghc-android; 38 | packageSetConfig = callPackage ../development/haskell-modules/configuration-ghc-android.nix { }; 39 | 40 | }; 41 | 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /no-pthread-android.patch: -------------------------------------------------------------------------------- 1 | diff -rupN a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs 2 | --- a/compiler/main/DriverPipeline.hs 2015-07-21 13:52:50.000000000 +0000 3 | +++ b/compiler/main/DriverPipeline.hs 2015-09-19 20:55:14.159366348 +0000 4 | @@ -1938,7 +1938,7 @@ linkBinary' staticLink dflags o_files de 5 | let os = platformOS (targetPlatform dflags) 6 | in if os == OSOsf3 then ["-lpthread", "-lexc"] 7 | else if os `elem` [OSMinGW32, OSFreeBSD, OSOpenBSD, 8 | - OSNetBSD, OSHaiku, OSQNXNTO, OSiOS, OSDarwin] 9 | + OSNetBSD, OSHaiku, OSQNXNTO, OSiOS, OSDarwin, OSAndroid] 10 | then [] 11 | else ["-lpthread"] 12 | | otherwise = [] 13 | -------------------------------------------------------------------------------- /protobuf.nix: -------------------------------------------------------------------------------- 1 | { protobuf, androidndk, ndkWrapper }: 2 | 3 | protobuf.overrideDerivation (oldAttr: { 4 | name = "protobuf-android"; 5 | configureFlags = [ "--host=arm-linux-androideabi" "--with-protoc=true" ]; 6 | buildInputs = oldAttr.buildInputs ++ [ androidndk ndkWrapper ] ; 7 | 8 | preConfigure = '' 9 | export NDK=${androidndk}/libexec/${androidndk.name}/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64 10 | export NDK_TARGET=arm-linux-androideabi 11 | export CC=${ndkWrapper}/bin/$NDK_TARGET-gcc 12 | export CXX=${ndkWrapper}/bin/$NDK_TARGET-gcc 13 | export CXXFLAGS="-I${androidndk}/libexec/${androidndk.name}/sources/cxx-stl/llvm-libc++/libcxx/include -I${androidndk}/libexec/${androidndk.name}/sources/android/support/include -I${androidndk}/libexec/${androidndk.name}/sources/cxx-stl/llvm-libc++abi/libcxxabi/include -std=c++11 -frtti" 14 | export LD=${ndkWrapper}/bin/$NDK_TARGET-ld 15 | export LDFLAGS="-L${androidndk}/libexec/${androidndk.name}/sources/cxx-stl/llvm-libc++/libs/armeabi -lc++_shared -lm" 16 | export RANLIB=${ndkWrapper}/bin/$NDK_TARGET-gcc-ranlib 17 | export STRIP=${ndkWrapper}/bin/$NDK_TARGET-strip 18 | export NM=${ndkWrapper}/bin/$NDK_TARGET-gcc-nm 19 | export AR=${ndkWrapper}/bin/$NDK_TARGET-gcc-ar 20 | sed -i -e 's|vector<|std::vector<|' src/google/protobuf/descriptor.h 21 | sed -i -e 's|vector<|std::vector<|' src/google/protobuf/extension_set_heavy.cc 22 | sed -i -e 's|vector<|std::vector<|' src/google/protobuf/extension_set.h 23 | sed -i -e 's|vector<|std::vector<|' src/google/protobuf/unknown_field_set.h 24 | sed -i -e 's|vector<|std::vector<|' src/google/protobuf/message.h 25 | ''; 26 | 27 | doCheck = false; 28 | 29 | }) 30 | -------------------------------------------------------------------------------- /protobuf_shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? (import {}) }: 2 | 3 | with pkgs; 4 | 5 | let ndkWrapper = import ./ndk-wrapper.nix { inherit stdenv makeWrapper androidndk; }; 6 | protobuf-android = import ./protobuf.nix { inherit protobuf androidndk ndkWrapper; }; 7 | in protobuf-android.overrideDerivation (oldAttr: { 8 | shellHook = ""; 9 | }) 10 | 11 | -------------------------------------------------------------------------------- /release.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? import {} }: 2 | 3 | with pkgs; 4 | 5 | let haskell-packages = import ./nixpkgs/top-level/haskell-packages.nix { inherit pkgs callPackage stdenv; }; 6 | in { 7 | ghc-android = haskell-packages.compiler.ghc-android; 8 | } 9 | -------------------------------------------------------------------------------- /rts_android_log_write.patch: -------------------------------------------------------------------------------- 1 | diff -rupN a/rts/RtsMessages.c b/rts/RtsMessages.c 2 | --- a/rts/RtsMessages.c 2014-12-23 02:31:10.000000000 +0000 3 | +++ b/rts/RtsMessages.c 2015-10-11 22:25:49.802309919 +0000 4 | @@ -19,6 +19,11 @@ 5 | #include 6 | #endif 7 | 8 | +#ifdef __ANDROID__ 9 | +#include 10 | +#include 11 | +#endif 12 | + 13 | /* ----------------------------------------------------------------------------- 14 | General message generation functions 15 | 16 | @@ -163,6 +168,26 @@ rtsFatalInternalErrorFn(const char *s, v 17 | fflush(stderr); 18 | } 19 | 20 | +#ifdef __ANDROID__ 21 | + { 22 | + /* don't fflush(stdout); WORKAROUND bug in Linux glibc */ 23 | + void* handle = dlopen("liblog.so", RTLD_GLOBAL | RTLD_NOW); 24 | + int (*__android_log_write)(int, const char*, const char*) = dlsym(handle, "__android_log_write"); 25 | + // if (prog_argv != NULL && prog_name != NULL) { 26 | + // char* s1; 27 | + // sprintf(s1, "%s: internal error: ", prog_name); 28 | + // __android_log_write( ANDROID_LOG_ERROR, "ghc-rts", s1); 29 | + // } else { 30 | + // char* s1; 31 | + // sprintf(s1, "internal error: "); 32 | + // __android_log_write( ANDROID_LOG_ERROR, "ghc-rts", s1); 33 | + // } 34 | + char* s2; 35 | + vsprintf(s2, s, ap); 36 | + __android_log_write( ANDROID_LOG_ERROR, "ghc-rts", s2); 37 | + } 38 | +#endif // __ANDROID__ 39 | + 40 | #ifdef TRACING 41 | if (RtsFlags.TraceFlags.tracing == TRACE_EVENTLOG) endEventLogging(); 42 | #endif 43 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | { pkgs ? (import {}) }: 2 | 3 | with pkgs; 4 | 5 | let haskell-packages = import ./nixpkgs/top-level/haskell-packages.nix { inherit pkgs callPackage stdenv; }; 6 | 7 | in haskell-packages.compiler.ghc-android 8 | 9 | -------------------------------------------------------------------------------- /undefine_MYTASK_USE_TLV_for_CC_SUPPORTS_TLS_zero.patch: -------------------------------------------------------------------------------- 1 | diff -rupN a/rts/Task.h b/rts/Task.h 2 | --- a/rts/Task.h 2015-07-21 13:52:50.000000000 +0000 3 | +++ b/rts/Task.h 2015-10-10 07:22:00.005818829 +0000 4 | @@ -259,7 +259,8 @@ extern nat peakWorkerCount; 5 | #if ((defined(linux_HOST_OS) && \ 6 | (defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH))) || \ 7 | (defined(mingw32_HOST_OS) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4)) && \ 8 | - (!defined(llvm_CC_FLAVOR)) 9 | + (!defined(llvm_CC_FLAVOR)) && \ 10 | + (CC_SUPPORTS_TLS == 1) 11 | #define MYTASK_USE_TLV 12 | extern __thread Task *my_task; 13 | #else 14 | -------------------------------------------------------------------------------- /unix-posix-files-imports.patch: -------------------------------------------------------------------------------- 1 | diff -rupN a/libraries/unix/System/Posix/Files/Common.hsc b/libraries/unix/System/Posix/Files/Common.hsc 2 | --- a/libraries/unix/System/Posix/Files/Common.hsc 2014-12-23 02:32:53.000000000 +0000 3 | +++ b/libraries/unix/System/Posix/Files/Common.hsc 2015-09-19 06:17:21.272579604 +0000 4 | @@ -92,6 +92,8 @@ import Data.Bits 5 | import Data.Int 6 | import Data.Ratio 7 | #endif 8 | +import Data.Int 9 | +import Data.Ratio 10 | import Data.Time.Clock.POSIX (POSIXTime) 11 | import System.Posix.Internals 12 | import Foreign.C 13 | -------------------------------------------------------------------------------- /unix-posix_vdisable.patch: -------------------------------------------------------------------------------- 1 | diff -rupN a/libraries/unix/System/Posix/Terminal/Common.hsc b/libraries/unix/System/Posix/Terminal/Common.hsc 2 | --- a/libraries/unix/System/Posix/Terminal/Common.hsc 2014-12-23 02:32:53.000000000 +0000 3 | +++ b/libraries/unix/System/Posix/Terminal/Common.hsc 2015-09-19 04:33:13.765014640 +0000 4 | @@ -262,7 +262,7 @@ controlChar termios cc = unsafePerformIO 5 | withTerminalAttributes termios $ \p -> do 6 | let c_cc = (#ptr struct termios, c_cc) p 7 | val <- peekElemOff c_cc (cc2Word cc) 8 | - if val == ((#const _POSIX_VDISABLE)::CCc) 9 | + if val == ((#const '\0')::CCc) 10 | then return Nothing 11 | else return (Just (chr (fromEnum val))) 12 | 13 | @@ -280,7 +280,7 @@ withoutCC :: TerminalAttributes 14 | withoutCC termios cc = unsafePerformIO $ do 15 | withNewTermios termios $ \p -> do 16 | let c_cc = (#ptr struct termios, c_cc) p 17 | - pokeElemOff c_cc (cc2Word cc) ((#const _POSIX_VDISABLE) :: CCc) 18 | + pokeElemOff c_cc (cc2Word cc) ((#const '\0') :: CCc) 19 | 20 | inputTime :: TerminalAttributes -> Int 21 | inputTime termios = unsafePerformIO $ do 22 | --------------------------------------------------------------------------------