2016-11-18 16:38:04 +01:00
|
|
|
|
# GHCJS package fixes
|
|
|
|
|
#
|
|
|
|
|
# Please insert new packages *alphabetically*
|
|
|
|
|
# in the OTHER PACKAGES section.
|
2017-08-01 18:44:08 +02:00
|
|
|
|
{ pkgs, haskellLib }:
|
2015-01-07 20:31:32 +01:00
|
|
|
|
|
2016-01-24 23:12:03 +01:00
|
|
|
|
let
|
|
|
|
|
removeLibraryHaskellDepends = pnames: depends:
|
|
|
|
|
builtins.filter (e: !(builtins.elem (e.pname or "") pnames)) depends;
|
|
|
|
|
in
|
|
|
|
|
|
2017-08-01 18:44:08 +02:00
|
|
|
|
with haskellLib;
|
2015-01-07 20:31:32 +01:00
|
|
|
|
|
2016-02-18 04:07:32 +01:00
|
|
|
|
self: super:
|
2016-07-27 20:28:31 +02:00
|
|
|
|
|
2016-11-18 16:38:04 +01:00
|
|
|
|
## GENERAL SETUP BASE PACKAGES
|
|
|
|
|
|
2016-07-27 20:28:31 +02:00
|
|
|
|
let # The stage 1 packages
|
|
|
|
|
stage1 = pkgs.lib.genAttrs super.ghc.stage1Packages (pkg: null);
|
|
|
|
|
# The stage 2 packages. Regenerate with ../compilers/ghcjs/gen-stage2.rb
|
|
|
|
|
stage2 = super.ghc.mkStage2 {
|
|
|
|
|
inherit (self) callPackage;
|
|
|
|
|
};
|
|
|
|
|
in stage1 // stage2 // {
|
2016-02-18 04:07:32 +01:00
|
|
|
|
|
|
|
|
|
old-time = overrideCabal stage2.old-time (drv: {
|
|
|
|
|
postPatch = ''
|
|
|
|
|
${pkgs.autoconf}/bin/autoreconf --install --force --verbose
|
|
|
|
|
'';
|
2016-02-24 22:33:07 +01:00
|
|
|
|
buildTools = pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.libiconv;
|
2016-02-18 04:07:32 +01:00
|
|
|
|
});
|
|
|
|
|
|
2016-02-24 22:33:07 +01:00
|
|
|
|
network = addBuildTools super.network (pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.libiconv);
|
|
|
|
|
zlib = addBuildTools super.zlib (pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.libiconv);
|
2016-03-15 05:07:59 +01:00
|
|
|
|
unix-compat = addBuildTools super.unix-compat (pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.libiconv);
|
2016-02-24 22:33:07 +01:00
|
|
|
|
|
2015-03-09 20:11:23 +01:00
|
|
|
|
# LLVM is not supported on this GHC; use the latest one.
|
|
|
|
|
inherit (pkgs) llvmPackages;
|
|
|
|
|
|
2016-03-05 21:39:29 +01:00
|
|
|
|
inherit (self.ghc.bootPkgs)
|
|
|
|
|
jailbreak-cabal alex happy gtk2hs-buildtools rehoo hoogle;
|
2015-03-13 04:20:56 +01:00
|
|
|
|
|
2016-02-19 00:15:14 +01:00
|
|
|
|
# Don't set integer-simple to null!
|
|
|
|
|
# GHCJS uses integer-gmp, so any package expression that depends on
|
|
|
|
|
# integer-simple is wrong.
|
|
|
|
|
#integer-simple = null;
|
2015-01-07 20:31:32 +01:00
|
|
|
|
|
2015-10-16 15:12:27 +02:00
|
|
|
|
# These packages are core libraries in GHC 7.10.x, but not here.
|
|
|
|
|
bin-package-db = null;
|
2017-03-05 16:36:47 +01:00
|
|
|
|
haskeline = self.haskeline_0_7_3_1;
|
2016-01-24 19:27:41 +01:00
|
|
|
|
hoopl = self.hoopl_3_10_2_1;
|
2015-10-16 15:12:27 +02:00
|
|
|
|
hpc = self.hpc_0_6_0_2;
|
2017-03-05 16:36:47 +01:00
|
|
|
|
terminfo = self.terminfo_0_4_0_2;
|
2015-10-16 15:12:27 +02:00
|
|
|
|
xhtml = self.xhtml_3000_2_1;
|
|
|
|
|
|
2016-11-18 16:38:04 +01:00
|
|
|
|
## OTHER PACKAGES
|
|
|
|
|
|
2017-10-23 19:17:40 +02:00
|
|
|
|
# haddock throws the error: No input file(s).
|
|
|
|
|
fail = dontHaddock super.fail;
|
|
|
|
|
|
2016-11-18 16:38:04 +01:00
|
|
|
|
cereal = addBuildDepend super.cereal [ self.fail ];
|
|
|
|
|
|
|
|
|
|
entropy = overrideCabal super.entropy (old: {
|
|
|
|
|
postPatch = old.postPatch or "" + ''
|
|
|
|
|
# cabal doesn’t find ghc in this script, since it’s in the bootPkgs
|
|
|
|
|
sed -e '/Simple.Program/a import Distribution.Simple.Program.Types' \
|
|
|
|
|
-e 's|mConf.*=.*$|mConf = Just $ simpleConfiguredProgram "ghc" (FoundOnSystem "${self.ghc.bootPkgs.ghc}/bin/ghc")|g' -i Setup.hs
|
|
|
|
|
'';
|
2015-03-13 04:20:56 +01:00
|
|
|
|
});
|
|
|
|
|
|
2016-11-18 16:38:04 +01:00
|
|
|
|
# https://github.com/kazu-yamamoto/logger/issues/97
|
|
|
|
|
fast-logger = overrideCabal super.fast-logger (old: {
|
|
|
|
|
postPatch = old.postPatch or "" + ''
|
|
|
|
|
# remove the Safe extensions, since ghcjs-boot directory
|
|
|
|
|
# doesn’t provide Trustworthy
|
|
|
|
|
sed -ie '/LANGUAGE Safe/d' System/Log/FastLogger/*.hs
|
|
|
|
|
cat System/Log/FastLogger/Date.hs
|
2015-03-13 04:20:56 +01:00
|
|
|
|
'';
|
|
|
|
|
});
|
|
|
|
|
|
2016-12-06 23:24:42 +01:00
|
|
|
|
# experimental
|
2016-02-01 08:13:45 +01:00
|
|
|
|
ghcjs-ffiqq = self.callPackage
|
|
|
|
|
({ mkDerivation, base, template-haskell, ghcjs-base, split, containers, text, ghc-prim
|
|
|
|
|
}:
|
|
|
|
|
mkDerivation {
|
|
|
|
|
pname = "ghcjs-ffiqq";
|
|
|
|
|
version = "0.1.0.0";
|
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
|
owner = "ghcjs";
|
|
|
|
|
repo = "ghcjs-ffiqq";
|
2016-12-06 23:24:42 +01:00
|
|
|
|
rev = "b52338c2dcd3b0707bc8aff2e171411614d4aedb";
|
|
|
|
|
sha256 = "08zxfm1i6zb7n8vbz3dywdy67vkixfyw48580rwfp48rl1s2z1c7";
|
2016-02-01 08:13:45 +01:00
|
|
|
|
};
|
|
|
|
|
libraryHaskellDepends = [
|
|
|
|
|
base template-haskell ghcjs-base split containers text ghc-prim
|
|
|
|
|
];
|
|
|
|
|
description = "FFI QuasiQuoter for GHCJS";
|
2016-12-06 23:24:42 +01:00
|
|
|
|
license = pkgs.stdenv.lib.licenses.mit;
|
2016-02-01 08:13:45 +01:00
|
|
|
|
}) {};
|
2016-12-06 23:24:42 +01:00
|
|
|
|
# experimental
|
|
|
|
|
ghcjs-vdom = self.callPackage
|
|
|
|
|
({ mkDerivation, base, ghc-prim, ghcjs-ffiqq, ghcjs-base, ghcjs-prim
|
|
|
|
|
, containers, split, template-haskell
|
|
|
|
|
}:
|
|
|
|
|
mkDerivation rec {
|
|
|
|
|
pname = "ghcjs-vdom";
|
|
|
|
|
version = "0.2.0.0";
|
|
|
|
|
src = pkgs.fetchFromGitHub {
|
|
|
|
|
owner = "ghcjs";
|
|
|
|
|
repo = pname;
|
|
|
|
|
rev = "1c1175ba22eca6d7efa96f42a72290ade193c148";
|
|
|
|
|
sha256 = "0c6l1dk2anvz94yy5qblrfh2iv495rjq4qmhlycc24dvd02f7n9m";
|
|
|
|
|
};
|
|
|
|
|
libraryHaskellDepends = [
|
|
|
|
|
base ghc-prim ghcjs-ffiqq ghcjs-base ghcjs-prim containers split
|
|
|
|
|
template-haskell
|
|
|
|
|
];
|
|
|
|
|
license = pkgs.stdenv.lib.licenses.mit;
|
|
|
|
|
description = "bindings for https://github.com/Matt-Esch/virtual-dom";
|
|
|
|
|
inherit (src) homepage;
|
|
|
|
|
}) {};
|
2016-02-01 08:13:45 +01:00
|
|
|
|
|
2015-04-09 21:00:52 +02:00
|
|
|
|
ghcjs-dom = overrideCabal super.ghcjs-dom (drv: {
|
2016-11-21 20:51:59 +01:00
|
|
|
|
libraryHaskellDepends = with self; [
|
|
|
|
|
ghcjs-base ghcjs-dom-jsffi text transformers
|
|
|
|
|
];
|
|
|
|
|
configureFlags = [ "-fjsffi" "-f-webkit" ];
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ghcjs-dom-jsffi = overrideCabal super.ghcjs-dom-jsffi (drv: {
|
2017-03-07 20:45:22 +01:00
|
|
|
|
setupHaskellDepends = (drv.setupHaskellDepends or []) ++ [ self.Cabal_1_24_2_0 ];
|
|
|
|
|
libraryHaskellDepends = (drv.libraryHaskellDepends or []) ++ [ self.ghcjs-base self.text ];
|
2016-11-21 20:51:59 +01:00
|
|
|
|
isLibrary = true;
|
2015-04-09 21:00:52 +02:00
|
|
|
|
});
|
2015-03-31 15:30:28 +02:00
|
|
|
|
|
2015-05-06 21:56:02 +02:00
|
|
|
|
ghc-paths = overrideCabal super.ghc-paths (drv: {
|
2015-08-05 21:48:18 +02:00
|
|
|
|
patches = [ ./patches/ghc-paths-nix-ghcjs.patch ];
|
2015-05-06 21:56:02 +02:00
|
|
|
|
});
|
|
|
|
|
|
2016-11-18 16:38:04 +01:00
|
|
|
|
http2 = addBuildDepends super.http2 [ self.aeson self.aeson-pretty self.hex self.unordered-containers self.vector self.word8 ];
|
|
|
|
|
# ghcjsBoot uses async 2.0.1.6, protolude wants 2.1.*
|
|
|
|
|
|
2017-07-12 16:27:03 +02:00
|
|
|
|
# These are the correct dependencies specified when calling `cabal2nix --compiler ghcjs`
|
|
|
|
|
# By default, the `miso` derivation present in hackage-packages.nix
|
|
|
|
|
# does not contain dependencies suitable for ghcjs
|
|
|
|
|
miso = overrideCabal super.miso (drv: {
|
|
|
|
|
libraryHaskellDepends = with self; [
|
|
|
|
|
BoundedChan bytestring containers ghcjs-base aeson base
|
|
|
|
|
http-api-data http-types network-uri scientific servant text
|
|
|
|
|
transformers unordered-containers vector
|
|
|
|
|
];
|
|
|
|
|
});
|
|
|
|
|
|
2016-11-18 16:38:04 +01:00
|
|
|
|
pqueue = overrideCabal super.pqueue (drv: {
|
|
|
|
|
postPatch = ''
|
|
|
|
|
sed -i -e '12s|null|Data.PQueue.Internals.null|' Data/PQueue/Internals.hs
|
|
|
|
|
sed -i -e '64s|null|Data.PQueue.Internals.null|' Data/PQueue/Internals.hs
|
|
|
|
|
sed -i -e '32s|null|Data.PQueue.Internals.null|' Data/PQueue/Min.hs
|
|
|
|
|
sed -i -e '32s|null|Data.PQueue.Max.null|' Data/PQueue/Max.hs
|
|
|
|
|
sed -i -e '42s|null|Data.PQueue.Prio.Internals.null|' Data/PQueue/Prio/Min.hs
|
|
|
|
|
sed -i -e '42s|null|Data.PQueue.Prio.Max.null|' Data/PQueue/Prio/Max.hs
|
|
|
|
|
'';
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
profunctors = overrideCabal super.profunctors (drv: {
|
|
|
|
|
preConfigure = ''
|
|
|
|
|
sed -i 's/^{-# ANN .* #-}//' src/Data/Profunctor/Unsafe.hs
|
|
|
|
|
'';
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
protolude = doJailbreak super.protolude;
|
|
|
|
|
|
2015-09-24 21:11:29 +02:00
|
|
|
|
# reflex 0.3, made compatible with the newest GHCJS.
|
|
|
|
|
reflex = overrideCabal super.reflex (drv: {
|
|
|
|
|
src = pkgs.fetchFromGitHub {
|
2016-01-24 23:12:03 +01:00
|
|
|
|
owner = "ryantrinkle";
|
2015-09-24 21:11:29 +02:00
|
|
|
|
repo = "reflex";
|
2016-01-24 23:12:03 +01:00
|
|
|
|
rev = "cc62c11a6cde31412582758c236919d4bb766ada";
|
|
|
|
|
sha256 = "1j4vw0636bkl46lj8ry16i04vgpivjc6bs3ls54ppp1wfp63q7w4";
|
2015-09-24 21:11:29 +02:00
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
# reflex-dom 0.2, made compatible with the newest GHCJS.
|
2015-05-08 21:50:48 +02:00
|
|
|
|
reflex-dom = overrideCabal super.reflex-dom (drv: {
|
2015-09-24 21:11:29 +02:00
|
|
|
|
src = pkgs.fetchFromGitHub {
|
2016-01-24 23:12:03 +01:00
|
|
|
|
owner = "ryantrinkle";
|
2015-09-24 21:11:29 +02:00
|
|
|
|
repo = "reflex-dom";
|
2016-01-24 23:12:03 +01:00
|
|
|
|
rev = "639d9ca13c2def075e83344c9afca6eafaf24219";
|
|
|
|
|
sha256 = "0166ihbh3dbfjiym9w561svpgvj0x4i8i8ws70xaafi0cmpsxrar";
|
2015-09-24 21:11:29 +02:00
|
|
|
|
};
|
2016-01-24 23:12:03 +01:00
|
|
|
|
libraryHaskellDepends =
|
|
|
|
|
removeLibraryHaskellDepends [
|
|
|
|
|
"glib" "gtk3" "webkitgtk3" "webkitgtk3-javascriptcore" "raw-strings-qq" "unix"
|
|
|
|
|
] drv.libraryHaskellDepends;
|
2015-09-24 21:11:29 +02:00
|
|
|
|
});
|
|
|
|
|
|
2016-11-18 16:38:04 +01:00
|
|
|
|
transformers-compat = overrideCabal super.transformers-compat (drv: {
|
|
|
|
|
configureFlags = [];
|
2016-11-18 16:17:14 +01:00
|
|
|
|
});
|
|
|
|
|
|
2016-11-21 20:51:59 +01:00
|
|
|
|
# triggers an internal pattern match failure in haddock
|
|
|
|
|
# https://github.com/haskell/haddock/issues/553
|
|
|
|
|
wai = dontHaddock super.wai;
|
2015-01-07 20:31:32 +01:00
|
|
|
|
}
|