emacsPackagesNg: add all of MELPA

This commit is contained in:
Thomas Tuegel 2015-12-15 11:57:51 -06:00
parent 4e99a11653
commit 8e655250bd
5 changed files with 101 additions and 55 deletions

View File

@ -10,17 +10,20 @@ let
mkPackage = self: name: recipe:
let drv =
{ elpaBuild, stdenv, fetchurl }:
let fetch = { inherit fetchurl; }."${recipe.fetch.tag}"
or (abort "emacs-${name}: unknown fetcher '${recipe.fetch.tag}'");
args = builtins.removeAttrs recipe.fetch [ "tag" ];
src = fetch args;
let
unknownFetcher =
abort "emacs-${name}: unknown fetcher '${recipe.fetch.tag}'";
fetch =
{ inherit fetchurl; }."${recipe.fetch.tag}"
or unknownFetcher;
args = builtins.removeAttrs recipe.fetch [ "tag" ];
src = fetch args;
in elpaBuild {
pname = name;
inherit (recipe) version;
inherit src;
deps =
let lookupDep = d:
self."${d}" or (abort "emacs-${name}: missing dependency ${d}");
let lookupDep = d: self."${d}" or null;
in map lookupDep recipe.deps;
meta = {
homepage = "http://elpa.gnu.org/packages/${name}.html";
@ -29,14 +32,23 @@ let
};
in self.callPackage drv {};
packages = self:
let
elpaPackages = mapAttrs (mkPackage self) manifest;
in
elpaBuild = import ../../../build-support/emacs/melpa.nix {
inherit (pkgs) lib stdenv fetchurl texinfo;
inherit (self) emacs;
};
in elpaPackages // { inherit elpaBuild elpaPackages; };
self:
in makeScope pkgs.newScope packages
let
super = mapAttrs (mkPackage self) manifest;
elpaBuild = import ../../../build-support/emacs/melpa.nix {
inherit (pkgs) lib stdenv fetchurl texinfo;
inherit (self) emacs;
};
builtin = null;
markBroken = pkg: pkg.override {
elpaBuild = args: self.elpaBuild (args // {
meta = (args.meta or {}) // { broken = true; };
});
};
in super // { inherit elpaBuild; elpaPackage = super; }

View File

@ -9,18 +9,23 @@ let
mkPackage = self: name: recipe:
let drv =
{ melpaBuild, stdenv, fetchurl }:
let fetch = { inherit fetchurl; }."${recipe.fetch.tag}"
or (abort "emacs-${name}: unknown fetcher '${recipe.fetch.tag}'");
args = builtins.removeAttrs recipe.fetch [ "tag" ];
src = fetch args;
{ melpaBuild, stdenv, fetchurl, fetchcvs, fetchgit, fetchhg }:
let
unknownFetcher =
abort "emacs-${name}: unknown fetcher '${recipe.fetch.tag}'";
fetch =
{
inherit fetchurl fetchcvs fetchgit fetchhg;
}."${recipe.fetch.tag}"
or unknownFetcher;
args = builtins.removeAttrs recipe.fetch [ "tag" ];
src = fetch args;
in melpaBuild {
pname = name;
inherit (recipe) version;
inherit src;
deps =
let lookupDep = d:
self."${d}" or (abort "emacs-${name}: missing dependency ${d}");
let lookupDep = d: self."${d}" or null;
in map lookupDep recipe.deps;
meta = {
homepage = "http://melpa.org/#/${name}";
@ -29,14 +34,17 @@ let
};
in self.callPackage drv {};
packages = self:
let
melpaPackages = mapAttrs (mkPackage self) manifest;
in
melpaBuild = import ../../../build-support/emacs/melpa.nix {
inherit (pkgs) lib stdenv fetchurl texinfo;
inherit (self) emacs;
};
in melpaPackages // { inherit melpaBuild melpaPackages; };
self:
in makeScope pkgs.newScope packages
let
super = mapAttrs (mkPackage self) manifest;
markBroken = pkg: pkg.override {
melpaBuild = args: self.melpaBuild (args // {
meta = (args.meta or {}) // { broken = true; };
});
};
in
super // { melpaPackages = super; }

View File

