summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/misc/pdfstudio/default.nix
blob: 1efa2836d6af3a130a9dcca991f7efc7ed471ef1 (plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# For upstream versions, download links, and change logs see https://www.qoppa.com/pdfstudio/versions
#
# PDF Studio license is for a specific year, so we need different packages for different years.
# All versions of PDF Studio Viewer are free, so we package only the latest year.
# Thus, packages are pdfstudioviewer, pdfstudio2021, pdfstudio2022, etc.
# Variables:
# - program is either "pdfstudio" or "pdfstudioviewer", defaults to "pdfstudio".
# - year identifies the year portion of the version, defaults to most recent year.
# - pname is either "pdfstudio${year}" or "pdfstudioviewer".

{
  lib,
  stdenv,
  program ? "pdfstudio",
  year ? "2024",
  fetchurl,
  callPackage,
  jdk11,
  jdk17,
}:
let
  longDescription = ''
    PDF Studio is an easy to use, full-featured PDF editing software. This is the standard/pro edition, which requires a license. For the free PDF Studio Viewer see the package pdfstudioviewer.
  '';
  pname = if (program == "pdfstudio") then "${program}${year}" else program;
  desktopName = if (program == "pdfstudio") then "PDF Studio ${year}" else "PDF Studio Viewer";
  dot2dash = str: builtins.replaceStrings [ "." ] [ "_" ] str;
in
{
  pdfstudioviewer = callPackage ./common.nix rec {
    inherit
      desktopName
      pname
      program
      year
      ;
    version = "${year}.0.1";
    longDescription = ''
      PDF Studio Viewer is an easy to use, full-featured PDF editing software. This is the free edition. For the standard/pro edition, see the package pdfstudio.
    '';
    src = fetchurl {
      url = "https://web.archive.org/web/20241201121627/https://download.qoppa.com/pdfstudioviewer/PDFStudioViewer_linux64.deb";
      hash = "sha256-hxReGuyGsBiEr7wWxWzQUQvxk11sgF9HkJ07L9i+e+0=";
    };
    jdk = jdk17;
  };

  pdfstudio2021 = callPackage ./common.nix rec {
    inherit
      desktopName
      longDescription
      pname
      program
      year
      ;
    version = "${year}.2.2";
    src = fetchurl {
      url = "https://download.qoppa.com/pdfstudio/v${year}/PDFStudio_v${dot2dash version}_linux64.deb";
      hash = "sha256-HdkwRMqwquAaW6l3AukGReFtw2f5n36tZ8vXo6QiPvU=";
    };
    extraBuildInputs = [
      (lib.getLib stdenv.cc.cc) # for libstdc++.so.6 and libgomp.so.1
    ];
    jdk = jdk11;
  };

  pdfstudio2022 = callPackage ./common.nix rec {
    inherit
      desktopName
      longDescription
      pname
      program
      year
      ;
    version = "${year}.2.5";
    src = fetchurl {
      url = "https://download.qoppa.com/pdfstudio/v${year}/PDFStudio_v${dot2dash version}_linux64.deb";
      hash = "sha256-3faZyWUnFe//S+gOskWhsZ6jzHw67FRsv/xP77R1jj4=";
    };
    extraBuildInputs = [
      (lib.getLib stdenv.cc.cc) # for libstdc++.so.6 and libgomp.so.1
    ];
    jdk = jdk17;
  };

  pdfstudio2023 = callPackage ./common.nix rec {
    inherit
      desktopName
      longDescription
      pname
      program
      year
      ;
    version = "${year}.0.4";
    src = fetchurl {
      url = "https://download.qoppa.com/pdfstudio/v${year}/PDFStudio_v${dot2dash version}_linux64.deb";
      hash = "sha256-TTh0yzpCOpxFKGfrakvnu1Y+l9NI0nfWlVuvSWpkRkE=";
    };
    extraBuildInputs = [
      (lib.getLib stdenv.cc.cc) # for libstdc++.so.6 and libgomp.so.1
    ];
    jdk = jdk17;
  };

  pdfstudio2024 = callPackage ./common.nix rec {
    inherit
      desktopName
      longDescription
      pname
      program
      year
      ;
    version = "${year}.0.1";
    src = fetchurl {
      url = "https://download.qoppa.com/pdfstudio/v${year}/PDFStudio_v${dot2dash version}_linux64.deb";
      hash = "sha256-dptpkWPlocp4U9QSp+AJTOSVWA3RRs8GrFfXhCYzOJc=";
    };
    extraBuildInputs = [
      (lib.getLib stdenv.cc.cc) # for libstdc++.so.6 and libgomp.so.1
    ];
    jdk = jdk17;
  };

}
.${pname}