2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2016-06-13 13:37:25 +00:00
|
|
|
, texlive
|
2018-07-21 00:44:44 +00:00
|
|
|
, zlib, libiconv, libpng, libX11
|
|
|
|
, freetype, gd, libXaw, icu, ghostscript, libXpm, libXmu, libXext
|
2021-01-17 09:17:16 +00:00
|
|
|
, perl, perlPackages, python2Packages, pkg-config
|
2018-07-21 00:44:44 +00:00
|
|
|
, poppler, libpaper, graphite2, zziplib, harfbuzz, potrace, gmp, mpfr
|
2020-11-30 20:38:28 +00:00
|
|
|
, brotli, cairo, pixman, xorg, clisp, biber, woff2, xxHash
|
2019-08-19 22:56:36 +00:00
|
|
|
, makeWrapper, shortenPerlShebang
|
2015-09-17 15:57:04 +00:00
|
|
|
}:
|
|
|
|
|
2015-12-22 15:51:46 +00:00
|
|
|
# Useful resource covering build options:
|
|
|
|
# http://tug.org/texlive/doc/tlbuild.html
|
2015-09-17 15:57:04 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
withSystemLibs = map (libname: "--with-system-${libname}");
|
|
|
|
|
2020-10-10 03:17:01 +00:00
|
|
|
year = "2020";
|
2015-09-17 15:57:04 +00:00
|
|
|
version = year; # keep names simple for now
|
|
|
|
|
2019-08-13 21:52:01 +00:00
|
|
|
common = {
|
2015-09-17 15:57:04 +00:00
|
|
|
src = fetchurl {
|
2018-08-21 16:18:30 +00:00
|
|
|
urls = [
|
2020-10-10 03:17:01 +00:00
|
|
|
"http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${year}/texlive-${year}0406-source.tar.xz"
|
|
|
|
"ftp://tug.ctan.org/pub/tex/historic/systems/texlive/${year}/texlive-${year}0406-source.tar.xz"
|
2018-08-21 16:18:30 +00:00
|
|
|
];
|
2020-10-10 03:17:01 +00:00
|
|
|
sha256 = "0y4h4j2qg714srhvf1hvn165w7sanr1j2vzrsgc23kxvrc43sbz3";
|
2015-09-17 15:57:04 +00:00
|
|
|
};
|
|
|
|
|
2020-10-10 03:17:01 +00:00
|
|
|
prePatch = ''
|
2018-12-25 09:21:36 +00:00
|
|
|
for i in texk/kpathsea/mktex*; do
|
|
|
|
sed -i '/^mydir=/d' "$i"
|
|
|
|
done
|
2020-10-10 03:17:01 +00:00
|
|
|
cp -pv texk/web2c/pdftexdir/pdftoepdf{-poppler0.86.0,}.cc
|
|
|
|
cp -pv texk/web2c/pdftexdir/pdftosrc{-poppler0.83.0,}.cc
|
2020-03-14 20:46:55 +00:00
|
|
|
'';
|
2020-01-21 13:54:37 +00:00
|
|
|
|
2015-09-17 15:57:04 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-banner-add=/NixOS.org"
|
|
|
|
"--disable-missing" "--disable-native-texlive-build"
|
|
|
|
"--enable-shared" # "--enable-cxx-runtime-hack" # static runtime
|
|
|
|
"--enable-tex-synctex"
|
|
|
|
"-C" # use configure cache to speed up
|
|
|
|
]
|
|
|
|
++ withSystemLibs [
|
|
|
|
# see "from TL tree" vs. "Using installed" in configure output
|
|
|
|
"zziplib" "xpdf" "poppler" "mpfr" "gmp"
|
|
|
|
"pixman" "potrace" "gd" "freetype2" "libpng" "libpaper" "zlib"
|
|
|
|
# beware: xpdf means to use stuff from poppler :-/
|
|
|
|
];
|
|
|
|
|
|
|
|
# clean broken links to stuff not built
|
|
|
|
cleanBrokenLinks = ''
|
|
|
|
for f in "$out"/bin/*; do
|
|
|
|
if [[ ! -x "$f" ]]; then rm "$f"; fi
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
};
|
2020-10-11 14:59:55 +00:00
|
|
|
|
|
|
|
withLuaJIT = !(stdenv.hostPlatform.isPower && stdenv.hostPlatform.is64bit);
|
2015-09-17 15:57:04 +00:00
|
|
|
in rec { # un-indented
|
|
|
|
|
|
|
|
inherit (common) cleanBrokenLinks;
|
|
|
|
texliveYear = year;
|
|
|
|
|
|
|
|
|
|
|
|
core = stdenv.mkDerivation rec {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "texlive-bin";
|
|
|
|
inherit version;
|
2015-09-17 15:57:04 +00:00
|
|
|
|
2020-10-18 17:54:28 +00:00
|
|
|
inherit (common) src prePatch;
|
2015-09-17 15:57:04 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2015-09-17 15:57:04 +00:00
|
|
|
buildInputs = [
|
|
|
|
/*teckit*/ zziplib poppler mpfr gmp
|
2019-10-20 01:48:56 +00:00
|
|
|
pixman gd freetype libpng libpaper zlib
|
2015-09-17 15:57:04 +00:00
|
|
|
perl
|
|
|
|
];
|
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2015-12-23 01:59:47 +00:00
|
|
|
|
2015-09-17 15:57:04 +00:00
|
|
|
preConfigure = ''
|
|
|
|
rm -r libs/{cairo,freetype2,gd,gmp,graphite2,harfbuzz,icu,libpaper,libpng} \
|
2020-10-09 22:20:59 +00:00
|
|
|
libs/{lua53,luajit,mpfr,pixman,poppler,xpdf,zlib,zziplib}
|
2016-06-21 10:13:24 +00:00
|
|
|
mkdir WorkDir
|
|
|
|
cd WorkDir
|
2015-09-17 15:57:04 +00:00
|
|
|
'';
|
|
|
|
configureScript = "../configure";
|
|
|
|
|
|
|
|
configureFlags = common.configureFlags
|
|
|
|
++ [ "--without-x" ] # disable xdvik and xpdfopen
|
2020-10-09 22:20:59 +00:00
|
|
|
++ map (what: "--disable-${what}") [
|
2020-09-29 11:35:03 +00:00
|
|
|
"chktex"
|
2015-09-17 15:57:04 +00:00
|
|
|
"dvisvgm" "dvipng" # ghostscript dependency
|
2020-10-10 03:17:01 +00:00
|
|
|
"luatex" "luajittex" "luahbtex" "luajithbtex"
|
2020-10-09 22:20:59 +00:00
|
|
|
"mp" "pmp" "upmp" "mf" "mflua" "mfluajit" # cairo would bring in X and more
|
2016-06-21 10:13:24 +00:00
|
|
|
"xetex" "bibtexu" "bibtex8" "bibtex-x" "upmendex" # ICU isn't small
|
2020-10-09 22:20:59 +00:00
|
|
|
];
|
2015-09-17 15:57:04 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = false; # triptest fails, likely due to missing TEXMF tree
|
|
|
|
preCheck = "patchShebangs ../texk/web2c";
|
|
|
|
|
|
|
|
installTargets = [ "install" "texlinks" ];
|
|
|
|
|
|
|
|
# TODO: perhaps improve texmf.cnf search locations
|
|
|
|
postInstall = /* a few texmf-dist files are useful; take the rest from pkgs */ ''
|
|
|
|
mv "$out/share/texmf-dist/web2c/texmf.cnf" .
|
|
|
|
rm -r "$out/share/texmf-dist"
|
|
|
|
mkdir -p "$out"/share/texmf-dist/{web2c,scripts/texlive/TeXLive}
|
|
|
|
mv ./texmf.cnf "$out/share/texmf-dist/web2c/"
|
|
|
|
cp ../texk/tests/TeXLive/*.pm "$out/share/texmf-dist/scripts/texlive/TeXLive/"
|
|
|
|
cp ../texk/texlive/linked_scripts/scripts.lst "$out/share/texmf-dist/scripts/texlive/"
|
2016-09-10 12:58:00 +00:00
|
|
|
'' +
|
|
|
|
(let extraScripts =
|
|
|
|
''
|
|
|
|
tex4ht/ht.sh
|
|
|
|
tex4ht/htcontext.sh
|
|
|
|
tex4ht/htcopy.pl
|
|
|
|
tex4ht/htlatex.sh
|
|
|
|
tex4ht/htmex.sh
|
|
|
|
tex4ht/htmove.pl
|
|
|
|
tex4ht/httex.sh
|
|
|
|
tex4ht/httexi.sh
|
|
|
|
tex4ht/htxelatex.sh
|
|
|
|
tex4ht/htxetex.sh
|
|
|
|
tex4ht/mk4ht.pl
|
|
|
|
tex4ht/xhlatex.sh
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
''
|
|
|
|
echo -e 'texmf_scripts="$texmf_scripts\n${extraScripts}"' \
|
|
|
|
>> "$out/share/texmf-dist/scripts/texlive/scripts.lst"
|
|
|
|
'')
|
|
|
|
+ /* doc location identical with individual TeX pkgs */ ''
|
2015-09-17 15:57:04 +00:00
|
|
|
mkdir -p "$doc/doc"
|
2017-07-12 15:44:18 +00:00
|
|
|
mv "$out"/share/{man,info} "$doc"/doc
|
2015-09-17 15:57:04 +00:00
|
|
|
'' + cleanBrokenLinks;
|
|
|
|
|
|
|
|
setupHook = ./setup-hook.sh; # TODO: maybe texmf-nix -> texmf (and all references)
|
|
|
|
passthru = { inherit version buildInputs; };
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-09-17 15:57:04 +00:00
|
|
|
description = "Basic binaries for TeX Live";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.tug.org/texlive";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.gpl2;
|
2019-03-16 16:01:40 +00:00
|
|
|
maintainers = with maintainers; [ vcunat veprbl lovek323 raskin jwiegley ];
|
2015-09-17 15:57:04 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-10-10 03:17:01 +00:00
|
|
|
inherit (core-big) metafont mflua metapost luatex luahbtex luajittex xetex;
|
2016-06-21 10:13:24 +00:00
|
|
|
core-big = stdenv.mkDerivation { #TODO: upmendex
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "texlive-core-big.bin";
|
|
|
|
inherit version;
|
2015-09-17 15:57:04 +00:00
|
|
|
|
2020-10-18 17:54:28 +00:00
|
|
|
inherit (common) src prePatch;
|
2015-09-17 15:57:04 +00:00
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-02-07 13:09:11 +00:00
|
|
|
|
2017-10-07 08:12:49 +00:00
|
|
|
inherit (core) nativeBuildInputs;
|
2019-05-01 11:07:39 +00:00
|
|
|
buildInputs = core.buildInputs ++ [ core cairo harfbuzz icu graphite2 libX11 ];
|
2015-09-17 15:57:04 +00:00
|
|
|
|
|
|
|
configureFlags = common.configureFlags
|
|
|
|
++ withSystemLibs [ "kpathsea" "ptexenc" "cairo" "harfbuzz" "icu" "graphite2" ]
|
|
|
|
++ map (prog: "--disable-${prog}") # don't build things we already have
|
2020-10-11 14:59:55 +00:00
|
|
|
([ "tex" "ptex" "eptex" "uptex" "euptex" "aleph" "pdftex"
|
2018-08-28 15:54:52 +00:00
|
|
|
"web-progs" "synctex"
|
2021-01-15 09:19:50 +00:00
|
|
|
] ++ lib.optionals (!withLuaJIT) [ "luajittex" "luajithbtex" "mfluajit" ]);
|
2015-09-17 15:57:04 +00:00
|
|
|
|
|
|
|
configureScript = ":";
|
|
|
|
|
|
|
|
# we use static libtexlua, because it's only used by a single binary
|
2020-10-11 14:59:55 +00:00
|
|
|
postConfigure = let
|
2021-01-15 09:19:50 +00:00
|
|
|
luajit = lib.optionalString withLuaJIT ",luajit";
|
2020-10-11 14:59:55 +00:00
|
|
|
in ''
|
2016-06-21 10:13:24 +00:00
|
|
|
mkdir ./WorkDir && cd ./WorkDir
|
2020-10-11 14:59:55 +00:00
|
|
|
for path in libs/{teckit,lua53${luajit}} texk/web2c; do
|
2015-09-17 15:57:04 +00:00
|
|
|
(
|
2020-10-11 14:59:55 +00:00
|
|
|
if [[ "$path" =~ "libs/lua" ]]; then
|
2015-09-17 15:57:04 +00:00
|
|
|
extraConfig="--enable-static --disable-shared"
|
|
|
|
else
|
|
|
|
extraConfig=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p "$path" && cd "$path"
|
|
|
|
"../../../$path/configure" $configureFlags $extraConfig
|
|
|
|
)
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = "cd texk/web2c";
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-04-25 03:20:18 +00:00
|
|
|
doCheck = false; # fails
|
|
|
|
|
2015-09-17 15:57:04 +00:00
|
|
|
# now distribute stuff into outputs, roughly as upstream TL
|
|
|
|
# (uninteresting stuff remains in $out, typically duplicates from `core`)
|
2020-10-11 14:59:55 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"metafont"
|
|
|
|
"mflua"
|
|
|
|
"metapost"
|
|
|
|
"luatex"
|
2020-10-10 03:17:01 +00:00
|
|
|
"luahbtex"
|
2020-10-11 14:59:55 +00:00
|
|
|
"luajittex"
|
|
|
|
"xetex"
|
|
|
|
];
|
2015-09-17 15:57:04 +00:00
|
|
|
postInstall = ''
|
|
|
|
for output in $outputs; do
|
|
|
|
mkdir -p "''${!output}/bin"
|
|
|
|
done
|
|
|
|
|
|
|
|
mv "$out/bin"/{inimf,mf,mf-nowin} "$metafont/bin/"
|
2020-10-11 14:59:55 +00:00
|
|
|
mv "$out/bin"/mflua{,-nowin} "$mflua/bin/"
|
2015-09-17 15:57:04 +00:00
|
|
|
mv "$out/bin"/{*tomp,mfplain,*mpost} "$metapost/bin/"
|
2020-10-11 14:59:55 +00:00
|
|
|
mv "$out/bin"/{luatex,texlua,texluac} "$luatex/bin/"
|
2020-10-10 03:17:01 +00:00
|
|
|
mv "$out/bin"/luahbtex "$luahbtex/bin/"
|
2015-09-17 15:57:04 +00:00
|
|
|
mv "$out/bin"/xetex "$xetex/bin/"
|
2021-01-15 09:19:50 +00:00
|
|
|
'' + lib.optionalString withLuaJIT ''
|
2020-10-11 14:59:55 +00:00
|
|
|
mv "$out/bin"/mfluajit{,-nowin} "$mflua/bin/"
|
2020-10-10 03:17:01 +00:00
|
|
|
mv "$out/bin"/{luajittex,luajithbtex,texluajit,texluajitc} "$luajittex/bin/"
|
2020-10-11 14:59:55 +00:00
|
|
|
'' ;
|
2015-09-17 15:57:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-09-29 11:35:03 +00:00
|
|
|
chktex = stdenv.mkDerivation {
|
|
|
|
pname = "texlive-chktex.bin";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
inherit (common) src;
|
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-09-29 11:35:03 +00:00
|
|
|
buildInputs = [ core/*kpathsea*/ ];
|
|
|
|
|
|
|
|
preConfigure = "cd texk/chktex";
|
|
|
|
|
|
|
|
configureFlags = common.configureFlags
|
|
|
|
++ [ "--with-system-kpathsea" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-11-30 20:38:28 +00:00
|
|
|
dvisvgm = stdenv.mkDerivation rec {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "texlive-dvisvgm.bin";
|
2020-11-30 20:38:28 +00:00
|
|
|
version = "2.11";
|
|
|
|
# TODO: dvisvgm was switched to build from upstream sources
|
|
|
|
# to address https://github.com/NixOS/nixpkgs/issues/104847
|
|
|
|
# We might want to consider reverting that change in the future.
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/mgieseki/dvisvgm/releases/download/${version}/dvisvgm-${version}.tar.gz";
|
|
|
|
sha256 = "12b6h0h8rc487yjh3sq9zsdabm9cs2vqcrb0znnfi8277f87zf3j";
|
|
|
|
};
|
2015-09-17 15:57:04 +00:00
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-11-30 20:38:28 +00:00
|
|
|
buildInputs = [ core/*kpathsea*/ brotli ghostscript zlib freetype woff2 potrace xxHash ];
|
2015-09-17 15:57:04 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
dvipng = stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "texlive-dvipng.bin";
|
|
|
|
inherit version;
|
2015-09-17 15:57:04 +00:00
|
|
|
|
|
|
|
inherit (common) src;
|
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ perl pkg-config ];
|
2017-09-05 21:26:13 +00:00
|
|
|
buildInputs = [ core/*kpathsea*/ zlib libpng freetype gd ghostscript makeWrapper ];
|
2015-09-17 15:57:04 +00:00
|
|
|
|
2019-10-20 01:48:56 +00:00
|
|
|
preConfigure = ''
|
|
|
|
cd texk/dvipng
|
|
|
|
patchShebangs doc/texi2pod.pl
|
|
|
|
'';
|
2015-09-17 15:57:04 +00:00
|
|
|
|
|
|
|
configureFlags = common.configureFlags
|
|
|
|
++ [ "--with-system-kpathsea" "--with-gs=yes" "--disable-debug" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
# I didn't manage to hardcode gs location by configureFlags
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram "$out/bin/dvipng" --prefix PATH : '${ghostscript}/bin'
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-05-03 14:25:17 +00:00
|
|
|
latexindent = perlPackages.buildPerlPackage rec {
|
2019-06-20 13:07:56 +00:00
|
|
|
pname = "latexindent";
|
|
|
|
inherit (src) version;
|
2019-05-03 14:25:17 +00:00
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
src = lib.head (builtins.filter (p: p.tlType == "run") texlive.latexindent.pkgs);
|
2019-05-03 14:25:17 +00:00
|
|
|
|
|
|
|
outputs = [ "out" ];
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang;
|
2019-05-03 14:25:17 +00:00
|
|
|
propagatedBuildInputs = with perlPackages; [ FileHomeDir LogDispatch LogLog4perl UnicodeLineBreak YAMLTiny ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace scripts/latexindent/LatexIndent/GetYamlSettings.pm \
|
|
|
|
--replace '$FindBin::RealBin/defaultSettings.yaml' ${src}/scripts/latexindent/defaultSettings.yaml
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Dirty hack to apply perlFlags, but do no build
|
|
|
|
preConfigure = ''
|
|
|
|
touch Makefile.PL
|
|
|
|
'';
|
|
|
|
buildPhase = ":";
|
|
|
|
installPhase = ''
|
|
|
|
install -D ./scripts/latexindent/latexindent.pl "$out"/bin/latexindent
|
|
|
|
mkdir -p "$out"/${perl.libPrefix}
|
|
|
|
cp -r ./scripts/latexindent/LatexIndent "$out"/${perl.libPrefix}/
|
2021-01-15 09:19:50 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2019-08-19 22:56:36 +00:00
|
|
|
shortenPerlShebang "$out"/bin/latexindent
|
2019-05-03 14:25:17 +00:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-12-16 00:43:28 +00:00
|
|
|
pygmentex = python2Packages.buildPythonApplication rec {
|
|
|
|
pname = "pygmentex";
|
|
|
|
inherit (src) version;
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
src = lib.head (builtins.filter (p: p.tlType == "run") texlive.pygmentex.pkgs);
|
2019-12-16 00:43:28 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = with python2Packages; [ pygments chardet ];
|
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -D ./scripts/pygmentex/pygmentex.py "$out"/bin/pygmentex
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.ctan.org/pkg/pygmentex";
|
2019-12-16 00:43:28 +00:00
|
|
|
description = "Auxiliary tool for typesetting code listings in LaTeX documents using Pygments";
|
|
|
|
longDescription = ''
|
|
|
|
PygmenTeX is a Python-based LaTeX package that can be used for
|
|
|
|
typesetting code listings in a LaTeX document using Pygments.
|
|
|
|
|
|
|
|
Pygments is a generic syntax highlighter for general use in all kinds of
|
|
|
|
software such as forum systems, wikis or other applications that need to
|
|
|
|
prettify source code.
|
|
|
|
'';
|
|
|
|
license = licenses.lppl13c;
|
|
|
|
maintainers = with maintainers; [ romildo ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-03-09 23:13:25 +00:00
|
|
|
texlinks = stdenv.mkDerivation rec {
|
|
|
|
name = "texlinks.sh";
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
src = lib.head (builtins.filter (p: p.tlType == "run") texlive.texlive-scripts-extra.pkgs);
|
2020-03-09 23:13:25 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
# Patch texlinks.sh back to 2015 version;
|
|
|
|
# otherwise some bin/ links break, e.g. xe(la)tex.
|
|
|
|
patch --verbose -R scripts/texlive-extra/texlinks.sh < '${./texlinks.diff}'
|
|
|
|
install -Dm555 scripts/texlive-extra/texlinks.sh "$out"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-07-05 22:19:47 +00:00
|
|
|
inherit biber;
|
2015-09-17 15:57:04 +00:00
|
|
|
bibtexu = bibtex8;
|
|
|
|
bibtex8 = stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "texlive-bibtex-x.bin";
|
|
|
|
inherit version;
|
2015-09-17 15:57:04 +00:00
|
|
|
|
|
|
|
inherit (common) src;
|
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 21:26:13 +00:00
|
|
|
buildInputs = [ core/*kpathsea*/ icu ];
|
2015-09-17 15:57:04 +00:00
|
|
|
|
|
|
|
preConfigure = "cd texk/bibtex-x";
|
|
|
|
|
|
|
|
configureFlags = common.configureFlags
|
|
|
|
++ [ "--with-system-kpathsea" "--with-system-icu" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2015-12-22 15:51:46 +00:00
|
|
|
xdvi = stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "texlive-xdvi.bin";
|
|
|
|
inherit version;
|
2015-12-22 15:51:46 +00:00
|
|
|
|
|
|
|
inherit (common) src;
|
|
|
|
|
2021-01-17 09:17:16 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2017-09-05 21:26:13 +00:00
|
|
|
buildInputs = [ core/*kpathsea*/ freetype ghostscript ]
|
2015-12-22 15:51:46 +00:00
|
|
|
++ (with xorg; [ libX11 libXaw libXi libXpm libXmu libXaw libXext libXfixes ]);
|
|
|
|
|
|
|
|
preConfigure = "cd texk/xdvik";
|
|
|
|
|
|
|
|
configureFlags = common.configureFlags
|
|
|
|
++ [ "--with-system-kpathsea" "--with-system-libgs" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
substituteInPlace "$out/bin/xdvi" \
|
|
|
|
--replace "exec xdvi-xaw" "exec '$out/bin/xdvi-xaw'"
|
|
|
|
'';
|
|
|
|
# TODO: it's suspicious that mktexpk generates fonts into ~/.texlive2014
|
|
|
|
};
|
|
|
|
|
2016-11-07 21:57:41 +00:00
|
|
|
} # un-indented
|
|
|
|
|
2021-01-15 09:19:50 +00:00
|
|
|
// lib.optionalAttrs (!clisp.meta.broken) # broken on aarch64 and darwin (#20062)
|
2016-11-07 21:57:41 +00:00
|
|
|
{
|
2015-12-22 15:51:46 +00:00
|
|
|
|
2016-06-13 13:37:25 +00:00
|
|
|
xindy = stdenv.mkDerivation {
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "texlive-xindy.bin";
|
|
|
|
inherit version;
|
2016-06-13 13:37:25 +00:00
|
|
|
|
|
|
|
inherit (common) src;
|
texlive: 2017 -> 2017-final
This commit rebuilds texlive 2017 with the final release of 2017. As described
in these issues [1][2][3], the upstream CTAN mirrors are a continuously moving
rolling release without historical archives.
This particular FTP server is also a rolling release folling CTAN for the latest
version, but it has snapshots of the final texlive releases; it appears that the
2017 distribution has been unmodified since texlive-2018 was released earlier
this year.
Along the way, we needed to fix several issues:
- xindy: if $HOME is unset, it will try to mkdir /homeless-shelter, which fails
due to insufficient permissions.
- scheme-infraonly: this scheme had symlinks into other releases that were
read-only, so it couldn't patch and modify the scripts. This commit removes it
for now, but that's not a particularly satisfying solution. Ideas?
This also adds some documentation on the upgrade process to prepare for
texlive-2018 [4].
This commit also replaces the sha1 hashes with upstream's standard sha512 hashes.
It appears the motivation for the shorter hashes was to save disk space in the
derivations; in master, the size of this directory is 1012K; in this commit it
is 1600K. The difference is not particularly large, and the downsides to using
our own sha1 hashes are:
- More nix code to maintain
- Multi-step upgrade process for maintainers: the maintainer first has to
download all upstream tarballs by sha512 hash, then run the fix script, then
rebuild with sha1 hashes.
- Less transparent. If we use the upstream sha512 hashes, any user can
immediately verify that the hashes we're providing match upstream, or match
the snapshot in time.
- Easier to debug. Since upstream is rolling and packages may disappear or fail
to build, it's useful to be able to determine if the sha mismatch is because
of an update or not; if we have a sha1 mismatch and no tarball to pull, we
can't figure out which sha512sum would have produced that sha1.
- Less trust required. Due to the above, users don't have to trust the
content-addressed mirrors on IPFS and @veprbl's servers as much.
- Easier to cobble together a source distribution from a variety of sources. It
seems some FTP servers have more/less than others, or older/newer packages. If
we know what we're looking for beforehand and we're just missing a few
packages whose hashes match the advertised hashes upstream, it's easier to find.
[1] https://github.com/NixOS/nixpkgs/issues/24683
[2] https://github.com/NixOS/nixpkgs/issues/10026
[3] https://github.com/NixOS/nixpkgs/issues/34490
[4] https://github.com/NixOS/nixpkgs/issues/40232
2018-05-20 15:08:17 +00:00
|
|
|
|
|
|
|
# If unset, xindy will try to mkdir /homeless-shelter
|
2018-08-02 02:18:16 +00:00
|
|
|
HOME = ".";
|
texlive: 2017 -> 2017-final
This commit rebuilds texlive 2017 with the final release of 2017. As described
in these issues [1][2][3], the upstream CTAN mirrors are a continuously moving
rolling release without historical archives.
This particular FTP server is also a rolling release folling CTAN for the latest
version, but it has snapshots of the final texlive releases; it appears that the
2017 distribution has been unmodified since texlive-2018 was released earlier
this year.
Along the way, we needed to fix several issues:
- xindy: if $HOME is unset, it will try to mkdir /homeless-shelter, which fails
due to insufficient permissions.
- scheme-infraonly: this scheme had symlinks into other releases that were
read-only, so it couldn't patch and modify the scripts. This commit removes it
for now, but that's not a particularly satisfying solution. Ideas?
This also adds some documentation on the upgrade process to prepare for
texlive-2018 [4].
This commit also replaces the sha1 hashes with upstream's standard sha512 hashes.
It appears the motivation for the shorter hashes was to save disk space in the
derivations; in master, the size of this directory is 1012K; in this commit it
is 1600K. The difference is not particularly large, and the downsides to using
our own sha1 hashes are:
- More nix code to maintain
- Multi-step upgrade process for maintainers: the maintainer first has to
download all upstream tarballs by sha512 hash, then run the fix script, then
rebuild with sha1 hashes.
- Less transparent. If we use the upstream sha512 hashes, any user can
immediately verify that the hashes we're providing match upstream, or match
the snapshot in time.
- Easier to debug. Since upstream is rolling and packages may disappear or fail
to build, it's useful to be able to determine if the sha mismatch is because
of an update or not; if we have a sha1 mismatch and no tarball to pull, we
can't figure out which sha512sum would have produced that sha1.
- Less trust required. Due to the above, users don't have to trust the
content-addressed mirrors on IPFS and @veprbl's servers as much.
- Easier to cobble together a source distribution from a variety of sources. It
seems some FTP servers have more/less than others, or older/newer packages. If
we know what we're looking for beforehand and we're just missing a few
packages whose hashes match the advertised hashes upstream, it's easier to find.
[1] https://github.com/NixOS/nixpkgs/issues/24683
[2] https://github.com/NixOS/nixpkgs/issues/10026
[3] https://github.com/NixOS/nixpkgs/issues/34490
[4] https://github.com/NixOS/nixpkgs/issues/40232
2018-05-20 15:08:17 +00:00
|
|
|
|
2016-06-13 13:37:25 +00:00
|
|
|
prePatch = "cd utils/xindy";
|
|
|
|
# hardcode clisp location
|
|
|
|
postPatch = ''
|
2016-06-28 13:02:51 +00:00
|
|
|
substituteInPlace xindy-*/user-commands/xindy.in \
|
2016-06-13 13:37:25 +00:00
|
|
|
--replace "our \$clisp = ( \$is_windows ? 'clisp.exe' : 'clisp' ) ;" \
|
|
|
|
"our \$clisp = '$(type -P clisp)';"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-01-17 09:17:16 +00:00
|
|
|
pkg-config perl
|
2016-06-13 13:37:25 +00:00
|
|
|
(texlive.combine { inherit (texlive) scheme-basic cyrillic ec; })
|
|
|
|
];
|
2016-10-23 14:12:15 +00:00
|
|
|
buildInputs = [ clisp libiconv ];
|
2016-06-13 13:37:25 +00:00
|
|
|
|
|
|
|
configureFlags = [ "--with-clisp-runtime=system" "--disable-xindy-docs" ];
|
|
|
|
|
|
|
|
preInstall = ''mkdir -p "$out/bin" '';
|
|
|
|
# fixup various file-location errors of: lib/xindy/{xindy.mem,modules/}
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/lib/xindy"
|
|
|
|
mv "$out"/{bin/xindy.mem,lib/xindy/}
|
|
|
|
ln -s ../../share/texmf-dist/xindy/modules "$out/lib/xindy/"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2016-11-07 21:57:41 +00:00
|
|
|
}
|