Merge pull request #11750 from ttuegel/emacs-packages

Emacs packages
This commit is contained in:
Thomas Tuegel 2015-12-19 09:33:45 -06:00
commit 540d028bf5
12 changed files with 70437 additions and 59 deletions

View File

@ -121,6 +121,12 @@ nginx.override {
allowing to enable the combination again.
</para>
</listitem>
<listitem>
<para><literal>emacsPackagesNg</literal> now contains all packages
from the ELPA, MELPA, and MELPA Stable repositories.
</para>
</listitem>
</itemizedlist>
</section>

View File

@ -201,10 +201,10 @@
"tiny": {
"fetch": {
"tag": "fetchurl",
"url": "http://elpa.gnu.org/packages/tiny-0.1.tar",
"sha256": "04iyidzjgnm4ka575wxqdak19h8j4dlni2ahf0bkq1q9by79xq1q"
"url": "http://elpa.gnu.org/packages/tiny-0.1.1.tar",
"sha256": "1nhg8375qdn457wj0xmfaj72s87xbabk2w1nl6q7rjvwxv08yyn7"
},
"version": "0.1",
"version": "0.1.1",
"deps": []
},
"coffee-mode": {
@ -246,10 +246,10 @@
"org": {
"fetch": {
"tag": "fetchurl",
"url": "http://elpa.gnu.org/packages/org-20151123.tar",
"sha256": "13ybzjg6k61paldfln6isc6149hvilwsgsnhyirig42bz1z0vjbb"
"url": "http://elpa.gnu.org/packages/org-20151214.tar",
"sha256": "15m9l7p7xfmcrxrcsxbvpp8bq5ajcapknvqblhmk77j7ca3jffi1"
},
"version": "20151123",
"version": "20151214",
"deps": []
},
"bug-hunter": {
@ -594,10 +594,10 @@
"hydra": {
"fetch": {
"tag": "fetchurl",
"url": "http://elpa.gnu.org/packages/hydra-0.13.3.tar",
"sha256": "1il0maxkxm2nxwz6y6v85zhf6a8f52gfq51h1filcnlzg10b5arm"
"url": "http://elpa.gnu.org/packages/hydra-0.13.4.tar",
"sha256": "11msy6n075iv00c2r9f85bzx3srnj403rhlga1rgsl6vsryf21fj"
},
"version": "0.13.3",
"version": "0.13.4",
"deps": [
"cl-lib"
]
@ -734,10 +734,10 @@
"ggtags": {
"fetch": {
"tag": "fetchurl",
"url": "http://elpa.gnu.org/packages/ggtags-0.8.10.el",
"sha256": "0bigf87idd2rh40akyjiy1qvym6y3hvvx6khyb233b231s400aj9"
"url": "http://elpa.gnu.org/packages/ggtags-0.8.11.el",
"sha256": "1q2bp2b7lylf7n6c1psfn5swyjg0y78ykm0ak2kd84pbyhqak2mq"
},
"version": "0.8.10",
"version": "0.8.11",
"deps": [
"cl-lib",
"emacs"
@ -953,10 +953,10 @@
"swiper": {
"fetch": {
"tag": "fetchurl",
"url": "http://elpa.gnu.org/packages/swiper-0.5.1.tar",
"sha256": "06kd6r90fnjz3lapm52pgsx4dhnd95mkzq9y4khkzqny59h0vmm6"
"url": "http://elpa.gnu.org/packages/swiper-0.7.0.tar",
"sha256": "1bzzx41zcf3yk6r6csqzlffwwrw9gyk8ab026r55l6416b6rcynx"
},
"version": "0.5.1",
"version": "0.7.0",
"deps": [
"emacs"
]
@ -1018,10 +1018,10 @@
"transcribe": {
"fetch": {
"tag": "fetchurl",
"url": "http://elpa.gnu.org/packages/transcribe-0.5.0.el",
"sha256": "1wxfv96sjcxins8cyqijsb16fc3n0m13kvaw0hjam8x91wamcbxq"
"url": "http://elpa.gnu.org/packages/transcribe-1.0.2.el",
"sha256": "0b0qaq0b3l37h6wfs4j80csmfcbidcd8a8wk6mwn6p4cdi7msr15"
},
"version": "0.5.0",
"version": "1.0.2",
"deps": []
},
"websocket": {

View File

@ -1,8 +1,21 @@
pkgs: with pkgs;
/*
# Updating
To update the list of packages from ELPA,
1. Clone https://github.com/ttuegel/emacs2nix
2. Run `./elpa-packages.sh` from emacs2nix
3. Copy the new elpa-packages.json file into Nixpkgs
4. `git commit -m "elpa-packages $(date -Idate)"`
*/
{ fetchurl, lib, stdenv, texinfo }:
let
inherit (stdenv.lib) makeScope mapAttrs;
inherit (lib) makeScope mapAttrs;
json = builtins.readFile ./elpa-packages.json;
manifest = builtins.fromJSON json;
@ -10,17 +23,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 +45,42 @@ 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 fetchurl lib stdenv texinfo;
inherit (self) emacs;
};
markBroken = pkg: pkg.override {
elpaBuild = args: self.elpaBuild (args // {
meta = (args.meta or {}) // { broken = true; };
});
};
elpaPackages = super // {
ace-window = markBroken super.ace-window;
ada-mode = markBroken super.ada-mode;
beacon = markBroken super.beacon;
bug-hunter = markBroken super.bug-hunter;
company-math = markBroken super.company-math;
company-statistics = markBroken super.company-statistics;
context-coloring = markBroken super.context-coloring;
dict-tree = markBroken super.dict-tree;
el-search = markBroken super.el-search;
ergoemacs-mode = markBroken super.ergoemacs-mode;
exwm = markBroken super.exwm;
gnugo = markBroken super.gnugo;
iterators = markBroken super.iterators;
midi-kbd = markBroken super.midi-kbd;
stream = markBroken super.stream;
tNFA = markBroken super.tNFA;
trie = markBroken super.trie;
xelb = markBroken super.xelb;
};
in elpaPackages // { inherit elpaBuild elpaPackages; }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,65 @@
/*
# Updating
To update the list of packages from MELPA,
1. Clone https://github.com/ttuegel/emacs2nix
2. Clone https://github.com/milkypostman/melpa
3. Run `./melpa-packages.sh PATH_TO_MELPA_CLONE` from emacs2nix
4. Copy the new melpa-packages.json file into Nixpkgs
5. `git commit -m "melpa-packages $(date -Idate)"`
*/
{ lib }:
let
inherit (lib) makeScope mapAttrs;
json = builtins.readFile ./melpa-stable-packages.json;
manifest = builtins.fromJSON json;
mkPackage = self: name: recipe:
let drv =
{ melpaBuild, stdenv, fetchurl, fetchcvs, fetchFromGitHub, fetchFromGitLab
, fetchgit, fetchhg }:
let
unknownFetcher =
abort "emacs-${name}: unknown fetcher '${recipe.fetch.tag}'";
fetch =
{
inherit fetchurl fetchcvs fetchFromGitHub fetchFromGitLab 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 null;
in map lookupDep recipe.deps;
meta = {
homepage = "http://melpa.org/#/${name}";
license = stdenv.lib.licenses.free;
};
};
in self.callPackage drv {};
in
self:
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; }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,67 @@
/*
# Updating
To update the list of packages from MELPA Stable,
1. Clone https://github.com/ttuegel/emacs2nix
2. Clone https://github.com/milkypostman/melpa
3. Run `./melpa-stable-packages.sh PATH_TO_MELPA_CLONE` from emacs2nix.
Error messages about missing versions are normal; most packages in
MELPA do not have a stable version.
4. Copy the new melpa-stable-packages.json file into Nixpkgs
5. `git commit -m "melpa-stable-packages $(date -Idate)"`
*/
{ lib }:
let
inherit (lib) makeScope mapAttrs;
json = builtins.readFile ./melpa-stable-packages.json;
manifest = builtins.fromJSON json;
mkPackage = self: name: recipe:
let drv =
{ melpaBuild, stdenv, fetchurl, fetchcvs, fetchFromGitHub, fetchFromGitLab
, fetchgit, fetchhg }:
let
unknownFetcher =
abort "emacs-${name}: unknown fetcher '${recipe.fetch.tag}'";
fetch =
{
inherit fetchurl fetchcvs fetchFromGitHub fetchFromGitLab 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 null;
in map lookupDep recipe.deps;
meta = {
homepage = "http://stable.melpa.org/#/${name}";
license = stdenv.lib.licenses.free;
};
};
in self.callPackage drv {};
in
self:
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

@ -1,8 +1,49 @@
{ stdenv, makeWrapper, emacs }:
/*
with stdenv.lib;
# Usage
explicitRequires: # packages explicitly requested by the user
`emacsWithPackages` takes a single argument: a function from a package
set to a list of packages (the packages that will be available in
Emacs). For example,
```
emacsWithPackages (epkgs: [ epkgs.evil epkgs.magit ])
```
All the packages in the list should come from the provided package
set. It is possible to add any package to the list, but the provided
set is guaranteed to have consistent dependencies and be built with
the correct version of Emacs.
# Overriding
`emacsWithPackages` inherits the package set which contains it, so the
correct way to override the provided package set is to override the
set which contains `emacsWithPackages`. For example, to override
`emacsPackagesNg.emacsWithPackages`,
```
let customEmacsPackages =
emacsPackagesNg.override (super: self: {
# use a custom version of emacs
emacs = ...;
# use the unstable MELPA version of magit
magit = self.melpaPackages.magit;
});
in customEmacsPackages.emacsWithPackages (epkgs: [ epkgs.evil epkgs.magit ])
```
*/
{ lib, makeWrapper, stdenv }: self:
with lib; let inherit (self) emacs; in
packagesFun: # packages explicitly requested by the user
let
explicitRequires =
if builtins.isFunction packagesFun
then packagesFun self
else packagesFun;
in
stdenv.mkDerivation {
name = (appendToName "with-packages" emacs).name;

View File

@ -26,8 +26,7 @@ repoName=$(echo $url | sed '
s,.*/\([^/]\+\)/tags/\([^/]\+\)/*$,\1-\2,;t
s,.*/\([^/]\+\)/*$,\1,;t
')
dstFile=$repoName-r$rev
test -n "$rev" || dstFile=$repoName
dstFile="bzr-export"
# If the hash was given, a file with that hash may already be in the
# store.

View File

@ -73,7 +73,7 @@ mkdir -p $unpackDirTmp
unpackDir=$tmp/unpacked/$name
mkdir -p $unpackDir
downloadedFile=$tmp/$name
downloadedFile=$tmp/$(basename "$url")
unpackFile() {
local curSrc="$1"

View File

@ -11636,10 +11636,12 @@ let
emacs24Packages = recurseIntoAttrs (emacsPackagesGen emacs24 pkgs.emacs24Packages);
emacsPackagesNgGen = emacs: callPackage ./emacs-packages.nix {
emacsPackagesNgGen = emacs: import ./emacs-packages.nix {
overrides = (config.emacsPackageOverrides or (p: {})) pkgs;
inherit emacs elpaPackages;
inherit lib newScope stdenv;
inherit fetchFromGitHub fetchgit fetchhg fetchurl;
inherit emacs texinfo makeWrapper;
trivialBuild = callPackage ../build-support/emacs/trivial.nix {
inherit emacs;
@ -11658,12 +11660,8 @@ 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; };
emacs24WithPackages = emacs24PackagesNg.emacsWithPackages;
emacsWithPackages = emacsPackagesNg.emacsWithPackages;
inherit (gnome3) empathy;

View File

@ -2,12 +2,10 @@
## FOR USERS
#
# Recommended way: simply use `emacsWithPackages` from
# `all-packages.nix` with the packages you want.
# Recommended: simply use `emacsWithPackages` with the packages you want.
#
# Possible way: use `emacs` from `all-packages.nix`, install
# everything to a system or user profile and then add this at the
# start your `init.el`:
# Alterative: use `emacs`, install everything to a system or user profile
# and then add this at the start your `init.el`:
/*
(require 'package)
@ -33,9 +31,9 @@
{ overrides
, lib, stdenv, fetchurl, fetchgit, fetchFromGitHub, fetchhg
, lib, newScope, stdenv, fetchurl, fetchgit, fetchFromGitHub, fetchhg
, emacs, elpaPackages
, emacs, texinfo, makeWrapper
, trivialBuild
, melpaBuild
@ -44,10 +42,30 @@
with lib.licenses;
let packagesFun = super: self: with self; {
let
elpaPackages = import ../applications/editors/emacs-modes/elpa-packages.nix {
inherit fetchurl lib stdenv texinfo;
};
melpaStablePackages = import ../applications/editors/emacs-modes/melpa-stable-packages.nix {
inherit lib;
};
melpaPackages = import ../applications/editors/emacs-modes/melpa-packages.nix {
inherit lib;
};
emacsWithPackages = import ../build-support/emacs/wrapper.nix {
inherit lib makeWrapper stdenv;
};
packagesFun = self: with self; {
inherit emacs melpaBuild trivialBuild;
emacsWithPackages = emacsWithPackages self;
## START HERE
ac-haskell-process = melpaBuild rec {
@ -2019,6 +2037,13 @@ let packagesFun = super: self: with self; {
};
};
};
};
in elpaPackages.override packagesFun
in
lib.makeScope newScope (self:
{}
// melpaPackages self
// melpaStablePackages self
// elpaPackages self
// packagesFun self
)