aboutsummaryrefslogtreecommitdiff
path: root/overlays/emacs/builders/elisp.nix
blob: 871bffba1ee03c67efdb7544f9050eaea77cfdb7 (plain)
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
31
# https://github.com/jwiegley/nix-config/blob/4d296ad/overlays/emacs/builder.nix
{ stdenv
, pkgs
, emacs
, name
, src
, buildInputs ? []
, patches ? []
, preBuild ? ""
}:

stdenv.mkDerivation {
  inherit name src patches;
  unpackCmd = ''
    test -f "${src}" && mkdir el && cp -p ${src} el/${name}
  '';
  buildInputs = [ emacs ] ++ buildInputs;
  buildPhase = ''
    ${preBuild}
    ${emacs}/bin/emacs -Q -nw -L . --batch -f batch-byte-compile *.el
  '';
  installPhase = ''
    mkdir -p $out/share/emacs/site-lisp
    install *.el* $out/share/emacs/site-lisp
  '';
  meta = {
    description = "Emacs projects from the Internet that just compile `.el` files";
    homepage = http://www.emacswiki.org;
    platforms = pkgs.lib.platforms.all;
  };
}