![Profpatsch](/assets/img/avatar_default.png)
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
48 lines
1.7 KiB
Nix
48 lines
1.7 KiB
Nix
{ lib, stdenv, fetchurl, perlPackages, makeWrapper, zip, libxslt }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "docbook2odf-0.244";
|
|
|
|
src = fetchurl {
|
|
url = "http://open.comsultia.com/docbook2odf/dwn/${name}.tar.gz";
|
|
sha256 = "10k44g0qqa37k30pfj8vz95j6zdzz0nmnqjq1lyahfs2h4glzgwb";
|
|
};
|
|
|
|
buildInputs = [ perlPackages.perl makeWrapper ];
|
|
|
|
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 : "${stdenv.lib.makeBinPath [ zip libxslt ]}" \
|
|
--prefix PERL5PATH : "${perlPackages.makePerlPath [ perlPackages.PerlMagick ]}"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Convert DocBook to OpenDocument Format (ODF)";
|
|
longDescription = ''
|
|
Docbook2odf is a toolkit that automaticaly 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 ];
|
|
};
|
|
}
|