@@ -8,6 +8,8 @@
88, makeWrapper
99}:
1010
11+# Useful resource covering build options:
12+# http://tug.org/texlive/doc/tlbuild.html
1113
1214let
1315 withSystemLibs = map (libname: "--with-system-${libname}");
@@ -221,5 +223,28 @@ bibtex8 = stdenv.mkDerivation {
221223};
222224
223225
226+xdvi = stdenv.mkDerivation {
227+ name = "texlive-xdvi.bin-${version}";
228+
229+ inherit (common) src;
230+
231+ buildInputs = [ pkgconfig core/*kpathsea*/ freetype ghostscript ]
232+ ++ (with xorg; [ libX11 libXaw libXi libXpm libXmu libXaw libXext libXfixes ]);
233+
234+ preConfigure = "cd texk/xdvik";
235+
236+ configureFlags = common.configureFlags
237+ ++ [ "--with-system-kpathsea" "--with-system-libgs" ];
238+
239+ enableParallelBuilding = true;
240+
241+ postInstall = ''
242+ substituteInPlace "$out/bin/xdvi" \
243+ --replace "exec xdvi-xaw" "exec '$out/bin/xdvi-xaw'"
244+ '';
245+ # TODO: it's suspicious that mktexpk generates fonts into ~/.texlive2014
246+};
247+
248+
224249} # un-indented
225250