core/pkgs/build-support/emacs/elpa.nix

33 lines
702 B
Nix
Raw Normal View History

2024-05-02 00:46:19 +00:00
# builder for Emacs packages built for packages.el
{ lib, stdenv, emacs, texinfo, writeText, gcc }:
let
handledArgs = [ "files" "fileSpecs" "meta" ];
2024-05-13 21:24:10 +00:00
genericBuild =
import ./generic.nix { inherit lib stdenv emacs texinfo writeText gcc; };
2024-05-02 00:46:19 +00:00
2024-05-13 21:24:10 +00:00
in { pname, version, src, meta ? { }, ... }@args:
2024-05-02 00:46:19 +00:00
genericBuild ({
dontUnpack = true;
installPhase = ''
runHook preInstall
emacs --batch -Q -l ${./elpa2nix.el} \
-f elpa2nix-install-package \
"$src" "$out/share/emacs/site-lisp/elpa"
runHook postInstall
'';
meta = {
2024-05-13 21:24:10 +00:00
homepage =
args.src.meta.homepage or "https://elpa.gnu.org/packages/${pname}.html";
2024-05-02 00:46:19 +00:00
} // meta;
}
2024-05-13 21:24:10 +00:00
// removeAttrs args handledArgs)