1{
2 fetchurl,
3 lib,
4 libxml2,
5 makeWrapper,
6 python3,
7 stdenv,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "doclifter";
12 version = "2.21";
13
14 src = fetchurl {
15 url = "http://www.catb.org/~esr/doclifter/doclifter-${finalAttrs.version}.tar.gz";
16 hash = "sha256-3zb+H/rRmU87LWh0+kQtiRMZ4JwJ3tVrt8vQ/EeKx8Q=";
17 };
18
19 postPatch = ''
20 substituteInPlace manlifter \
21 --replace-fail '/usr/bin/env python2' '/usr/bin/env python3' \
22 --replace-fail 'import thread, threading, Queue' 'import _thread, threading, queue' \
23 --replace-fail 'thread.get_ident' '_thread.get_ident' \
24 --replace-fail 'Queue.Queue' 'queue.Queue'
25 '';
26
27 nativeBuildInputs = [
28 python3
29 makeWrapper
30 ];
31
32 buildInputs = [ python3 ];
33
34 strictDeps = true;
35
36 makeFlags = [ "PREFIX=$(out)" ];
37
38 preInstall = ''
39 mkdir -p $out/bin
40 mkdir -p $out/share/man/man1
41 cp manlifter $out/bin
42 wrapProgram "$out/bin/manlifter" \
43 --prefix PATH : "${lib.getBin libxml2}/bin:$out/bin"
44 gzip < manlifter.1 > $out/share/man/man1/manlifter.1.gz
45 '';
46
47 meta = {
48 changelog = "https://gitlab.com/esr/doclifter/-/blob/2.21/NEWS";
49 description = "Lift documents in nroff markups to XML-DocBook";
50 homepage = "http://www.catb.org/esr/doclifter";
51 license = lib.licenses.bsd2;
52 mainProgram = "doclifter";
53 platforms = lib.platforms.unix;
54 };
55})