about summary refs log tree commit diff
path: root/pkgs/applications/editors/emacs-modes/elpa-packages.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/editors/emacs-modes/elpa-packages.nix')
-rw-r--r--pkgs/applications/editors/emacs-modes/elpa-packages.nix80
1 files changed, 62 insertions, 18 deletions
diff --git a/pkgs/applications/editors/emacs-modes/elpa-packages.nix b/pkgs/applications/editors/emacs-modes/elpa-packages.nix
index 3cf37c262806..aa30d62c60a9 100644
--- a/pkgs/applications/editors/emacs-modes/elpa-packages.nix
+++ b/pkgs/applications/editors/emacs-modes/elpa-packages.nix
@@ -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}");
+            packageRequires =
+              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
+
+self:
+
+  let
+    super = mapAttrs (mkPackage self) manifest;
+
+    elpaBuild = import ../../../build-support/emacs/melpa.nix {
+      inherit fetchurl lib stdenv texinfo;
+      inherit (self) emacs;
+    };
 
-      elpaBuild = import ../../../build-support/emacs/melpa.nix {
-        inherit (pkgs) lib stdenv fetchurl texinfo;
-        inherit (self) emacs;
-      };
-    in elpaPackages // { inherit elpaBuild elpaPackages; };
+    markBroken = pkg: pkg.override {
+      elpaBuild = args: self.elpaBuild (args // {
+        meta = (args.meta or {}) // { broken = true; };
+      });
+    };
 
-in makeScope pkgs.newScope packages
+    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; }