nixpkgs/pkgs/tools/security/pcsc-tools/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

97 lines
2.2 KiB
Nix
Raw Normal View History

{ stdenv
, lib
2023-01-30 04:06:49 +00:00
, fetchFromGitHub
, autoconf-archive
2023-01-30 04:06:49 +00:00
, autoreconfHook
, gobject-introspection
, makeWrapper
, pkg-config
, wrapGAppsHook
, systemd
, dbus
, pcsclite
2023-12-09 08:39:54 +00:00
, PCSC
, wget
, coreutils
, perlPackages
2023-12-07 19:17:03 +00:00
, testers
2023-12-07 19:03:28 +00:00
, nix-update-script
2015-11-13 12:24:03 +00:00
}:
2015-03-09 10:50:44 +00:00
2023-12-07 19:17:03 +00:00
stdenv.mkDerivation (finalAttrs: {
pname = "pcsc-tools";
version = "1.7.0";
2015-03-09 10:50:44 +00:00
2023-01-30 04:06:49 +00:00
src = fetchFromGitHub {
owner = "LudovicRousseau";
2023-12-07 19:17:03 +00:00
repo = "pcsc-tools";
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-tTeSlS1ncpdIaoJsSVgm3zSCogP6S8zlA9hRFocZ/R4=";
2015-03-09 10:50:44 +00:00
};
configureFlags = [
"--datarootdir=${placeholder "out"}/share"
];
buildInputs = [ dbus perlPackages.perl pcsclite ]
2023-12-09 08:39:54 +00:00
++ lib.optional stdenv.isDarwin PCSC
++ lib.optional stdenv.isLinux systemd;
2015-03-09 10:50:44 +00:00
nativeBuildInputs = [
autoconf-archive
autoreconfHook
gobject-introspection
makeWrapper
pkg-config
wrapGAppsHook
];
preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
2015-11-13 12:24:03 +00:00
postInstall = ''
wrapProgram $out/bin/scriptor \
2023-12-09 08:40:05 +00:00
--set PERL5LIB "${with perlPackages; makePerlPath [ ChipcardPCSC libintl-perl ]}"
2015-11-13 12:24:03 +00:00
wrapProgram $out/bin/gscriptor \
''${makeWrapperArgs[@]} \
--set PERL5LIB "${with perlPackages; makePerlPath [
ChipcardPCSC
libintl-perl
GlibObjectIntrospection
Glib
Gtk3
Pango
Cairo
CairoGObject
]}"
2015-11-13 12:24:03 +00:00
wrapProgram $out/bin/ATR_analysis \
--set PERL5LIB "${with perlPackages; makePerlPath [ ChipcardPCSC libintl-perl ]}"
2015-11-13 12:24:03 +00:00
wrapProgram $out/bin/pcsc_scan \
--prefix PATH : "$out/bin:${lib.makeBinPath [ coreutils wget ]}"
install -Dm444 -t $out/share/pcsc smartcard_list.txt
2015-11-13 12:24:03 +00:00
'';
2015-03-09 10:50:44 +00:00
2023-12-07 19:17:03 +00:00
passthru = {
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "pcsc_scan -V";
};
updateScript = nix-update-script { };
};
2023-12-07 19:03:28 +00:00
2015-11-13 12:24:03 +00:00
meta = with lib; {
2015-03-09 10:50:44 +00:00
description = "Tools used to test a PC/SC driver, card or reader";
2023-01-30 04:06:49 +00:00
homepage = "https://pcsc-tools.apdu.fr/";
changelog = "https://github.com/LudovicRousseau/pcsc-tools/releases/tag/${finalAttrs.version}";
2015-03-09 15:01:10 +00:00
license = licenses.gpl2Plus;
mainProgram = "pcsc_scan";
maintainers = with maintainers; [ peterhoeg anthonyroussel ];
2023-12-09 08:39:54 +00:00
platforms = platforms.unix;
2015-03-09 10:50:44 +00:00
};
2023-12-07 19:17:03 +00:00
})