2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python3, libreoffice-unwrapped, asciidoc, makeWrapper
|
2013-09-01 20:30:23 +02:00
|
|
|
# whether to install odt2pdf/odt2doc/... symlinks to unoconv
|
|
|
|
, installSymlinks ? true
|
|
|
|
}:
|
|
|
|
|
|
|
|
# IMPORTANT: unoconv must use the same python version as libreoffice (unless it
|
|
|
|
# will not be able to load the pyuno module from libreoffice).
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-01-16 16:42:11 +01:00
|
|
|
pname = "unoconv";
|
2020-02-10 17:40:19 +01:00
|
|
|
version = "0.9.0";
|
2020-01-16 16:42:11 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "unoconv";
|
|
|
|
repo = "unoconv";
|
|
|
|
rev = version;
|
2020-02-10 17:40:19 +01:00
|
|
|
sha256 = "1akx64686in8j8arl6vsgp2n3bv770q48pfv283c6fz6wf9p8fvr";
|
2013-09-01 20:30:23 +02:00
|
|
|
};
|
|
|
|
|
2021-02-07 10:17:39 +01:00
|
|
|
nativeBuildInputs = [ asciidoc makeWrapper ];
|
2013-09-01 20:30:23 +02:00
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
makeFlags=prefix="$out"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
sed -i "s|/usr/bin/env python.*|${python3}/bin/${python3.executable}|" "$out/bin/unoconv"
|
2018-10-05 16:03:20 +02:00
|
|
|
wrapProgram "$out/bin/unoconv" --set UNO_PATH "${libreoffice-unwrapped}/lib/libreoffice/program/"
|
2013-09-01 20:30:23 +02:00
|
|
|
'' + (if installSymlinks then ''
|
|
|
|
make install-links prefix="$out"
|
|
|
|
'' else "");
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2013-09-01 20:30:23 +02:00
|
|
|
description = "Convert between any document format supported by LibreOffice/OpenOffice";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://dag.wieers.com/home-made/unoconv/";
|
2013-09-01 20:30:23 +02:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.bjornfor ];
|
|
|
|
};
|
|
|
|
}
|