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