summary refs log tree commit diff
path: root/pkgs/build-support/emacs/melpa2nix.el
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/emacs/melpa2nix.el')
-rw-r--r--pkgs/build-support/emacs/melpa2nix.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/build-support/emacs/melpa2nix.el b/pkgs/build-support/emacs/melpa2nix.el
index 858ffd7593bf..f1309fc0d57b 100644
--- a/pkgs/build-support/emacs/melpa2nix.el
+++ b/pkgs/build-support/emacs/melpa2nix.el
@@ -21,6 +21,15 @@
     (`(,package ,version . ,files)
      (melpa2nix-package-build-archive package version files))))
 
+(defun melpa2nix-build-package-from-recipe ()
+  (if (not noninteractive)
+      (error "`melpa2nix-build-package' is to be used only with -batch"))
+  (pcase command-line-args-left
+    (`(,package ,version ,recipe-file)
+     (let* ((rcp (cdr (package-build--read-from-file recipe-file)))
+            (files (package-build--config-file-list rcp)))
+       (melpa2nix-package-build-archive package version files)))))
+
 (defun melpa2nix-package-build-archive (name version files)
   "Build a package archive for package NAME."
   (package-build--message "\n;;; %s\n" name)