2015-12-17 13:15:49 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
# 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)"`
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2015-12-17 02:41:50 +00:00
|
|
|
{ lib }:
|
2015-12-15 01:46:21 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2015-12-17 02:41:50 +00:00
|
|
|
inherit (lib) makeScope mapAttrs;
|
2015-12-15 01:46:21 +00:00
|
|
|
|
|
|
|
json = builtins.readFile ./melpa-stable-packages.json;
|
|
|
|
manifest = builtins.fromJSON json;
|
|
|
|
|
|
|
|
mkPackage = self: name: recipe:
|
|
|
|
let drv =
|
2015-12-19 15:49:57 +00:00
|
|
|
{ melpaBuild, stdenv, fetchbzr, fetchcvs, fetchFromGitHub, fetchFromGitLab
|
|
|
|
, fetchgit, fetchhg, fetchsvn, fetchurl }:
|
2015-12-15 17:57:51 +00:00
|
|
|
let
|
|
|
|
unknownFetcher =
|
|
|
|
abort "emacs-${name}: unknown fetcher '${recipe.fetch.tag}'";
|
|
|
|
fetch =
|
|
|
|
{
|
2015-12-19 15:49:57 +00:00
|
|
|
inherit fetchbzr fetchcvs fetchFromGitHub fetchFromGitLab fetchgit fetchhg
|
|
|
|
fetchsvn fetchurl;
|
2015-12-15 17:57:51 +00:00
|
|
|
}."${recipe.fetch.tag}"
|
|
|
|
or unknownFetcher;
|
|
|
|
args = builtins.removeAttrs recipe.fetch [ "tag" ];
|
|
|
|
src = fetch args;
|
2015-12-29 19:24:42 +00:00
|
|
|
recipeFile = fetchurl {
|
|
|
|
url = "https://raw.githubusercontent.com/milkypostman/melpa/${recipe.recipe.commit}/recipes/${name}";
|
|
|
|
inherit (recipe.recipe) sha256;
|
|
|
|
};
|
2015-12-15 01:46:21 +00:00
|
|
|
in melpaBuild {
|
|
|
|
pname = name;
|
|
|
|
inherit (recipe) version;
|
2015-12-29 19:24:42 +00:00
|
|
|
inherit recipeFile src;
|
2015-12-22 12:55:34 +00:00
|
|
|
packageRequires =
|
2015-12-15 17:57:51 +00:00
|
|
|
let lookupDep = d: self."${d}" or null;
|
2015-12-15 01:46:21 +00:00
|
|
|
in map lookupDep recipe.deps;
|
|
|
|
meta = {
|
|
|
|
homepage = "http://stable.melpa.org/#/${name}";
|
|
|
|
license = stdenv.lib.licenses.free;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in self.callPackage drv {};
|
|
|
|
|
2015-12-15 17:57:51 +00:00
|
|
|
in
|
2015-12-15 01:46:21 +00:00
|
|
|
|
2015-12-15 17:57:51 +00:00
|
|
|
self:
|
2015-12-15 01:46:21 +00:00
|
|
|
|
2015-12-15 17:57:51 +00:00
|
|
|
let
|
|
|
|
super = mapAttrs (mkPackage self) manifest;
|
|
|
|
|
|
|
|
markBroken = pkg: pkg.override {
|
|
|
|
melpaBuild = args: self.melpaBuild (args // {
|
|
|
|
meta = (args.meta or {}) // { broken = true; };
|
|
|
|
});
|
|
|
|
};
|
2015-12-22 12:50:21 +00:00
|
|
|
|
|
|
|
melpaStablePackages = super // {
|
|
|
|
# broken upstream
|
|
|
|
ack-menu = markBroken super.ack-menu;
|
|
|
|
};
|
2015-12-15 17:57:51 +00:00
|
|
|
in
|
2015-12-22 12:50:21 +00:00
|
|
|
melpaStablePackages // { inherit melpaStablePackages; }
|