1{
2 lib,
3 mkDerivation,
4 fetchFromGitHub,
5 qmake,
6 pcsclite,
7 pkg-config,
8 opensc,
9}:
10
11mkDerivation rec {
12 pname = "chrome-token-signing";
13 version = "1.1.5";
14
15 src = fetchFromGitHub {
16 owner = "open-eid";
17 repo = "chrome-token-signing";
18 rev = "v${version}";
19 sha256 = "sha256-wKy/RVR7jx5AkMJgHXsuV+jlzyfH5nDRggcIUgh2ML4=";
20 };
21
22 nativeBuildInputs = [ pkg-config ];
23 buildInputs = [
24 qmake
25 pcsclite
26 ];
27 dontUseQmakeConfigure = true;
28
29 patchPhase = ''
30 substituteInPlace host-linux/ee.ria.esteid.json --replace /usr $out
31 # TODO: macos
32 substituteInPlace host-shared/PKCS11Path.cpp \
33 --replace opensc-pkcs11.so ${opensc}/lib/pkcs11/opensc-pkcs11.so
34 '';
35
36 installPhase = ''
37 install -D -t $out/bin host-linux/chrome-token-signing
38 # TODO: wire these up
39 install -D -t $out/etc/chromium/native-messaging-hosts host-linux/ee.ria.esteid.json
40 install -D -t $out/lib/mozilla/native-messaging-hosts host-linux/ff/ee.ria.esteid.json
41 '';
42
43 meta = with lib; {
44 description = "Chrome and Firefox extension for signing with your eID on the web";
45 mainProgram = "chrome-token-signing";
46 homepage = "https://github.com/open-eid/chrome-token-signing/wiki";
47 license = licenses.lgpl21;
48 maintainers = [ maintainers.mmahut ];
49 platforms = platforms.linux;
50 };
51}