nixpkgs/pkgs/tools/security/pcsc-tools/default.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

143 lines
3.0 KiB
Nix

{
stdenv,
lib,
fetchFromGitHub,
autoconf-archive,
autoreconfHook,
gobject-introspection,
makeWrapper,
pkg-config,
wrapGAppsHook3,
systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd,
systemd,
dbusSupport ? stdenv.hostPlatform.isLinux,
dbus,
pcsclite,
PCSC,
wget,
coreutils,
perlPackages,
testers,
nix-update-script,
# gui does not cross compile properly
withGui ? stdenv.buildPlatform.canExecute stdenv.hostPlatform,
}:
assert systemdSupport -> dbusSupport;
stdenv.mkDerivation (finalAttrs: {
pname = "pcsc-tools";
version = "1.7.2";
src = fetchFromGitHub {
owner = "LudovicRousseau";
repo = "pcsc-tools";
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-5a3sVcFEFzBkbRKUqlCPV7sL3O17G7hDVpxLpAWofdE=";
};
configureFlags = [
"--datarootdir=${placeholder "out"}/share"
];
buildInputs =
lib.optionals dbusSupport [
dbus
]
++ [
perlPackages.perl
pcsclite
]
++ lib.optional stdenv.hostPlatform.isDarwin PCSC
++ lib.optional systemdSupport systemd;
nativeBuildInputs =
[
autoconf-archive
autoreconfHook
makeWrapper
pkg-config
]
++ lib.optionals withGui [
gobject-introspection
wrapGAppsHook3
];
preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
postInstall =
''
wrapProgram $out/bin/scriptor \
--set PERL5LIB "${
with perlPackages;
makePerlPath [
ChipcardPCSC
libintl-perl
]
}"
''
+ lib.optionalString withGui ''
wrapProgram $out/bin/gscriptor \
''${makeWrapperArgs[@]} \
--set PERL5LIB "${
with perlPackages;
makePerlPath [
ChipcardPCSC
libintl-perl
GlibObjectIntrospection
Glib
Gtk3
Pango
Cairo
CairoGObject
]
}"
''
+ ''
wrapProgram $out/bin/ATR_analysis \
--set PERL5LIB "${
with perlPackages;
makePerlPath [
ChipcardPCSC
libintl-perl
]
}"
wrapProgram $out/bin/pcsc_scan \
--prefix PATH : "$out/bin:${
lib.makeBinPath [
coreutils
wget
]
}"
install -Dm444 -t $out/share/pcsc smartcard_list.txt
'';
passthru = {
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "pcsc_scan -V";
};
updateScript = nix-update-script { };
};
meta = with lib; {
description = "Tools used to test a PC/SC driver, card or reader";
homepage = "https://pcsc-tools.apdu.fr/";
changelog = "https://github.com/LudovicRousseau/pcsc-tools/releases/tag/${finalAttrs.version}";
license = licenses.gpl2Plus;
mainProgram = "pcsc_scan";
maintainers = with maintainers; [
peterhoeg
anthonyroussel
];
platforms = platforms.unix;
};
})