melpaBuild: don't guess archive file name
package-build can tell us exactly what the archive file name is, instead of globbing for it.
This commit is contained in:
parent
4b2303b8c9
commit
18251778c9
@ -28,8 +28,6 @@ let
|
|||||||
sha256 = "1biwg2pqmmdz5iwqbjdszljazqymvgyyjcnc255nr6qz8mhnx67j";
|
sha256 = "1biwg2pqmmdz5iwqbjdszljazqymvgyyjcnc255nr6qz8mhnx67j";
|
||||||
};
|
};
|
||||||
|
|
||||||
fname = "${pname}-${version}";
|
|
||||||
|
|
||||||
targets = concatStringsSep " " (if files == null then fileSpecs else files);
|
targets = concatStringsSep " " (if files == null then fileSpecs else files);
|
||||||
|
|
||||||
defaultMeta = {
|
defaultMeta = {
|
||||||
@ -41,31 +39,33 @@ in
|
|||||||
import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
|
import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
|
||||||
inherit packageBuild;
|
inherit packageBuild;
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase =
|
||||||
runHook preBuild
|
if recipeFile == null
|
||||||
|
then ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \
|
export archive=$(emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \
|
||||||
${if recipeFile == null
|
-f melpa2nix-build-package \
|
||||||
then
|
${pname} ${version} ${targets})
|
||||||
''
|
|
||||||
-f melpa2nix-build-package \
|
|
||||||
${pname} ${version} ${targets}
|
|
||||||
''
|
|
||||||
else
|
|
||||||
''
|
|
||||||
-f melpa2nix-build-package-from-recipe \
|
|
||||||
${recipeFile} ${version}
|
|
||||||
''}
|
|
||||||
|
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
''
|
||||||
|
else ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
export archive=$(emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \
|
||||||
|
-f melpa2nix-build-package-from-recipe \
|
||||||
|
${recipeFile} ${version})
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
|
|
||||||
emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \
|
emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \
|
||||||
-f melpa2nix-install-package \
|
-f melpa2nix-install-package \
|
||||||
${fname}.* $out/share/emacs/site-lisp/elpa
|
"$archive" "$out/share/emacs/site-lisp/elpa"
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
@ -40,8 +40,11 @@
|
|||||||
version
|
version
|
||||||
files
|
files
|
||||||
package-build-working-dir
|
package-build-working-dir
|
||||||
package-build-archive-dir)))
|
package-build-archive-dir))
|
||||||
|
(archive-file (package-build--archive-file-name archive-entry)))
|
||||||
|
|
||||||
(package-build--message "Built in %.3fs, finished at %s"
|
(progn
|
||||||
|
(package-build--message "Built in %.3fs, finished at %s"
|
||||||
(time-to-seconds (time-since start-time))
|
(time-to-seconds (time-since start-time))
|
||||||
(current-time-string))))
|
(current-time-string))
|
||||||
|
(princ (format "%s\n" archive-file)))))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user