about summary refs log tree commit diff
path: root/pkgs/by-name/pd/pdf2odt/package.nix
blob: eb748da0842be5d862fab7c50372bc2b579b438f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{ lib
, resholve
, fetchFromGitHub
, bc
, coreutils
, file
, gawk
, ghostscript
, gnused
, imagemagick
, zip
, runtimeShell
, findutils
}:

resholve.mkDerivation rec {
  pname = "pdf2odt";
  version = "20220827";

  src = fetchFromGitHub {
    owner = "gutschke";
    repo = "pdf2odt";
    rev = "a05fbdebcc39277d905d1ae66f585a19f467b406";
    hash = "sha256-995iF5Z1V4QEXeXUB8irG451TXpQBHZThJcEfHwfRtE=";
  };

  installPhase = ''
    runHook preInstall

    install -Dm0555 pdf2odt           -t $out/bin
    install -Dm0444 README.md LICENSE -t $out/share/doc/${pname}

    ln -rs $out/bin/pdf2odt $out/bin/pdf2ods

    runHook postInstall
  '';

  solutions.default = {
    scripts = [ "bin/pdf2odt" ];
    interpreter = runtimeShell;
    inputs = [
      bc
      coreutils
      file
      findutils
      gawk
      ghostscript
      gnused
      imagemagick
      zip
    ];
  };

  meta = with lib; {
    description = "PDF to ODT/ODS format converter";
    homepage = "https://github.com/gutschke/pdf2odt";
    license = licenses.mit;
    platforms = platforms.all;
    maintainers = with maintainers; [ peterhoeg ];
  };
}