Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions pkgs/applications/misc/cardpeek/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
lua5_2,
curl,
readline,
PCSC,
}:
let
version = "0.8.4";
Expand All @@ -29,33 +28,30 @@ stdenv.mkDerivation {
postPatch = lib.optionalString stdenv.hostPlatform.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'
--replace-fail 'if test ! -e "/Applications/Xcode.app/"; then' 'if test yes != yes; then' \
--replace-fail '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=$SDKROOT/System/Library/Frameworks/PCSC.framework/Versions/Current/Headers'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, framework headers are always available if you pass -framework. This is fine, but a better patch would be to drop the PCSC_HEADERS line and replace the -I with -framework PCSC. What it’s currently doing is not idiomatic for the macOS toolchain.

'';

nativeBuildInputs = [
pkg-config
autoreconfHook
];
buildInputs =
[
glib
gtk3
lua5_2
curl
readline
]
++ lib.optional stdenv.hostPlatform.isDarwin PCSC
++ lib.optional stdenv.hostPlatform.isLinux pcsclite;
buildInputs = [
glib
gtk3
lua5_2
curl
readline
] ++ lib.optional stdenv.hostPlatform.isLinux pcsclite;

enableParallelBuilding = true;

meta = with lib; {
meta = {
homepage = "https://github.com/L1L1/cardpeek";
description = "Tool to read the contents of ISO7816 smart cards";
license = licenses.gpl3Plus;
platforms = with platforms; linux ++ darwin;
maintainers = with maintainers; [ embr ];
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ embr ];
mainProgram = "cardpeek";
};
}
4 changes: 1 addition & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2202,9 +2202,7 @@ with pkgs;

catch2_3 = callPackage ../development/libraries/catch2/3.nix { };

cardpeek = callPackage ../applications/misc/cardpeek {
inherit (darwin.apple_sdk.frameworks) PCSC;
};
cardpeek = callPackage ../applications/misc/cardpeek { };

ceres-solver = callPackage ../development/libraries/ceres-solver {
gflags = null; # only required for examples/tests
Expand Down