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