lol
1{ stdenv, fetchurl, jre, makeWrapper, pcsclite }:
2
3let
4 # TODO: find out what the version components actually mean, if anything:
5 major = "4.1.4-v4.1.4";
6 minor = "tcm406-270732";
7 version = "${major}-${minor}";
8in stdenv.mkDerivation rec {
9 name = "eid-viewer-${version}";
10
11 src = fetchurl {
12 url = "http://eid.belgium.be/en/binaries/eid-viewer-${major}.src.tar_${minor}.gz";
13 sha256 = "06kda45y7c3wvvqby153zcasgz4jibjypv8gvfwvrwvn4ag2z934";
14 };
15
16 buildInputs = [ jre pcsclite ];
17 nativeBuildInputs = [ makeWrapper ];
18
19 unpackPhase = "tar -xzf ${src} --strip-components=1";
20
21 preConfigure = ''
22 substituteInPlace eid-viewer.sh.in --replace "exec java" "exec ${jre}/bin/java"
23 '';
24
25 postInstall = ''
26 wrapProgram $out/bin/eid-viewer --suffix LD_LIBRARY_PATH : ${pcsclite}/lib
27 cat >> $out/share/applications/eid-viewer.desktop << EOF
28 # eid-viewer creates XML without a header, making it "plain text":
29 MimeType=application/xml;text/xml;text/plain
30 EOF
31 '';
32
33 doCheck = true;
34
35 meta = with stdenv.lib; {
36 inherit version;
37 description = "Belgian electronic identity card (eID) viewer";
38 homepage = http://eid.belgium.be/en/using_your_eid/installing_the_eid_software/linux/;
39 license = licenses.lgpl3;
40 longDescription = ''
41 A simple, graphical Java application to view, print and save data from
42 Belgian electronic identity cards. Independent of the eid-mw package,
43 which is required to actually use your eID for authentication or signing.
44 '';
45 maintainers = with maintainers; [ nckx ];
46 platforms = with platforms; linux;
47 };
48}