nixpkgs/pkgs/by-name/do/doclifter/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

54 lines
1.2 KiB
Nix

{
fetchurl,
lib,
libxml2,
makeWrapper,
python3,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "doclifter";
version = "2.21";
src = fetchurl {
url = "http://www.catb.org/~esr/doclifter/doclifter-${finalAttrs.version}.tar.gz";
hash = "sha256-3zb+H/rRmU87LWh0+kQtiRMZ4JwJ3tVrt8vQ/EeKx8Q=";
};
postPatch = ''
substituteInPlace manlifter \
--replace-fail '/usr/bin/env python2' '/usr/bin/env python3'
2to3 -w manlifter
'';
nativeBuildInputs = [
python3
makeWrapper
];
buildInputs = [ python3 ];
strictDeps = true;
makeFlags = [ "PREFIX=$(out)" ];
preInstall = ''
mkdir -p $out/bin
mkdir -p $out/share/man/man1
cp manlifter $out/bin
wrapProgram "$out/bin/manlifter" \
--prefix PATH : "${lib.getBin libxml2}/bin:$out/bin"
gzip < manlifter.1 > $out/share/man/man1/manlifter.1.gz
'';
meta = {
changelog = "https://gitlab.com/esr/doclifter/-/blob/2.21/NEWS";
description = "Lift documents in nroff markups to XML-DocBook";
homepage = "http://www.catb.org/esr/doclifter";
license = lib.licenses.bsd2;
mainProgram = "doclifter";
platforms = lib.platforms.unix;
};
})