depot/pkgs/applications/editors/emacs/build-support/trivial.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

38 lines
839 B
Nix

# trivial builder for Emacs packages
{ callPackage, lib, ... }@envargs:
let
libBuildHelper = import ./lib-build-helper.nix;
in
libBuildHelper.extendMkDerivation' (callPackage ./generic.nix envargs) (finalAttrs:
args:
{
buildPhase = args.buildPhase or ''
runHook preBuild
# This is modified from stdenv buildPhase. foundMakefile is used in stdenv checkPhase.
if [[ ! ( -z "''${makeFlags-}" && -z "''${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ) ]]; then
foundMakefile=1
fi
emacs -l package -f package-initialize -L . --batch -f batch-byte-compile *.el
runHook postBuild
'';
installPhase = args.installPhase or ''
runHook preInstall
LISPDIR=$out/share/emacs/site-lisp
install -d $LISPDIR
install *.el *.elc $LISPDIR
runHook postInstall
'';
}
)