melpa-packages: Add ability to ovveride melpa JSON archive location

This enables using the melpa json generator in an overlay
This commit is contained in:
adisbladis 2019-08-03 20:48:11 +01:00
parent 8911226971
commit 47d3b98b4b
No known key found for this signature in database
GPG Key ID: 110BFAD44C6249B7
3 changed files with 302 additions and 487 deletions

View File

@ -12,37 +12,34 @@ env NIXPKGS_ALLOW_BROKEN=1 nix-instantiate --show-trace ../../../../ -A emacsPac
*/
{ lib, external }:
{ lib, external }: variant: self: let
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: {
dontConfigure = pkg: if pkg != null then pkg.override (args: {
melpaBuild = drv: args.melpaBuild (drv // {
configureScript = "true";
});
});
}) else null;
markBroken = pkg: pkg.override (args: {
markBroken = pkg: if pkg != null then pkg.override (args: {
melpaBuild = drv: args.melpaBuild (drv // {
meta = (drv.meta or {}) // { broken = true; };
});
});
}) else null;
overrides = {
generateMelpa = lib.makeOverridable ({
archiveJson ? ./recipes-archive-melpa.json
}: let
inherit (import ./libgenerated.nix lib self) melpaDerivation;
super = lib.listToAttrs (map (melpaDerivation variant) (lib.importJSON archiveJson));
generic = import ./melpa-generic.nix;
overrides = rec {
shared = {
# 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;
};
@ -60,52 +57,25 @@ self:
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 ];
});
ess-R-data-view = super.ess-R-data-view.override {
inherit (self.melpaPackages) ess ctable popup;
};
# 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;
@ -118,7 +88,7 @@ self:
ido-complete-space-or-hyphen = markBroken super.ido-complete-space-or-hyphen;
# upstream issue: missing file header
initsplit = super.initsplit;
initsplit = markBroken super.initsplit;
# tries to write a log file to $HOME
insert-shebang = super.insert-shebang.overrideAttrs (attrs: {
@ -131,6 +101,27 @@ self:
# upstream issue: missing file header
jsfmt = markBroken super.jsfmt;
# 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-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 ];
});
kubernetes = super.kubernetes.overrideAttrs (attrs: {
# searches for Git at build time
nativeBuildInputs =
@ -138,15 +129,152 @@ self:
});
# upstream issue: missing file header
maxframe = markBroken super.maxframe;
mhc = super.mhc.override {
inherit (self.melpaPackages) calfw;
};
magit =
super.magit.overrideAttrs (attrs: {
# missing .NET
nemerle = markBroken super.nemerle;
# part of a larger package
notmuch = dontConfigure super.notmuch;
# missing OCaml
ocp-indent = markBroken super.ocp-indent;
# upstream issue: missing file header
qiita = markBroken super.qiita;
# 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;
# 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;
# 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+";
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+";
};
stable = {
# part of a larger package
# upstream issue: missing package version
cmake-mode = markBroken (dontConfigure super.cmake-mode);
# upstream issue: missing file header
connection = markBroken super.connection;
# upstream issue: missing file header
dictionary = markBroken super.dictionary;
# missing git
egg = markBroken super.egg;
# upstream issue: missing dependency redshank
emr = markBroken super.emr;
# upstream issue: doesn't build
eterm-256color = markBroken super.eterm-256color;
# upstream issue: missing dependency highlight
evil-search-highlight-persist = markBroken super.evil-search-highlight-persist;
# upstream issue: missing dependency highlight
floobits = markBroken super.floobits;
# missing OCaml
flycheck-ocaml = markBroken super.flycheck-ocaml;
# upstream issue: missing dependency
fold-dwim-org = markBroken super.fold-dwim-org;
# build timeout
graphene = markBroken super.graphene;
# Expects bash to be at /bin/bash
helm-rtags = markBroken super.helm-rtags;
# upstream issue: missing file header
link = markBroken super.link;
# missing OCaml
merlin = markBroken super.merlin;
# upstream issue: missing file header
po-mode = markBroken super.po-mode;
# upstream issue: truncated file
powershell = markBroken super.powershell;
};
unstable = shared // {
# upstream issue: mismatched filename
ack-menu = markBroken super.ack-menu;
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 ];
});
# missing dependencies
evil-search-highlight-persist = super.evil-search-highlight-persist.overrideAttrs (attrs: {
packageRequires = with self; [ evil highlight ];
});
forge = super.forge.overrideAttrs (attrs: {
# searches for Git at build time
nativeBuildInputs =
(attrs.nativeBuildInputs or []) ++ [ external.git ];
});
# upstream issue: mismatched filename
helm-lobsters = markBroken super.helm-lobsters;
# Expects bash to be at /bin/bash
helm-rtags = markBroken super.helm-rtags;
magit-annex = super.magit-annex.overrideAttrs (attrs: {
# searches for Git at build time
nativeBuildInputs =
@ -171,31 +299,6 @@ self:
(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
@ -211,9 +314,6 @@ self:
# 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 \
@ -228,39 +328,12 @@ self:
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 =
@ -271,36 +344,9 @@ self:
'';
});
});
# 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; }
in super // overrides."${variant}");
in generateMelpa { }

