nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 resholve,
4 fetchFromGitHub,
5 bc,
6 coreutils,
7 file,
8 gawk,
9 ghostscript,
10 gnused,
11 imagemagick,
12 zip,
13 runtimeShell,
14 findutils,
15}:
16
17resholve.mkDerivation {
18 pname = "pdf2odt";
19 version = "20220827";
20
21 src = fetchFromGitHub {
22 owner = "gutschke";
23 repo = "pdf2odt";
24 rev = "a05fbdebcc39277d905d1ae66f585a19f467b406";
25 hash = "sha256-995iF5Z1V4QEXeXUB8irG451TXpQBHZThJcEfHwfRtE=";
26 };
27
28 installPhase = ''
29 runHook preInstall
30
31 install -Dm0555 pdf2odt -t $out/bin
32 install -Dm0444 README.md LICENSE -t $out/share/doc/pdf2odt
33
34 ln -rs $out/bin/pdf2odt $out/bin/pdf2ods
35
36 runHook postInstall
37 '';
38
39 solutions.default = {
40 scripts = [ "bin/pdf2odt" ];
41 interpreter = runtimeShell;
42 inputs = [
43 bc
44 coreutils
45 file
46 findutils
47 gawk
48 ghostscript
49 gnused
50 imagemagick
51 zip
52 ];
53 execer = [
54 # zip can exec; confirmed 2 invocations in pdf2odt don't
55 "cannot:${zip}/bin/zip"
56 ];
57 };
58
59 meta = with lib; {
60 description = "PDF to ODT/ODS format converter";
61 homepage = "https://github.com/gutschke/pdf2odt";
62 license = licenses.mit;
63 platforms = platforms.all;
64 maintainers = with maintainers; [ peterhoeg ];
65 };
66}