diff options
author | Thomas Tuegel <ttuegel@gmail.com> | 2015-12-29 13:23:49 -0600 |
---|---|---|
committer | Thomas Tuegel <ttuegel@gmail.com> | 2015-12-29 13:23:49 -0600 |
commit | 7466e0f264426f47086dbabb0384b0ebd3026c0c (patch) | |
tree | 382f8f142c71c02e5c8e35c25c51922be1a8b53d /pkgs/build-support/emacs | |
parent | 63bf2a551e9f371ef26b40c12d4db61d3b56fbda (diff) | |
download | nixpkgs-7466e0f264426f47086dbabb0384b0ebd3026c0c.tar nixpkgs-7466e0f264426f47086dbabb0384b0ebd3026c0c.tar.gz nixpkgs-7466e0f264426f47086dbabb0384b0ebd3026c0c.tar.bz2 nixpkgs-7466e0f264426f47086dbabb0384b0ebd3026c0c.tar.lz nixpkgs-7466e0f264426f47086dbabb0384b0ebd3026c0c.tar.xz nixpkgs-7466e0f264426f47086dbabb0384b0ebd3026c0c.tar.zst nixpkgs-7466e0f264426f47086dbabb0384b0ebd3026c0c.zip |
melpaBuild: accept recipeFile in lieu of fileSpecs
Diffstat (limited to 'pkgs/build-support/emacs')
-rw-r--r-- | pkgs/build-support/emacs/melpa.nix | 11 | ||||
-rw-r--r-- | pkgs/build-support/emacs/melpa2nix.el | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/pkgs/build-support/emacs/melpa.nix b/pkgs/build-support/emacs/melpa.nix index a1f10ad3143..8fd2a00b50a 100644 --- a/pkgs/build-support/emacs/melpa.nix +++ b/pkgs/build-support/emacs/melpa.nix @@ -8,6 +8,8 @@ with lib; { pname , version +, recipeFile ? null + , files ? null , fileSpecs ? [ "*.el" "*.el.in" "dir" "*.info" "*.texi" "*.texinfo" @@ -43,8 +45,17 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({ runHook preBuild emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \ + ${if recipeFile == null + then + '' -f melpa2nix-build-package \ ${pname} ${version} ${targets} + '' + else + '' + -f melpa2nix-build-package-from-recipe \ + ${pname} ${version} ${recipeFile} + ''} runHook postBuild ''; diff --git a/pkgs/build-support/emacs/melpa2nix.el b/pkgs/build-support/emacs/melpa2nix.el index 858ffd7593b..f1309fc0d57 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) |