diff options
author | Thomas Tuegel <ttuegel@gmail.com> | 2016-01-16 10:01:33 -0600 |
---|---|---|
committer | Thomas Tuegel <ttuegel@gmail.com> | 2016-01-18 15:29:17 -0600 |
commit | 18251778c956bf18a8a70d687ac2b66967c459dd (patch) | |
tree | 43515c6f095cdb395c8386c79783814e931c0cde /pkgs/build-support/emacs | |
parent | 4b2303b8c9758e9bff119d4dfe7bc8b039a73ef1 (diff) |
melpaBuild: don't guess archive file name
package-build can tell us exactly what the archive file name is, instead of globbing for it.
Diffstat (limited to 'pkgs/build-support/emacs')
-rw-r--r-- | pkgs/build-support/emacs/melpa.nix | 38 | ||||
-rw-r--r-- | pkgs/build-support/emacs/melpa2nix.el | 9 |
2 files changed, 25 insertions, 22 deletions
diff --git a/pkgs/build-support/emacs/melpa.nix b/pkgs/build-support/emacs/melpa.nix index ae228f48b0258..fb24408114764 100644 --- a/pkgs/build-support/emacs/melpa.nix +++ b/pkgs/build-support/emacs/melpa.nix @@ -28,8 +28,6 @@ let sha256 = "1biwg2pqmmdz5iwqbjdszljazqymvgyyjcnc255nr6qz8mhnx67j"; }; - fname = "${pname}-${version}"; - targets = concatStringsSep " " (if files == null then fileSpecs else files); defaultMeta = { @@ -41,31 +39,33 @@ in import ./generic.nix { inherit lib stdenv emacs texinfo; } ({ inherit packageBuild; - buildPhase = '' - runHook preBuild + buildPhase = + if recipeFile == null + then '' + runHook preBuild - emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \ - ${if recipeFile == null - then - '' - -f melpa2nix-build-package \ - ${pname} ${version} ${targets} - '' - else + export archive=$(emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \ + -f melpa2nix-build-package \ + ${pname} ${version} ${targets}) + + runHook postBuild '' - -f melpa2nix-build-package-from-recipe \ - ${recipeFile} ${version} - ''} + else '' + runHook preBuild - runHook postBuild - ''; + export archive=$(emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \ + -f melpa2nix-build-package-from-recipe \ + ${recipeFile} ${version}) + + runHook postBuild + ''; installPhase = '' runHook preInstall emacs --batch -Q -l $packageBuild -l ${./melpa2nix.el} \ - -f melpa2nix-install-package \ - ${fname}.* $out/share/emacs/site-lisp/elpa + -f melpa2nix-install-package \ + "$archive" "$out/share/emacs/site-lisp/elpa" runHook postInstall ''; diff --git a/pkgs/build-support/emacs/melpa2nix.el b/pkgs/build-support/emacs/melpa2nix.el index babca25277c8f..ea5b1390ad8c8 100644 --- a/pkgs/build-support/emacs/melpa2nix.el +++ b/pkgs/build-support/emacs/melpa2nix.el @@ -40,8 +40,11 @@ version files 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)) - (current-time-string)))) + (current-time-string)) + (princ (format "%s\n" archive-file))))) |