Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / misc / cardpeek / default.nix
blobadabcdac9542dd70887d79f572c324cf23130ca9
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , pkg-config
5 , autoreconfHook
6 , glib
7 , gtk3
8 , pcsclite
9 , lua5_2
10 , curl
11 , readline
12 , PCSC
13 , xcbuild
15 let
16   version = "0.8.4";
18 stdenv.mkDerivation {
19   pname = "cardpeek";
20   inherit version;
22   src = fetchFromGitHub {
23     owner = "L1L1";
24     repo = "cardpeek";
25     rev = "cardpeek-${version}";
26     sha256 = "1ighpl7nvcvwnsd6r5h5n9p95kclwrq99hq7bry7s53yr57l6588";
27   };
29   postPatch = lib.optionalString stdenv.isDarwin ''
30     # replace xcode check and hard-coded PCSC framework path
31     substituteInPlace configure.ac \
32       --replace 'if test ! -e "/Applications/Xcode.app/"; then' 'if test yes != yes; then' \
33       --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'
34   '';
36   nativeBuildInputs = [ pkg-config autoreconfHook ];
37   buildInputs = [ glib gtk3 lua5_2 curl readline ]
38     ++ lib.optional stdenv.isDarwin PCSC
39     ++ lib.optional stdenv.isLinux pcsclite;
41   enableParallelBuilding = true;
43   meta = with lib; {
44     homepage = "https://github.com/L1L1/cardpeek";
45     description = "A tool to read the contents of ISO7816 smart cards";
46     license = licenses.gpl3Plus;
47     platforms = with platforms; linux ++ darwin;
48     maintainers = with maintainers; [ embr ];
49   };