depot/pkgs/applications/editors/emacs/build-support/elpa.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

40 lines
771 B
Nix

# builder for Emacs packages built for packages.el
{ lib, stdenv, emacs, texinfo, writeText }:
let
genericBuild = import ./generic.nix { inherit lib stdenv emacs texinfo writeText; };
libBuildHelper = import ./lib-build-helper.nix;
in
libBuildHelper.extendMkDerivation' genericBuild (finalAttrs:
{ pname
, dontUnpack ? true
, meta ? {}
, ...
}@args:
{
elpa2nix = args.elpa2nix or ./elpa2nix.el;
inherit dontUnpack;
installPhase = args.installPhase or ''
runHook preInstall
emacs --batch -Q -l "$elpa2nix" \
-f elpa2nix-install-package \
"$src" "$out/share/emacs/site-lisp/elpa"
runHook postInstall
'';
meta = {
homepage = args.src.meta.homepage or "https://elpa.gnu.org/packages/${pname}.html";
} // meta;
}
)