Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 writeShellScript,
6 texliveBasic,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "sagetex";
11 version = "3.6.1";
12
13 src = fetchFromGitHub {
14 owner = "sagemath";
15 repo = "sagetex";
16 rev = "v${version}";
17 sha256 = "sha256-OfhbXHbGI+DaDHqZCOGiSHJPHjGuT7ZqSEjKweloW38=";
18 };
19
20 outputs = [ "tex" ];
21
22 nativeBuildInputs = [
23 texliveBasic
24 # multiple-outputs.sh fails if $out is not defined
25 (writeShellScript "force-tex-output.sh" ''
26 out="''${tex-}"
27 '')
28 ];
29
30 buildPhase = ''
31 make sagetex.sty
32 '';
33
34 installPhase = ''
35 path="$out/tex/latex/sagetex"
36 mkdir -p "$path"
37 cp -va *.sty *.cfg *.def "$path/"
38 '';
39
40 meta = with lib; {
41 description = "Embed code, results of computations, and plots from Sage into LaTeX documents";
42 homepage = "https://github.com/sagemath/sagetex";
43 license = licenses.gpl2Plus;
44 maintainers = with maintainers; [ alexnortung ];
45 platforms = platforms.all;
46 };
47}