From 17c5ca9018619d819c48e25add78f47d7d575611 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Sat, 18 Feb 2017 14:33:26 +0100 Subject: [PATCH] haskell: add nix-specific fixes for various packages in stackage With these overrides, nearly all of the stackage packages in the latest stackage release should compile now. --- .../haskell-modules/configuration-common.nix | 27 +-------- .../haskell-modules/configuration-nix.nix | 60 ++++++++++++++++++- 2 files changed, 61 insertions(+), 26 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 0a0c7ee0644b..f6c677f0bd09 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -41,6 +41,8 @@ self: super: { nanospec = dontCheck super.nanospec; options = dontCheck super.options; statistics = dontCheck super.statistics; + + # segfault due to missing return: https://github.com/haskell/c2hs/pull/184 c2hs = dontCheck super.c2hs; # This test keeps being aborted because it runs too quietly for too long @@ -228,7 +230,6 @@ self: super: { wai-middleware-hmac = dontCheck super.wai-middleware-hmac; xkbcommon = dontCheck super.xkbcommon; xmlgen = dontCheck super.xmlgen; - hapistrano = dontCheck super.hapistrano; HerbiePlugin = dontCheck super.HerbiePlugin; wai-cors = dontCheck super.wai-cors; @@ -278,7 +279,6 @@ self: super: { dotfs = dontCheck super.dotfs; # http://hydra.cryp.to/build/498599/log/raw DRBG = dontCheck super.DRBG; # http://hydra.cryp.to/build/498245/nixlog/1/raw ed25519 = dontCheck super.ed25519; - either-unwrap = dontCheck super.either-unwrap; # http://hydra.cryp.to/build/498782/log/raw etcd = dontCheck super.etcd; fb = dontCheck super.fb; # needs credentials for Facebook fptest = dontCheck super.fptest; # http://hydra.cryp.to/build/499124/log/raw @@ -307,7 +307,6 @@ self: super: { hi = dontCheck super.hi; hierarchical-clustering = dontCheck super.hierarchical-clustering; hmatrix-tests = dontCheck super.hmatrix-tests; - hPDB-examples = dontCheck super.hPDB-examples; hquery = dontCheck super.hquery; hs2048 = dontCheck super.hs2048; hsbencher = dontCheck super.hsbencher; @@ -427,9 +426,6 @@ self: super: { # https://github.com/NixOS/nixpkgs/issues/6350 paypal-adaptive-hoops = overrideCabal super.paypal-adaptive-hoops (drv: { testTarget = "local"; }); - # https://github.com/afcowie/http-streams/issues/80 - http-streams = dontCheck super.http-streams; - # https://github.com/vincenthz/hs-asn1/issues/12 asn1-encoding = dontCheck super.asn1-encoding; @@ -451,9 +447,6 @@ self: super: { apiary-session = dontCheck super.apiary-session; apiary-websockets = dontCheck super.apiary-websockets; - # https://github.com/alephcloud/hs-configuration-tools/issues/40 - configuration-tools = dontCheck super.configuration-tools; - # HsColour: Language/Unlambda.hs: hGetContents: invalid argument (invalid byte sequence) unlambda = dontHyperlinkSource super.unlambda; @@ -695,13 +688,6 @@ self: super: { cairo = addBuildTool super.cairo self.gtk2hs-buildtools; pango = disableHardening (addBuildTool super.pango self.gtk2hs-buildtools) ["fortify"]; - # Fix tests which would otherwise fail with "Couldn't launch intero process." - intero = overrideCabal super.intero (drv: { - postPatch = (drv.postPatch or "") + '' - substituteInPlace src/test/Main.hs --replace "\"intero\"" "\"$PWD/dist/build/intero/intero\"" - ''; - }); - # https://github.com/commercialhaskell/stack/issues/3001 stack = doJailbreak super.stack; @@ -736,14 +722,7 @@ self: super: { }); # test suite cannot find its own "idris" binary - idris = overrideCabal super.idris (drv: { - # "idris" binary cannot find Idris library otherwise while building. After - # installing it's completely fine though. This seems like a bug in Idris - # that's related to builds with shared libraries enabled. It would be great - # if someone who knows a thing or two about Idris could look into this. - preBuild = "export LD_LIBRARY_PATH=$PWD/dist/build:$LD_LIBRARY_PATH"; - doCheck = false; - }); + idris = dontCheck super.idris; # https://github.com/bos/math-functions/issues/25 math-functions = dontCheck super.math-functions; diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index bd74e0e6e04d..c62d2702b44e 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -167,6 +167,13 @@ self: super: builtins.intersectAttrs super { http-client-tls = dontCheck super.http-client-tls; http-conduit = dontCheck super.http-conduit; transient-universe = dontCheck super.transient-universe; + typed-process = dontCheck super.typed-process; + js-jquery = dontCheck super.js-jquery; + hPDB-examples = dontCheck super.hPDB-examples; + configuration-tools = dontCheck super.configuration-tools; # https://github.com/alephcloud/hs-configuration-tools/issues/40 + tcp-streams = dontCheck super.tcp-streams; + holy-project = dontCheck super.holy-project; + mustache = dontCheck super.mustache; # Tries to mess with extended POSIX attributes, but can't in our chroot environment. xattr = dontCheck super.xattr; @@ -378,13 +385,62 @@ self: super: builtins.intersectAttrs super { idris = overrideCabal super.idris (drv: { # https://github.com/idris-lang/Idris-dev/issues/2499 librarySystemDepends = (drv.librarySystemDepends or []) ++ [pkgs.gmp]; + + # tests and build run executable, so need to set LD_LIBRARY_PATH + preBuild = '' + export LD_LIBRARY_PATH="$PWD/dist/build:$LD_LIBRARY_PATH" + ''; }); libsystemd-journal = overrideCabal super.libsystemd-journal (old: { librarySystemDepends = old.librarySystemDepends or [] ++ [ pkgs.systemd ]; }); - # Needs network in tests. - typed-process = dontCheck super.typed-process; + # does not specify tests in cabal file, instead has custom runTest cabal hook, + # so cabal2nix will not detect test dependencies. + either-unwrap = overrideCabal super.either-unwrap (drv: { + testHaskellDepends = (drv.testHaskellDepends or []) ++ [ self.test-framework self.test-framework-hunit ]; + }); + hidapi = addExtraLibrary super.hidapi pkgs.libudev; + + hs-GeoIP = super.hs-GeoIP.override { GeoIP = pkgs.geoipWithDatabase; }; + + discount = super.discount.override { markdown = pkgs.discount; }; + + # tests require working stack installation with all-cabal-hashes cloned in $HOME + stackage-curator = dontCheck super.stackage-curator; + + # hardcodes /usr/bin/tr: https://github.com/snapframework/io-streams/pull/59 + io-streams = enableCabalFlag super.io-streams "NoInteractiveTests"; + + # requires autotools to build + secp256k1 = addBuildTools super.secp256k1 [ pkgs.autoconf pkgs.automake pkgs.libtool ]; + + # tests require git + hapistrano = addBuildTool super.hapistrano pkgs.git; + + # requires webkitgtk API version 3 (webkitgtk 2.4 is the latest webkit supporting that version) + gi-javascriptcore = super.gi-javascriptcore.override { webkitgtk = pkgs.webkitgtk24x; }; + gi-webkit = super.gi-webkit.override { webkit = pkgs.webkitgtk24x; }; + + # requires valid, writeable $HOME + hatex-guide = overrideCabal super.hatex-guide (drv: { + preConfigure = '' + ${drv.preConfigure or ""} + export HOME=$PWD + ''; + }); + + # Fails to link against with newer gsl versions because a deprecrated function + # was removed + hmatrix-gsl = super.hmatrix-gsl.override { gsl = pkgs.gsl_1; }; + + # tests run executable, relying on PATH + # without this, tests fail with "Couldn't launch intero process" + intero = overrideCabal super.intero (drv: { + preCheck = '' + export PATH="$PWD/dist/build/intero:$PATH" + ''; + }); }