about summary refs log tree commit diff
path: root/nixpkgs/pkgs/build-support/emacs/trivial.nix
blob: abe4d761c6b5cf8f2bb2483d4e526734b67b887b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# trivial builder for Emacs packages

{ callPackage, lib, ... }@envargs:

with lib;

args:

callPackage ./generic.nix envargs ({
  buildPhase = ''
    runHook preBuild

    emacs -L . --batch -f batch-byte-compile *.el

    runHook postBuild
  '';

  installPhase = ''
    runHook preInstall

    LISPDIR=$out/share/emacs/site-lisp
    install -d $LISPDIR
    install *.el *.elc $LISPDIR
    emacs --batch -l package --eval "(package-generate-autoloads \"${args.pname}\" \"$LISPDIR\")"

    runHook postInstall
  '';
}

// args)