@ -9,18 +9,23 @@ let
mkPackage = self: name: recipe:
let drv =
{ melpaBuild, stdenv, fetchurl }:
let fetch = { inherit fetchurl; }."${recipe.fetch.tag}"
or (abort "emacs-${name}: unknown fetcher '${recipe.fetch.tag}'");
args = builtins.removeAttrs recipe.fetch [ "tag" ];
src = fetch args;
{ melpaBuild, stdenv, fetchurl, fetchcvs, fetchgit, fetchhg }:
let
unknownFetcher =
abort "emacs-${name}: unknown fetcher '${recipe.fetch.tag}'";
fetch =
{
inherit fetchurl fetchcvs fetchgit fetchhg;
}."${recipe.fetch.tag}"
or unknownFetcher;
args = builtins.removeAttrs recipe.fetch [ "tag" ];
src = fetch args;
in melpaBuild {
pname = name;
inherit (recipe) version;
inherit src;
deps =
let lookupDep = d:
self."${d}" or (abort "emacs-${name}: missing dependency ${d}");
let lookupDep = d: self."${d}" or null;
in map lookupDep recipe.deps;
meta = {
homepage = "http://stable.melpa.org/#/${name}";
@ -29,14 +34,17 @@ let
};
in self.callPackage drv {};
packages = self:
let
melpaStablePackages = mapAttrs (mkPackage self) manifest;
in
melpaBuild = import ../../../build-support/emacs/melpa.nix {
inherit (pkgs) lib stdenv fetchurl texinfo;
inherit (self) emacs;
};
in melpaStablePackages // { inherit melpaBuild melpaStablePackages; };
self:
in makeScope pkgs.newScope packages
let
super = mapAttrs (mkPackage self) manifest;
markBroken = pkg: pkg.override {
melpaBuild = args: self.melpaBuild (args // {
meta = (args.meta or {}) // { broken = true; };
});
};
in
super // { melpaStablePackages = super; }

View File

@ -11627,7 +11627,8 @@ let
emacsPackagesNgGen = emacs: callPackage ./emacs-packages.nix {
overrides = (config.emacsPackageOverrides or (p: {})) pkgs;
inherit emacs elpaPackages;
inherit newScope;
inherit emacs elpaPackages melpaPackages melpaStablePackages;
trivialBuild = callPackage ../build-support/emacs/trivial.nix {
inherit emacs;
@ -11647,8 +11648,13 @@ let
emacs24PackagesNg = recurseIntoAttrs (emacsPackagesNgGen emacs24);
elpaPackages =
let imported = import ../applications/editors/emacs-modes/elpa-packages.nix pkgs;
in recurseIntoAttrs (imported.override (super: self: { inherit emacs; }));
import ../applications/editors/emacs-modes/elpa-packages.nix pkgs;
melpaStablePackages =
import ../applications/editors/emacs-modes/melpa-stable-packages.nix pkgs;
melpaPackages =
import ../applications/editors/emacs-modes/melpa-packages.nix pkgs;
emacsWithPackages = callPackage ../build-support/emacs/wrapper.nix { };
emacs24WithPackages = emacsWithPackages.override { emacs = emacs24; };

View File

@ -33,9 +33,9 @@
{ overrides
, lib, stdenv, fetchurl, fetchgit, fetchFromGitHub, fetchhg
, lib, newScope, stdenv, fetchurl, fetchgit, fetchFromGitHub, fetchhg
, emacs, elpaPackages
, emacs, elpaPackages, melpaPackages, melpaStablePackages
, trivialBuild
, melpaBuild
@ -44,7 +44,14 @@
with lib.licenses;
let packagesFun = super: self: with self; {
let
addMelpaPackages = scope: scope.override (super: melpaPackages);
addMelpaStablePackages = scope: scope.override (super: melpaStablePackages);
addElpaPackages = scope: scope.override (super: elpaPackages);
addOverrides = scope: scope.override packagesFun;
packagesFun = super: self: with self; {
inherit emacs melpaBuild trivialBuild;
@ -2019,6 +2026,11 @@ let packagesFun = super: self: with self; {
};
};
};
};
in elpaPackages.override packagesFun
in
addOverrides
(addElpaPackages
(addMelpaStablePackages
(addMelpaPackages
(lib.makeScope newScope (self: { inherit emacs; })))))