2 files changed +85
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ lib ,
3
+ stdenv ,
4
+ fetchFromGitHub ,
5
+ pcsclite ,
6
+ PCSC ,
7
+ pkg-config ,
8
+ cmake ,
9
+ zlib ,
10
+ pandoc ,
11
+ doxygen ,
12
+ graphviz ,
13
+ openssl ,
14
+ cmocka ,
15
+ } :
16
+
17
+ stdenv . mkDerivation ( finalAttrs : {
18
+ pname = "globalplatform" ;
19
+ version = "2.4.0-unreleased" ;
20
+
21
+ src = fetchFromGitHub {
22
+ owner = "kaoh" ;
23
+ repo = "globalplatform" ;
24
+ rev = "0f970751c5d9e8a7030f897ca2d1b86d0eeba4c2" ;
25
+ sha256 = "sha256-H/muc/gY5glXPWKj75fHi6+1DAP91YGAUefdQkX9nfk=" ;
26
+ } ;
27
+
28
+ nativeBuildInputs = [
29
+ pkg-config
30
+ cmake
31
+ pandoc
32
+ doxygen
33
+ graphviz
34
+ ] ;
35
+
36
+ buildInputs =
37
+ [
38
+ zlib
39
+ openssl
40
+ ]
41
+ ++ lib . optionals stdenv . hostPlatform . isLinux [
42
+ pcsclite
43
+ ]
44
+ ++ lib . optionals stdenv . hostPlatform . isDarwin [
45
+ PCSC
46
+ ] ;
47
+
48
+ cmakeFlags = [
49
+ "-DTESTING=ON"
50
+ ] ;
51
+
52
+ doCheck = true ;
53
+
54
+ nativeCheckInputs = [
55
+ cmocka
56
+ ] ;
57
+
58
+ preCheck = ''
59
+ cp "$src/gpshell/helloworld.cap" globalplatform/src
60
+ cp "$src/globalplatform/src/rsa_pub_key_test.pem" globalplatform/src
61
+ '' ;
62
+
63
+ # libglobalplatform.so uses dlopen() to load specified connection plugins at runtime.
64
+ # Currently, libgppcscconnectionplugin.so is the only plugin included.
65
+ # The user has to specify custom plugin locations by setting LD_LIBRARY_PATH.
66
+
67
+ postFixup = ''
68
+ patchelf $out/lib/libglobalplatform.so --add-rpath "$out/lib"
69
+ '' ;
70
+
71
+ meta = {
72
+ description = "C library + command-line for Open- / GlobalPlatform smart cards" ;
73
+ mainProgram = "gpshell" ;
74
+ homepage = "https://github.com/kaoh/globalplatform" ;
75
+ # Clarify license for GPShell
76
+ # https://github.com/kaoh/globalplatform/issues/81
77
+ license = lib . licenses . gpl3Plus ;
78
+ platforms = lib . platforms . linux ++ lib . platforms . darwin ;
79
+ maintainers = with lib . maintainers ; [ stargate01 ] ;
80
+ } ;
81
+ } )
Original file line number Diff line number Diff line change @@ -3375,6 +3375,10 @@ with pkgs;
3375
3375
3376
3376
gitqlient = libsForQt5.callPackage ../applications/version-management/gitqlient { };
3377
3377
3378
+ globalplatform = callPackage ../by-name/gl/globalplatform/package.nix {
3379
+ inherit (darwin.apple_sdk.frameworks) PCSC;
3380
+ };
3381
+
3378
3382
glogg = libsForQt5.callPackage ../tools/text/glogg { };
3379
3383
3380
3384
gmrender-resurrect = callPackage ../tools/networking/gmrender-resurrect {
0 commit comments