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

61 lines
807 B
Nix
Raw Normal View History

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