Merge branch 'elpa-packages'

This commit is contained in:
Thomas Tuegel 2015-12-07 06:24:34 -06:00
commit 916f86745e
6 changed files with 1403 additions and 7 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
pkgs: with pkgs;
let
inherit (stdenv.lib) makeScope mapAttrs;
json = builtins.readFile ./elpa-packages.json;
manifest = builtins.fromJSON json;
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;
in elpaBuild {
pname = name;
inherit (recipe) version;
inherit src;
deps =
let lookupDep = d:
self."${d}" or (abort "emacs-${name}: missing dependency ${d}");
in map lookupDep recipe.deps;
meta = {
homepage = "http://elpa.gnu.org/packages/${name}.html";
license = stdenv.lib.licenses.free;
};
};
in self.callPackage drv {};
packages = self:
let
elpaPackages = mapAttrs (mkPackage self) manifest;
elpaBuild = import ../../../build-support/emacs/melpa.nix {
inherit (pkgs) lib stdenv fetchurl texinfo;
inherit (self) emacs;
};
in elpaPackages // { inherit elpaBuild elpaPackages; };
in makeScope pkgs.newScope packages

View File

@ -29,6 +29,19 @@ in
stdenv.mkDerivation ({
name = "emacs-${pname}${optionalString (version != null) "-${version}"}";
unpackCmd = ''
case "$curSrc" in
*.el)
cp $curSrc $pname.el
chmod +w $pname.el
sourceRoot="."
;;
*)
_defaultUnpack "$curSrc"
;;
esac
'';
buildInputs = [emacs texinfo] ++ packageRequires ++ buildInputs;
propagatedBuildInputs = packageRequires;
propagatedUserEnvPkgs = packageRequires;

View File

@ -8,7 +8,7 @@ let
snd = l: head (tail l);
trd = l: head (tail (tail l));
path_ = reverseList (splitString "/" url);
path = if head path_ == "" then tail path_ else path_;
path = [ (removeSuffix "/" (head path_)) ] ++ (tail path_);
in
# ../repo/trunk -> repo
if fst path == "trunk" then snd path

View File

@ -11613,7 +11613,7 @@ let
emacsPackagesNgGen = emacs: callPackage ./emacs-packages.nix {
overrides = (config.emacsPackageOverrides or (p: {})) pkgs;
inherit emacs;
inherit emacs elpaPackages;
trivialBuild = callPackage ../build-support/emacs/trivial.nix {
inherit emacs;
@ -11632,6 +11632,10 @@ 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; }));
emacsWithPackages = callPackage ../build-support/emacs/wrapper.nix { };
emacs24WithPackages = emacsWithPackages.override { emacs = emacs24; };

View File

@ -35,7 +35,7 @@
, lib, stdenv, fetchurl, fetchgit, fetchFromGitHub, fetchhg
, emacs
, emacs, elpaPackages
, trivialBuild
, melpaBuild
@ -44,9 +44,7 @@
with lib.licenses;
let self = _self // overrides;
callPackage = lib.callPackageWith (self // removeAttrs args ["overrides" "external"]);
_self = with self; {
let packagesFun = super: self: with self; {
inherit emacs;
@ -2025,4 +2023,6 @@ let self = _self // overrides;
};
};
}; in self
};
in elpaPackages.override packagesFun