btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / au / auctex / package.nix
blobdc027b5c470e5d74dc112e58b0488e7ce5518bbe
1 { lib, stdenv, fetchurl, emacs, texliveBasic, ghostscript }:
3 let auctex = stdenv.mkDerivation ( rec {
4   # Make this a valid tex(live-new) package;
5   # the pkgs attribute is provided with a hack below.
6   pname = "auctex";
7   version = "13.2";
8   tlType = "run";
10   outputs = [ "out" "tex" ];
12   src = fetchurl {
13     url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
14     hash = "sha256-Hn5AKrz4RmlOuncZklvwlcI+8zpeZgIgHHS2ymCUQDU=";
15   };
17   buildInputs = [
18     emacs
19     ghostscript
20     (texliveBasic.withPackages (ps: [ ps.etoolbox ps.hypdoc ]))
21   ];
23   preConfigure = ''
24     mkdir -p "$tex"
25     export HOME=$(mktemp -d)
26   '';
28   configureFlags = [
29     "--with-lispdir=\${out}/share/emacs/site-lisp"
30     "--with-texmf-dir=\${tex}"
31   ];
33   meta = with lib; {
34     homepage = "https://www.gnu.org/software/auctex";
35     description = "Extensible package for writing and formatting TeX files in GNU Emacs and XEmacs";
36     license = licenses.gpl3Plus;
37     platforms = platforms.unix;
38   };
39 });
41 in auctex // { pkgs = [ auctex.tex ]; }