summary refs log tree commit diff
path: root/pkgs/build-support/emacs
diff options
context:
space:
mode:
authorThomas Tuegel <ttuegel@mailbox.org>2018-07-23 06:17:43 -0500
committerThomas Tuegel <ttuegel@mailbox.org>2018-07-23 06:51:51 -0500
commit7131e353e62f28c57e5ecad0fb60201ffca32e4d (patch)
treed0e88c4ccd5efce13a4feba3bd1dbfcc0dacf643 /pkgs/build-support/emacs
parent095e2f961f8dd7fea58d71f6f44aee330046fbd2 (diff)
downloadnixpkgs-7131e353e62f28c57e5ecad0fb60201ffca32e4d.tar
nixpkgs-7131e353e62f28c57e5ecad0fb60201ffca32e4d.tar.gz
nixpkgs-7131e353e62f28c57e5ecad0fb60201ffca32e4d.tar.bz2
nixpkgs-7131e353e62f28c57e5ecad0fb60201ffca32e4d.tar.lz
nixpkgs-7131e353e62f28c57e5ecad0fb60201ffca32e4d.tar.xz
nixpkgs-7131e353e62f28c57e5ecad0fb60201ffca32e4d.tar.zst
nixpkgs-7131e353e62f28c57e5ecad0fb60201ffca32e4d.zip
melpaBuild: use Emacs package names to satisfy package-build
package-build expects the recipe file name to match the Emacs package
name. `melpaBuild` takes an extra argument `ename` for the Emacs package
name (default: `pname`, the Nix package name) which is used to name the recipe
file.

Fixes: #43893
See also: #43609
Diffstat (limited to 'pkgs/build-support/emacs')
-rw-r--r--pkgs/build-support/emacs/melpa.nix20
1 files changed, 14 insertions, 6 deletions
diff --git a/pkgs/build-support/emacs/melpa.nix b/pkgs/build-support/emacs/melpa.nix
index 5fa45b154a3..4ceaf77373e 100644
--- a/pkgs/build-support/emacs/melpa.nix
+++ b/pkgs/build-support/emacs/melpa.nix
@@ -5,7 +5,15 @@
 
 with lib;
 
-{ pname
+{ /*
+    pname: Nix package name without special symbols and without version or
+    "emacs-" prefix.
+  */
+  pname
+  /*
+    ename: Original Emacs package name, possibly containing special symbols.
+  */
+, ename ? pname
 , version
 , recipe
 , meta ? {}
@@ -35,7 +43,7 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
   preUnpack = ''
     mkdir -p "$NIX_BUILD_TOP/recipes"
     if [ -n "$recipe" ]; then
-      cp "$recipe" "$NIX_BUILD_TOP/recipes/$pname"
+      cp "$recipe" "$NIX_BUILD_TOP/recipes/$ename"
     fi
 
     ln -s "$melpa/package-build" "$NIX_BUILD_TOP/package-build"
@@ -45,7 +53,7 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
 
   postUnpack = ''
     mkdir -p "$NIX_BUILD_TOP/working"
-    ln -s "$NIX_BUILD_TOP/$sourceRoot" "$NIX_BUILD_TOP/working/$pname"
+    ln -s "$NIX_BUILD_TOP/$sourceRoot" "$NIX_BUILD_TOP/working/$ename"
   '';
 
   buildPhase =
@@ -58,7 +66,7 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
           -L "$melpa/package-build" \
           -l "$melpa2nix" \
           -f melpa2nix-build-package \
-          $pname $version
+          $ename $version
 
       runHook postBuild
     '';
@@ -66,9 +74,9 @@ import ./generic.nix { inherit lib stdenv emacs texinfo; } ({
   installPhase = ''
     runHook preInstall
 
-    archive="$NIX_BUILD_TOP/packages/$pname-$version.el"
+    archive="$NIX_BUILD_TOP/packages/$ename-$version.el"
     if [ ! -f "$archive" ]; then
-        archive="$NIX_BUILD_TOP/packages/$pname-$version.tar"
+        archive="$NIX_BUILD_TOP/packages/$ename-$version.tar"
     fi
 
     emacs --batch -Q \