]> Git — Sourcephile - haskell/symantic-parser.git/blob - default.nix
Fix infinite loop in observeSharing
[haskell/symantic-parser.git] / default.nix
1 { pkgs ? import <nixpkgs> {}
2 , ghc ? null #"ghc8102"
3 , withHoogle ? false
4 #, symantic-base ? null
5 }:
6 let
7 haskellPackages =
8 if ghc == null
9 then pkgs.haskellPackages
10 else pkgs.haskell.packages.${ghc};
11 hs = haskellPackages.extend (with pkgs.haskell.lib;
12 hself: hsuper: {
13 /*
14 mkDerivation = drv: hsuper.mkDerivation (
15 # There is no much cache for other ghc,
16 # hence build as little as possible.
17 drv // pkgs.lib.optionalAttrs (ghc != null) {
18 enableLibraryProfiling = false;
19 doHaddock = false;
20 doBenchmark = false;
21 doCoverage = false;
22 doHoogle = false;
23 #doCheck = false;
24 # Enable check here so that symantic-parser.getCabalDeps contains testHaskellDepends,
25 # which are needed in the shell to run:
26 # cabal repl --enable-tests symantic-parser-test
27 # Wrapping symantic-parser in a doCheck (hence using overrideCabal) would not work.
28 # And I have no idea why the version suffix must also be included.
29 doCheck = builtins.match "symantic-parser.*" drv.pname != null;
30 }
31 );
32 */
33 symantic-base = hself.callCabal2nix "symantic-base" (pkgs.fetchgit {
34 url = "git://git.sourcephile.fr/haskell/symantic-base";
35 sha256 = "sha256-I636Kl+S93BDX1xrEMQdf217pLeT6FeF4BBpj83sEgQ=";
36 }) {};
37 symantic-parser = enableExecutableProfiling (doCheck (hself.callCabal2nix "symantic-parser" ./. {}));
38 } //
39 packageSourceOverrides {
40 # symantic-parser = ./.;
41 } hself hsuper
42 );
43 in hs.symantic-parser // {
44 shell = hs.shellFor {
45 packages = p: [ p.symantic-parser ];
46 nativeBuildInputs = [
47 hs.cabal-install
48 hs.haskell-language-server
49 hs.hpc
50 ];
51 buildInputs = [
52 #hs.ghcid
53 #hs.ormolu
54 hs.hlint
55 #pkgs.nixpkgs-fmt
56 ];
57 inherit withHoogle;
58 };
59 }