1 { fetchFromGitHub, lib, stdenv, libiconv, texliveFull, xercesc }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 hash = "sha256-DL5DyfARHHbwWBVHSa/VwHzNaAx/v7EDdnw1GLOk+y0=";
14 postPatch = lib.optionalString stdenv.cc.isClang ''
15 substituteInPlace makefile \
16 --replace "\$(CXX)" "\$(CXX) -std=c++98"
18 # fix the doc build on TeX Live 2023
20 substituteInPlace Documentation/manual.tex \
21 --replace '\usepackage[utf8x]{inputenc}' '\usepackage[utf8]{inputenc}'
24 outputs = [ "out" "doc" ];
26 nativeBuildInputs = [ texliveFull ]; # scheme-full needed for ucs package
27 buildInputs = [ xercesc ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
31 (if stdenv.hostPlatform.isDarwin
32 then [ "blahtex-mac" "blahtexml-mac" ]
33 else [ "blahtex-linux" "blahtexml-linux" ]);
36 install -D -t "$out/bin" blahtex blahtexml
37 install -m644 -D -t "$doc/share/doc/blahtexml" Documentation/manual.pdf
41 homepage = "http://gva.noekeon.org/blahtexml/";
42 description = "TeX to MathML converter";
44 Blahtex is a program written in C++, which converts an equation given in
45 a syntax close to TeX into MathML. It is designed by David Harvey and is
46 aimed at supporting equations in MediaWiki.
48 Blahtexml is a simple extension of blahtex, written by Gilles Van Assche.
49 In addition to the functionality of blahtex, blahtexml has XML processing
50 in mind and is able to process a whole XML document into another XML
51 document. Instead of converting only one formula at a time, blahtexml can
52 convert all the formulas of the given XML file into MathML.
54 license = licenses.bsd3;
55 maintainers = [ maintainers.xworld21 ];
56 platforms = platforms.all;