diff options
author | Domen Kožar <domen@dev.si> | 2021-11-17 00:34:44 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 00:34:44 -0600 |
commit | 5b14843fc97c38fdaf78a4aeb1612c22ac2ce894 (patch) | |
tree | 57a6dee0372d17041091aa72d5087a044b311c85 /pkgs/applications | |
parent | c138eff31574ff1b89ffd5132af7df30c0bfaa4a (diff) | |
parent | ef1a0dab00af56bf99d248143a9518826d943d80 (diff) |
Merge pull request #146210 from flurie/fix-cardpeek-darwin
cardpeek: fix build on darwin
Diffstat (limited to 'pkgs/applications')
-rw-r--r-- | pkgs/applications/misc/cardpeek/default.nix | 65 |
1 files changed, 43 insertions, 22 deletions
diff --git a/pkgs/applications/misc/cardpeek/default.nix b/pkgs/applications/misc/cardpeek/default.nix index 1d5baf9f6b348..adabcdac9542d 100644 --- a/pkgs/applications/misc/cardpeek/default.nix +++ b/pkgs/applications/misc/cardpeek/default.nix @@ -1,29 +1,50 @@ -{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook, - glib, gtk3, pcsclite, lua5_2, curl, readline }: +{ lib +, stdenv +, fetchFromGitHub +, pkg-config +, autoreconfHook +, glib +, gtk3 +, pcsclite +, lua5_2 +, curl +, readline +, PCSC +, xcbuild +}: let version = "0.8.4"; in - stdenv.mkDerivation { - pname = "cardpeek"; - inherit version; +stdenv.mkDerivation { + pname = "cardpeek"; + inherit version; - src = fetchFromGitHub { - owner = "L1L1"; - repo = "cardpeek"; - rev = "cardpeek-${version}"; - sha256 = "1ighpl7nvcvwnsd6r5h5n9p95kclwrq99hq7bry7s53yr57l6588"; - }; + src = fetchFromGitHub { + owner = "L1L1"; + repo = "cardpeek"; + rev = "cardpeek-${version}"; + sha256 = "1ighpl7nvcvwnsd6r5h5n9p95kclwrq99hq7bry7s53yr57l6588"; + }; - nativeBuildInputs = [ pkg-config autoreconfHook ]; - buildInputs = [ glib gtk3 pcsclite lua5_2 curl readline ]; + 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' + ''; - enableParallelBuilding = true; + nativeBuildInputs = [ pkg-config autoreconfHook ]; + buildInputs = [ glib gtk3 lua5_2 curl readline ] + ++ lib.optional stdenv.isDarwin PCSC + ++ lib.optional stdenv.isLinux pcsclite; - meta = with lib; { - homepage = "https://github.com/L1L1/cardpeek"; - description = "A tool to read the contents of ISO7816 smart cards"; - license = licenses.gpl3Plus; - platforms = with platforms; linux ++ darwin; - maintainers = with maintainers; [ embr ]; - }; - } + enableParallelBuilding = true; + + meta = with lib; { + homepage = "https://github.com/L1L1/cardpeek"; + description = "A tool to read the contents of ISO7816 smart cards"; + license = licenses.gpl3Plus; + platforms = with platforms; linux ++ darwin; + maintainers = with maintainers; [ embr ]; + }; +} |