summary refs log tree commit diff
path: root/pkgs/applications/editors/emacs-modes/melpa-packages.nix
blob: 7f8ac548653e57a3dbdc9ecf697e23fc1c7ebd61 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
/*

# Updating

To update the list of packages from MELPA,

1. Run ./update-melpa
2. Check for evaluation errors:
env NIXPKGS_ALLOW_BROKEN=1 nix-instantiate --show-trace ../../../../ -A emacsPackagesNg.melpaStablePackages
env NIXPKGS_ALLOW_BROKEN=1 nix-instantiate --show-trace ../../../../ -A emacsPackagesNg.melpaPackages
3. `git commit -m "melpa-packages: $(date -Idate)" recipes-archive-melpa.json`

*/

{ lib, external }:

self:

  let
    inherit (import ./libgenerated.nix lib self) melpaDerivation;
    imported = lib.listToAttrs (map (melpaDerivation "unstable")
                                    (lib.importJSON ./recipes-archive-melpa.json));
    super = builtins.removeAttrs imported [
      "swbuff-x" # required dependency swbuff is missing
    ];

    dontConfigure = pkg: pkg.override (args: {
      melpaBuild = drv: args.melpaBuild (drv // {
        configureScript = "true";
      });
    });

    markBroken = pkg: pkg.override (args: {
      melpaBuild = drv: args.melpaBuild (drv // {
        meta = (drv.meta or {}) // { broken = true; };
      });
    });

    overrides = {
      # Expects bash to be at /bin/bash
      ac-rtags = markBroken super.ac-rtags;

      # upstream issue: mismatched filename
      ack-menu = markBroken super.ack-menu;

      airline-themes = super.airline-themes.override {
        inherit (self.melpaPackages) powerline;
      };

      # upstream issue: missing file header
      bufshow = markBroken super.bufshow;

      # part of a larger package
      caml = dontConfigure super.caml;

      # Expects bash to be at /bin/bash
      company-rtags = markBroken super.company-rtags;

      easy-kill-extras = super.easy-kill-extras.override {
        inherit (self.melpaPackages) easy-kill;
      };

      editorconfig = super.editorconfig.overrideAttrs (attrs: {
        propagatedUserEnvPkgs = [ external.editorconfig-core-c ];
      });

      egg = super.egg.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      # upstream issue: missing file header
      elmine = markBroken super.elmine;

      ess-R-data-view = super.ess-R-data-view.override {
        inherit (self.melpaPackages) ess ctable popup;
      };

      evil-magit = super.evil-magit.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      # missing dependencies
      evil-search-highlight-persist = super.evil-search-highlight-persist.overrideAttrs (attrs: {
        packageRequires = with self; [ evil highlight ];
      });

      # Expects bash to be at /bin/bash
      flycheck-rtags = markBroken super.flycheck-rtags;

      forge = super.forge.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      # build timeout
      graphene = markBroken super.graphene;

      # upstream issue: mismatched filename
      helm-lobsters = markBroken super.helm-lobsters;

      # Expects bash to be at /bin/bash
      helm-rtags = markBroken super.helm-rtags;

      # Build same version as Haskell package
      hindent = super.hindent.overrideAttrs (attrs: {
        version = external.hindent.version;
        src = external.hindent.src;
        packageRequires = [ self.haskell-mode ];
        propagatedUserEnvPkgs = [ external.hindent ];
      });

      # upstream issue: missing file header
      ido-complete-space-or-hyphen = markBroken super.ido-complete-space-or-hyphen;

      # upstream issue: missing file header
      initsplit = super.initsplit;

      # tries to write a log file to $HOME
      insert-shebang = super.insert-shebang.overrideAttrs (attrs: {
        HOME = "/tmp";
      });

      # Expects bash to be at /bin/bash
      ivy-rtags = markBroken super.ivy-rtags;

      # upstream issue: missing file header
      jsfmt = markBroken super.jsfmt;

      kubernetes = super.kubernetes.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      # upstream issue: missing file header
      maxframe = markBroken super.maxframe;

      magit =
        super.magit.overrideAttrs (attrs: {
          # searches for Git at build time
          nativeBuildInputs =
            (attrs.nativeBuildInputs or []) ++ [ external.git ];
        });

      magit-annex = super.magit-annex.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      magit-gitflow = super.magit-gitflow.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      magithub = super.magithub.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      magit-svn = super.magit-svn.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      magit-todos = super.magit-todos.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      magit-filenotify = super.magit-filenotify.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      mhc = super.mhc.override {
        inherit (self.melpaPackages) calfw;
      };

      # missing .NET
      nemerle = markBroken super.nemerle;

      # part of a larger package
      notmuch = dontConfigure super.notmuch;

      # missing OCaml
      ocp-indent = markBroken super.ocp-indent;

      orgit =
        (super.orgit.overrideAttrs (attrs: {
          # searches for Git at build time
          nativeBuildInputs =
            (attrs.nativeBuildInputs or []) ++ [ external.git ];
         }));

      # tries to write to $HOME
      php-auto-yasnippets = super.php-auto-yasnippets.overrideAttrs (attrs: {
        HOME = "/tmp";
      });

      # upstream issue: mismatched filename
      processing-snippets = markBroken super.processing-snippets;

      # upstream issue: missing file header
      qiita = markBroken super.qiita;

      racer = super.racer.overrideAttrs (attrs: {
        postPatch = attrs.postPatch or "" + ''
          substituteInPlace racer.el \
            --replace /usr/local/src/rust/src ${external.rustPlatform.rustcSrc}
        '';
      });

      # upstream issue: missing file footer
      seoul256-theme = markBroken super.seoul256-theme;

      spaceline = super.spaceline.override {
        inherit (self.melpaPackages) powerline;
      };

      # upstream issue: missing file header
      speech-tagger = markBroken super.speech-tagger;

      # upstream issue: missing file header
      stgit = markBroken super.stgit;

      # upstream issue: missing file header
      tawny-mode = markBroken super.tawny-mode;

      # upstream issue: missing file header
      textmate = markBroken super.textmate;

      treemacs-magit = super.treemacs-magit.overrideAttrs (attrs: {
        # searches for Git at build time
        nativeBuildInputs =
          (attrs.nativeBuildInputs or []) ++ [ external.git ];
      });

      # missing OCaml
      utop = markBroken super.utop;

      vdiff-magit =
        (super.vdiff-magit.overrideAttrs (attrs: {
          nativeBuildInputs =
            (attrs.nativeBuildInputs or []) ++ [ external.git ];
        }));

      # upstream issue: missing file header
      voca-builder = markBroken super.voca-builder;

      # upstream issue: missing file header
      window-numbering = markBroken super.window-numbering;

      w3m = super.w3m.override (args: {
        melpaBuild = drv: args.melpaBuild (drv // {
          prePatch =
            let w3m = "${lib.getBin external.w3m}/bin/w3m"; in ''
              substituteInPlace w3m.el \
                --replace 'defcustom w3m-command nil' \
                          'defcustom w3m-command "${w3m}"'
            '';
        });
      });

      # Map legacy renames from emacs2nix since code generation was ported to emacs lisp
      _0blayout = super."0blayout";
      _0xc = super."0xc";
      _2048-game = super."2048-game";
      _4clojure = super."4clojure";
      at = super."@";
      desktop-plus = super."desktop+";
      # filesets-plus = super."filesets+";
      ghub-plus = super."ghub+";
      git-gutter-plus = super."git-gutter+";
      git-gutter-fringe-plus = super."git-gutter-fringe+";
      ido-completing-read-plus = super."ido-completing-read+";
      image-plus = super."image+";
      image-dired-plus = super."image-dired+";
      markdown-mode-plus = super."markdown-mode+";
      package-plus = super."package+";
      rect-plus = super."rect+";
      term-plus = super."term+";
      term-plus-key-intercept = super."term+key-intercept";
      term-plus-mux = super."term+mux";
      xml-plus = super."xml+";

    };

    melpaPackages =
      removeAttrs (super // overrides)
      [
        "show-marks"  # missing dependency: fm
        "lenlen-theme"  # missing dependency: color-theme-solarized
      ];
  in
    melpaPackages // { inherit melpaPackages; }