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.
This commit is contained in:
Thomas Tuegel 2015-04-16 10:09:28 -05:00
parent 32c0069b79
commit 07a0031029

View File

@ -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;