View File

@ -1,235 +0,0 @@
/*
# 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 "stable")
(lib.importJSON ./recipes-archive-melpa.json));
super = imported;
dontConfigure = pkg: pkg.override (args: {
melpaBuild = drv: args.melpaBuild (drv // {
configureScript = "true";
});
});
markBroken = pkg: if pkg != null then pkg.override (args: {
melpaBuild = drv: args.melpaBuild (drv // {
meta = (drv.meta or {}) // { broken = true; };
});
}) else null;
overrides = {
# Expects bash to be at /bin/bash
ac-rtags = markBroken super.ac-rtags;
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;
# part of a larger package
# upstream issue: missing package version
cmake-mode = markBroken (dontConfigure super.cmake-mode);
# Expects bash to be at /bin/bash
company-rtags = markBroken super.company-rtags;
# upstream issue: missing file header
connection = markBroken super.connection;
# upstream issue: missing file header
dictionary = markBroken super.dictionary;
easy-kill-extras = super.easy-kill-extras.override {
inherit (self.melpaPackages) easy-kill;
};
# missing git
egg = markBroken super.egg;
# upstream issue: missing file header
elmine = markBroken super.elmine;
# upstream issue: missing dependency redshank
emr = markBroken super.emr;
ess-R-data-view = super.ess-R-data-view.override {
inherit (self.melpaPackages) ess ctable popup;
};
# upstream issue: doesn't build
eterm-256color = markBroken super.eterm-256color;
# upstream issue: missing dependency highlight
evil-search-highlight-persist = markBroken super.evil-search-highlight-persist;
# upstream issue: missing dependency highlight
floobits = markBroken super.floobits;
# missing OCaml
flycheck-ocaml = markBroken super.flycheck-ocaml;
# Expects bash to be at /bin/bash
flycheck-rtags = markBroken super.flycheck-rtags;
# upstream issue: missing dependency
fold-dwim-org = markBroken super.fold-dwim-org;
# build timeout
graphene = markBroken super.graphene;
# 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 = markBroken super.initsplit;
# upstream issue: recipe fails
insert-shebang = markBroken super.insert-shebang;
# Expects bash to be at /bin/bash
ivy-rtags = markBroken super.ivy-rtags;
# upstream issue: missing file header
jsfmt = markBroken super.jsfmt;
# upstream issue: missing file header
link = markBroken super.link;
# upstream issue: missing file header
maxframe = markBroken super.maxframe;
magit =
(super.magit.override {
# version of magit-popup needs to match magit
# https://github.com/magit/magit/issues/3286
inherit (self.melpaStablePackages) magit-popup;
}).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 ];
});
# missing OCaml
merlin = markBroken super.merlin;
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;
# upstream issue: missing file header
po-mode = markBroken super.po-mode;
# upstream issue: truncated file
powershell = markBroken super.powershell;
# upstream issue: missing file header
qiita = markBroken super.qiita;
# 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;
# 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;
# 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+";
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+";
};
melpaStablePackages = super // overrides;
in
melpaStablePackages // { inherit melpaStablePackages; }

View File

@ -49,13 +49,18 @@ let
inherit lib stdenv texinfo;
};
melpaStablePackages = import ../applications/editors/emacs-modes/melpa-stable-packages.nix {
# Contains both melpa stable & unstable
melpaGeneric = import ../applications/editors/emacs-modes/melpa-packages.nix {
inherit external lib;
};
melpaPackages = import ../applications/editors/emacs-modes/melpa-packages.nix {
inherit external lib;
};
melpaStablePackages = self: let
m = melpaGeneric "stable" self;
in {melpaStablePackages = m;} // m;
melpaPackages = self: let
m = melpaGeneric "unstable" self;
in {melpaPackages = m;} // m;
orgPackages = import ../applications/editors/emacs-modes/org-packages.nix { };
@ -455,12 +460,11 @@ let
};
in
lib.makeScope newScope (self:
{}
in lib.makeScope newScope (self:
removeAttrs ({}
// elpaPackages self
// melpaStablePackages self
// melpaPackages self
// orgPackages self
// packagesFun self
)
// packagesFun self) [ "override" "overrideDerivation" ]
)