melpaBuild: get Emacs package name from recipe

When building a package from a Melpa recipe file, get the Emacs package
name from the recipe. Nix is more restrictive about packages names than
Emacs, so the Nix name for a package is sometimes different.
This commit is contained in:
Thomas Tuegel 2016-01-15 17:53:54 -06:00
parent 61436c90e2
commit 4b2303b8c9
2 changed files with 5 additions and 3 deletions

View file

@ -54,7 +54,7 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
else
''
-f melpa2nix-build-package-from-recipe \
${pname} ${version} ${recipeFile}
${recipeFile} ${version}
''}
runHook postBuild

View file

@ -25,8 +25,10 @@
(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)))
(`(,recipe-file ,version)
(let* ((recipe (package-build--read-from-file recipe-file))
(rcp (cdr recipe))
(package (car recipe))
(files (package-build--config-file-list rcp)))
(melpa2nix-package-build-archive package version files)))))