nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 mkDerivation,
4 fetchurl,
5 cmake,
6 flatbuffers,
7 gettext,
8 pkg-config,
9 libdigidocpp,
10 opensc,
11 openldap,
12 openssl,
13 pcsclite,
14 qtbase,
15 qtsvg,
16 qttools,
17}:
18
19mkDerivation rec {
20 pname = "qdigidoc";
21 version = "4.7.0";
22
23 src = fetchurl {
24 url = "https://github.com/open-eid/DigiDoc4-Client/releases/download/v${version}/qdigidoc4-${version}.tar.gz";
25 hash = "sha256-XP7KqhIYriHQzQrw77zUp/I9nnh9EqK0m9+N+69Lh5c=";
26 };
27
28 nativeBuildInputs = [
29 cmake
30 gettext
31 pkg-config
32 qttools
33 ];
34
35 buildInputs = [
36 flatbuffers
37 libdigidocpp
38 opensc
39 openldap
40 openssl
41 pcsclite
42 qtbase
43 qtsvg
44 ];
45
46 # qdigidoc needs a (somewhat recent) config, as well as a TSL list for signing to work.
47 # To refresh, re-fetch and update what's in the vendor/ directory.
48 cmakeFlags = [
49 # If not provided before the build, qdigidoc tries to download a TSL list during the build.
50 # We pass it in via TSL_URL, fetched from https://ec.europa.eu/tools/lotl/eu-lotl.xml.
51 "-DTSL_URL=file://${./vendor/eu-lotl.xml}"
52 # `config.{json,pub,rsa}`, from https://id.eesti.ee/config.{json,pub,rsa}.
53 # The build system also looks for `config.{pub,rsa}` in the same directory,
54 # all three files need to be present.
55 "-DCONFIG_URL=file://${./vendor}/config.json"
56 ];
57
58 # qdigidoc4's `QPKCS11::reload()` dlopen()s "opensc-pkcs11.so" in QLibrary,
59 # i.e. OpenSC's module is searched for in libQt5Core's DT_RUNPATH and fixing
60 # qdigidoc4's DT_RUNPATH has no effect on Linux (at least OpenBSD's ld.so(1)
61 # searches the program's runtime path as well).
62 # LD_LIBRARY_PATH takes precedence for all calling objects, see dlopen(3).
63 # https://github.com/open-eid/cmake/pull/35 might be an alternative.
64 qtWrapperArgs = [
65 "--prefix LD_LIBRARY_PATH : ${opensc}/lib/pkcs11/"
66 ];
67
68 meta = with lib; {
69 description = "Qt-based UI for signing and verifying DigiDoc documents";
70 mainProgram = "qdigidoc4";
71 homepage = "https://www.id.ee/";
72 license = licenses.lgpl21Plus;
73 platforms = platforms.linux;
74 maintainers = with maintainers; [
75 flokli
76 mmahut
77 ];
78 };
79}