2021-12-06 16:07:01 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, autoreconfHook
|
|
|
|
, glib
|
|
|
|
, gtk3
|
|
|
|
, pcsclite
|
|
|
|
, lua5_2
|
|
|
|
, curl
|
|
|
|
, readline
|
|
|
|
, PCSC
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
|
|
|
version = "0.8.4";
|
|
|
|
in
|
2021-12-06 16:07:01 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "cardpeek";
|
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "L1L1";
|
|
|
|
repo = "cardpeek";
|
|
|
|
rev = "cardpeek-${version}";
|
|
|
|
sha256 = "1ighpl7nvcvwnsd6r5h5n9p95kclwrq99hq7bry7s53yr57l6588";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = lib.optionalString stdenv.isDarwin ''
|
|
|
|
# replace xcode check and hard-coded PCSC framework path
|
|
|
|
substituteInPlace configure.ac \
|
|
|
|
--replace 'if test ! -e "/Applications/Xcode.app/"; then' 'if test yes != yes; then' \
|
|
|
|
--replace 'PCSC_HEADERS=`ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/*.sdk/System/Library/Frameworks/PCSC.framework/Versions/Current/Headers/ | sort | head -1`' 'PCSC_HEADERS=${PCSC}/Library/Frameworks/PCSC.framework/Headers'
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook ];
|
|
|
|
buildInputs = [ glib gtk3 lua5_2 curl readline ]
|
|
|
|
++ lib.optional stdenv.isDarwin PCSC
|
|
|
|
++ lib.optional stdenv.isLinux pcsclite;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/L1L1/cardpeek";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool to read the contents of ISO7816 smart cards";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
maintainers = with maintainers; [ embr ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "cardpeek";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|