]> Git — Sourcephile - haskell/symantic-parser.git/blob - default.nix
fix cabal metadata
[haskell/symantic-parser.git] / default.nix
1 { pkgs ? import <nixpkgs> {}
2 , ghc ? "ghc901"
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 # Relax upper bound to support ghc-9.0.1
39 /*
40 bifunctors = doJailbreak hsuper.bifunctors;
41 attoparsec = doJailbreak hsuper.attoparsec;
42 assoc = doJailbreak hsuper.assoc;
43 vector-binary-instances = doJailbreak hsuper.vector-binary-instances;
44 vector-th-unbox = doJailbreak hsuper.vector-th-unbox;
45 these = doJailbreak hsuper.these;
46 quickcheck-instances = doJailbreak hsuper.quickcheck-instances;
47 binary-orphans = doJailbreak hsuper.binary-orphans;
48 text-short = doJailbreak hsuper.text-short;
49 aeson = doJailbreak hsuper.aeson;
50 */
51 #HsYAML = doJailbreak hsuper.HsYAML;
52 #gitrev = doJailbreak hsuper.gitrev;
53 #ghc-source-gen = doJailbreak hsuper.ghc-source-gen;
54 data-fix = doJailbreak hsuper.data-fix;
55 primitive = doJailbreak hsuper.primitive;
56 assoc = doJailbreak hsuper.assoc;
57 these = doJailbreak hsuper.these;
58 dump-core = dontCheck (unmarkBroken hsuper.dump-core);
59
60 symantic-parser = enableExecutableProfiling (doCheck (
61 hself.callCabal2nix "symantic-parser" ./. {}));
62 } //
63 packageSourceOverrides {
64 # symantic-parser = ./.;
65 } hself hsuper
66 );
67 in hs.symantic-parser // {
68 shell = hs.shellFor {
69 packages = p: [ p.symantic-parser ];
70 nativeBuildInputs = [
71 pkgs.cabal-install
72 #hs.cabal-install
73 #hs.haskell-language-server
74 #hs.hpc
75 ];
76 buildInputs = [
77 #hs.ghcid
78 #hs.ormolu
79 #hs.hlint
80 #pkgs.nixpkgs-fmt
81 ];
82 inherit withHoogle;
83 };
84 }