Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
81 lines
1.8 KiB
Nix
81 lines
1.8 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
pcsclite,
|
|
pkg-config,
|
|
cmake,
|
|
zlib,
|
|
pandoc,
|
|
doxygen,
|
|
graphviz,
|
|
openssl,
|
|
cmocka,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "globalplatform";
|
|
version = "2.4.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "kaoh";
|
|
repo = "globalplatform";
|
|
tag = finalAttrs.version;
|
|
sha256 = "sha256-ikhncinibeQjcpYstduYhWS/bvwRah6+wrWF9kutSOI=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
cmake
|
|
pandoc
|
|
doxygen
|
|
graphviz
|
|
];
|
|
|
|
buildInputs = [
|
|
zlib
|
|
openssl
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
pcsclite
|
|
];
|
|
|
|
cmakeFlags = [
|
|
"-DTESTING=ON"
|
|
];
|
|
|
|
doCheck = true;
|
|
|
|
nativeCheckInputs = [
|
|
cmocka
|
|
];
|
|
|
|
preCheck = ''
|
|
cp "$src/gpshell/helloworld.cap" globalplatform/src
|
|
cp "$src/globalplatform/src/rsa_pub_key_test.pem" globalplatform/src
|
|
'';
|
|
|
|
# libglobalplatform.so uses dlopen() to load specified connection plugins at runtime.
|
|
# Currently, libgppcscconnectionplugin.so is the only plugin included.
|
|
# The user has to specify custom plugin locations by setting LD_LIBRARY_PATH.
|
|
|
|
postFixup =
|
|
lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
patchelf $out/lib/libglobalplatform.so --add-rpath "$out/lib"
|
|
''
|
|
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
install_name_tool -add_rpath "$out/lib" "$out/lib/libglobalplatform.dylib"
|
|
'';
|
|
|
|
meta = {
|
|
description = "C library + command-line for Open- / GlobalPlatform smart cards";
|
|
mainProgram = "gpshell";
|
|
homepage = "https://github.com/kaoh/globalplatform";
|
|
# Clarify license for GPShell
|
|
# https://github.com/kaoh/globalplatform/issues/81
|
|
license = lib.licenses.gpl3Plus;
|
|
platforms = lib.platforms.linux ++ lib.platforms.darwin;
|
|
maintainers = with lib.maintainers; [ stargate01 ];
|
|
};
|
|
})
|