about summary refs log tree commit diff
path: root/nixpkgs/pkgs/build-support/emacs/elpa.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/build-support/emacs/elpa.nix')
-rw-r--r--nixpkgs/pkgs/build-support/emacs/elpa.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/build-support/emacs/elpa.nix b/nixpkgs/pkgs/build-support/emacs/elpa.nix
new file mode 100644
index 000000000000..a43578fd3936
--- /dev/null
+++ b/nixpkgs/pkgs/build-support/emacs/elpa.nix
@@ -0,0 +1,37 @@
+# builder for Emacs packages built for packages.el
+
+{ lib, stdenv, emacs, texinfo, writeText, gcc }:
+
+let
+  handledArgs = [ "files" "fileSpecs" "meta" ];
+  genericBuild = import ./generic.nix { inherit lib stdenv emacs texinfo writeText gcc; };
+
+in
+
+{ pname
+, version
+, src
+, meta ? {}
+, ...
+}@args:
+
+genericBuild ({
+
+  dontUnpack = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    emacs --batch -Q -l ${./elpa2nix.el} \
+        -f elpa2nix-install-package \
+        "$src" "$out/share/emacs/site-lisp/elpa"
+
+    runHook postInstall
+  '';
+
+  meta = {
+    homepage = args.src.meta.homepage or "https://elpa.gnu.org/packages/${pname}.html";
+  } // meta;
+}
+
+// removeAttrs args handledArgs)