11 buildPlatformTools = [ "pse2unic" "adobe2h" ];
12 tex = texliveInfraOnly.withPackages (ps: [ ps.collection-fontsrecommended ]);
15 stdenv.mkDerivation (finalAttrs: {
19 url = with finalAttrs; "http://downloads.sourceforge.net/${pname}/${pname}-${version}.tar.bz2";
20 hash = "sha256-orVQVdQuRXp//OGkA7xRidNi4+J+tkw398LPZ+HX+k8=";
24 # fix error: conflicting types for 'kpathsea_version_string'; have 'char *'
26 url = "https://sources.debian.org/data/main/c/catdvi/0.14-14/debian/patches/03_kpathsea_version_string_declaration.diff";
27 hash = "sha256-d3CPDxXdVVLNtKkN0rC2G02dh/bJrRll/nVzQNggwkk=";
31 # fix implicit-int compile error in test code used in configure script
33 sed -i 's/^main()/int main()/' configure
36 hardeningDisable = [ "format" ];
38 outputs = [ "out" ] ++ lib.optional (with stdenv; buildPlatform.canExecute hostPlatform) "dev";
40 setOutputFlags = false;
42 enableParallelBuilding = true;
44 preBuild = lib.optionalString (with stdenv; !buildPlatform.canExecute hostPlatform)
45 (lib.concatMapStringsSep "\n" (tool: ''
46 cp ${lib.getDev buildPackages.catdvi}/bin/${tool} .
47 '') buildPlatformTools);
59 "catdvi" # to avoid running tests until checkPhase
60 ] ++ lib.optionals (with stdenv; !buildPlatform.canExecute hostPlatform)
61 (map (tool: "--assume-old=${tool}") buildPlatformTools);
72 mkdir -p $out/{bin,man/man1}
75 postInstall = lib.optionalString (with stdenv; buildPlatform.canExecute hostPlatform) ''
77 ${lib.concatMapStringsSep "\n" (tool: ''
79 '') buildPlatformTools}
82 ln -s ${tex}/share/texmf-var $out/share/texmf
86 homepage = "http://catdvi.sourceforge.net";
87 description = "DVI to plain text translator";
88 license = licenses.gpl2Plus;