Skip to content

Commit 12e2857

Browse files
committedMar 23, 2025
globalplatform: init at 2.4.0-unreleased
1 parent a84ebe2 commit 12e2857

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed
 
+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
makeWrapper,
16+
}:
17+
18+
stdenv.mkDerivation (finalAttrs: {
19+
pname = "globalplatform";
20+
version = "2.4.0-unreleased";
21+
22+
src = fetchFromGitHub {
23+
owner = "kaoh";
24+
repo = "globalplatform";
25+
rev = "c901eabd771379e43ebd71bcf8071398b868a591";
26+
sha256 = "sha256-dGbGDDlQ01crqS9J1cTd9xNpagKgdV+ha4HtnPK8SZo=";
27+
};
28+
29+
nativeBuildInputs = [
30+
pkg-config
31+
cmake
32+
pandoc
33+
doxygen
34+
graphviz
35+
makeWrapper
36+
];
37+
38+
buildInputs =
39+
[
40+
zlib
41+
openssl
42+
]
43+
++ lib.optionals stdenv.hostPlatform.isLinux [
44+
pcsclite
45+
]
46+
++ lib.optionals stdenv.hostPlatform.isDarwin [
47+
PCSC
48+
];
49+
50+
cmakeFlags = [
51+
"-DTESTING=ON"
52+
];
53+
54+
doCheck = true;
55+
56+
nativeCheckInputs = [
57+
cmocka
58+
];
59+
60+
preCheck = ''
61+
cp "$src/gpshell/helloworld.cap" globalplatform/src
62+
cp "$src/globalplatform/src/rsa_pub_key_test.pem" globalplatform/src
63+
'';
64+
65+
# gpshell uses dlopen() to load libgppcscconnectionplugin.so at runtime
66+
67+
wrapperArgs =
68+
lib.optionals stdenv.hostPlatform.isLinux [
69+
"--prefix LD_LIBRARY_PATH : ${placeholder "out"}/lib"
70+
]
71+
++ lib.optionals stdenv.hostPlatform.isDarwin [
72+
"--prefix DYLD_LIBRARY_PATH : ${placeholder "out"}/lib"
73+
];
74+
75+
preFixup = ''
76+
wrapProgram $out/bin/gpshell $wrapperArgs
77+
'';
78+
79+
meta = {
80+
description = "C library + command-line for Open- / GlobalPlatform smart cards";
81+
mainProgram = "gpshell";
82+
homepage = "https://github.com/kaoh/globalplatform";
83+
license = lib.licenses.gpl3Only;
84+
platforms = lib.platforms.linux ++ lib.platforms.darwin;
85+
maintainers = with lib.maintainers; [ stargate01 ];
86+
};
87+
})

‎pkgs/top-level/all-packages.nix

+4
Original file line numberDiff line numberDiff line change
@@ -3375,6 +3375,10 @@ with pkgs;
33753375

33763376
gitqlient = libsForQt5.callPackage ../applications/version-management/gitqlient { };
33773377

3378+
globalplatform = callPackage ../by-name/gl/globalplatform/package.nix {
3379+
inherit (darwin.apple_sdk.frameworks) PCSC;
3380+
};
3381+
33783382
glogg = libsForQt5.callPackage ../tools/text/glogg { };
33793383

33803384
gmrender-resurrect = callPackage ../tools/networking/gmrender-resurrect {

0 commit comments

Comments
 (0)
Failed to load comments.