From 07a003102948d5af2d8781bf4fe85d306d2ab448 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 16 Apr 2015 10:09:28 -0500 Subject: [PATCH] melpaBuild: add unpackCmd for single-file packages Emacs packages are commonly distributed as single .el files. This unpackCmd handles them correctly and sets up sourceRoot. Other sources are treated in the default manner. --- pkgs/build-support/emacs/generic.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/build-support/emacs/generic.nix b/pkgs/build-support/emacs/generic.nix index 6fd630b13f4..d41f90ebd05 100644 --- a/pkgs/build-support/emacs/generic.nix +++ b/pkgs/build-support/emacs/generic.nix @@ -29,6 +29,19 @@ in stdenv.mkDerivation ({ name = "emacs-${pname}${optionalString (version != null) "-${version}"}"; + unpackCmd = '' + case "$curSrc" in + *.el) + cp $curSrc $pname.el + chmod +w $pname.el + sourceRoot="." + ;; + *) + _defaultUnpack "$curSrc" + ;; + esac + ''; + buildInputs = [emacs texinfo] ++ packageRequires ++ buildInputs; propagatedBuildInputs = packageRequires; propagatedUserEnvPkgs = packageRequires;