about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/elm/packages/ghc8_10/default.nix
blob: f68e582b3d0b900dff332b5a054fddcc9da641c9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{ pkgs, lib }:

self: pkgs.haskell.packages.ghc810.override {
  overrides = self: super: with pkgs.haskell.lib.compose; with lib;
    let
      elmPkgs = rec {
        elmi-to-json = justStaticExecutables (overrideCabal
          (drv: {
            version = "unstable-2021-07-19";
            src = pkgs.fetchgit {
              url = "https://github.com/stoeffel/elmi-to-json";
              sha256 = "0vy678k15rzpsn0aly90fb01pxsbqkgf86pa86w0gd94lka8acwl";
              rev = "6a42376ef4b6877e130971faf964578cc096e29b";
              fetchSubmodules = true;
            };

            prePatch = ''
              substituteInPlace package.yaml --replace "- -Werror" ""
              hpack
            '';
            jailbreak = true;

            description = "Tool that reads .elmi files (Elm interface file) generated by the elm compiler";
            homepage = "https://github.com/stoeffel/elmi-to-json";
            license = licenses.bsd3;
            maintainers = [ maintainers.turbomack ];
          })
          (self.callPackage ./elmi-to-json { }));

        elm-instrument = justStaticExecutables (overrideCabal
          (drv: {
            version = "unstable-2020-03-16";
            src = pkgs.fetchgit {
              url = "https://github.com/zwilias/elm-instrument";
              sha256 = "167d7l2547zxdj7i60r6vazznd9ichwc0bqckh3vrh46glkz06jv";
              rev = "63e15bb5ec5f812e248e61b6944189fa4a0aee4e";
              fetchSubmodules = true;
            };
            patches = [
              # Update code after breaking change in optparse-applicative
              # https://github.com/zwilias/elm-instrument/pull/5
              (pkgs.fetchpatch {
                name = "update-optparse-applicative.patch";
                url = "https://github.com/mdevlamynck/elm-instrument/commit/c548709d4818aeef315528e842eaf4c5b34b59b4.patch";
                sha256 = "0ln7ik09n3r3hk7jmwwm46kz660mvxfa71120rkbbaib2falfhsc";
              })
            ];

            prePatch = ''
              sed "s/desc <-.*/let desc = \"${drv.version}\"/g" Setup.hs --in-place
            '';
            jailbreak = true;
            # Tests are failing because of missing instances for Eq and Show type classes
            doCheck = false;

            description = "Instrument Elm code as a preprocessing step for elm-coverage";
            homepage = "https://github.com/zwilias/elm-instrument";
            license = licenses.bsd3;
            maintainers = [ maintainers.turbomack ];
          })
          (self.callPackage ./elm-instrument { }));
      };
    in
    elmPkgs // {
      inherit elmPkgs;

      # We need attoparsec < 0.14 to build elm for now
      attoparsec = self.attoparsec_0_13_2_5;

      # aeson 2.0.3.0 does not build with attoparsec_0_13_2_5
      aeson = doJailbreak self.aeson_1_5_6_0;

      # elm-instrument needs this
      indents = self.callPackage ./indents { };

      # elm-instrument's tests depend on an old version of elm-format, but we set doCheck to false for other reasons above
      elm-format = null;
    };
}