Files
nixpkgs/pkgs/by-name/do/docbook2x/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

103 lines
2.4 KiB
Nix

{
fetchurl,
lib,
stdenv,
texinfo,
perlPackages,
groff,
libxml2,
libxslt,
gnused,
libiconv,
iconv,
opensp,
docbook_xml_dtd_43,
bash,
makeWrapper,
}:
stdenv.mkDerivation rec {
pname = "docbook2X";
version = "0.8.8";
src = fetchurl {
url = "mirror://sourceforge/docbook2x/docbook2X-${version}.tar.gz";
sha256 = "0ifwzk99rzjws0ixzimbvs83x6cxqk1xzmg84wa1p7bs6rypaxs0";
};
# This patch makes sure that `docbook2texi --to-stdout' actually
# writes its output to stdout instead of creating a file.
patches = [ ./db2x_texixml-to-stdout.patch ];
strictDeps = true;
nativeBuildInputs = [
makeWrapper
perlPackages.perl
texinfo
libxslt
iconv
];
buildInputs = [
groff
libxml2
opensp
libiconv
bash
]
++ (with perlPackages; [
perl
XMLSAX
XMLParser
XMLNamespaceSupport
]);
# configure tries to find osx in PATH and hardcodes the resulting path
# (if any) on the Perl code. this fails under strictDeps, so override
# the autoconf test:
OSX = "${opensp}/bin/osx";
postConfigure = ''
# Broken substitution is used for `perl/config.pl', which leaves literal
# `$prefix' in it.
substituteInPlace "perl/config.pl" \
--replace '${"\$" + "{prefix}"}' "$out"
'';
doCheck = false; # fails a lot of tests
postInstall = ''
perlPrograms="db2x_manxml db2x_texixml db2x_xsltproc
docbook2man docbook2texi";
for i in $perlPrograms
do
# XXX: We work around the fact that `wrapProgram' doesn't support
# spaces below by inserting escaped backslashes.
wrapProgram $out/bin/$i \
--prefix PERL5LIB : ${
with perlPackages;
makeFullPerlPath [
XMLSAX
XMLParser
XMLNamespaceSupport
]
} \
--prefix XML_CATALOG_FILES "\ " \
"$out/share/docbook2X/dtd/catalog.xml\ $out/share/docbook2X/xslt/catalog.xml\ ${docbook_xml_dtd_43}/xml/dtd/docbook/catalog.xml"
done
wrapProgram $out/bin/sgml2xml-isoent --prefix PATH : \
"${gnused}/bin"
'';
meta = with lib; {
longDescription = ''
docbook2X is a software package that converts DocBook documents
into the traditional Unix man page format and the GNU Texinfo
format.
'';
license = licenses.mit;
homepage = "https://docbook2x.sourceforge.net/";
platforms = platforms.all;
};
}