nixpkgs/pkgs/by-name/do/docbook2odf/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

51 lines
1.7 KiB
Nix

{ lib, stdenv, fetchurl, perlPackages, makeWrapper, zip, libxslt }:
stdenv.mkDerivation rec {
pname = "docbook2odf";
version = "0.244";
src = fetchurl {
url = "http://open.comsultia.com/docbook2odf/dwn/docbook2odf-${version}.tar.gz";
sha256 = "10k44g0qqa37k30pfj8vz95j6zdzz0nmnqjq1lyahfs2h4glzgwb";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ perlPackages.perl ];
installPhase = ''
mkdir -p "$out/bin/"
mkdir -p "$out/share/docbook2odf/"
mkdir -p "$out/share/doc/docbook2odf/"
mkdir -p "$out/share/man/man1/"
mkdir -p "$out/share/applications/"
cp utils/docbook2odf "$out/bin/"
cp docs/docbook2odf.1 "$out/share/man/man1/"
cp -r examples/ "$out/share/doc/docbook2odf/"
cp -r xsl/ "$out/share/docbook2odf/"
cp bindings/desktop/docbook2odf.desktop "$out/share/applications/"
sed -i "s|/usr/share/docbook2odf|$out/share/docbook2odf|" "$out/bin/docbook2odf"
wrapProgram "$out/bin/docbook2odf" \
--prefix PATH : "${lib.makeBinPath [ zip libxslt ]}" \
--prefix PERL5PATH : "${perlPackages.makePerlPath [ perlPackages.ImageMagick ]}"
'';
meta = with lib; {
description = "Convert DocBook to OpenDocument Format (ODF)";
longDescription = ''
Docbook2odf is a toolkit that automatically converts DocBook to OASIS
OpenDocument (ODF, the ISO standardized format used for texts,
spreadsheets and presentations). Conversion is based on a XSLT which
makes it easy to convert DocBook->ODF, ODT, ODS and ODP as all these
documents are XML based.
'';
homepage = "http://open.comsultia.com/docbook2odf/";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = [ maintainers.bjornfor ];
mainProgram = "docbook2odf";
};
}