nixpkgs/pkgs/tools/security/pcsclite/default.nix

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

95 lines
2.4 KiB
Nix
Raw Permalink Normal View History

2020-09-08 14:32:01 +02:00
{ stdenv
, lib
2023-12-06 18:49:26 +01:00
, fetchFromGitLab
2020-09-08 14:32:01 +02:00
, autoreconfHook
2021-10-18 13:56:45 +02:00
, autoconf-archive
, flex
2020-09-08 14:32:01 +02:00
, pkg-config
, perl
, python3
, dbus
, polkit
, systemdLibs
2020-09-08 14:32:01 +02:00
, IOKit
2023-12-06 18:53:21 +01:00
, testers
2023-12-06 18:49:26 +01:00
, nix-update-script
, pname ? "pcsclite"
, polkitSupport ? false
2020-09-08 14:32:01 +02:00
}:
2023-12-06 18:53:21 +01:00
stdenv.mkDerivation (finalAttrs: {
inherit pname;
version = "2.0.3";
outputs = [ "out" "lib" "dev" "doc" "man" ];
2018-06-21 12:40:15 +02:00
2023-12-06 18:49:26 +01:00
src = fetchFromGitLab {
domain = "salsa.debian.org";
owner = "rousseau";
repo = "PCSC";
2023-12-06 18:53:21 +01:00
rev = "refs/tags/${finalAttrs.version}";
hash = "sha256-VDQh2PYAMFwgWvZFD20H3JxgKSFrSUoDLv/6fKEoy5Y=";
};
configureFlags = [
2020-09-08 14:32:01 +02:00
"--enable-confdir=/etc"
2015-08-06 04:25:37 +02:00
# The OS should care on preparing the drivers into this location
"--enable-usbdropdir=/var/lib/pcsc/drivers"
2022-11-07 02:01:06 +01:00
(lib.enableFeature stdenv.isLinux "libsystemd")
(lib.enableFeature polkitSupport "polkit")
] ++ lib.optionals stdenv.isLinux [
2020-09-08 14:32:01 +02:00
"--enable-ipcdir=/run/pcscd"
"--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
];
makeFlags = [
"POLICY_DIR=$(out)/share/polkit-1/actions"
];
# disable building pcsc-wirecheck{,-gen} when cross compiling
# see also: https://github.com/LudovicRousseau/PCSC/issues/25
postPatch = lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
substituteInPlace src/Makefile.am \
--replace "noinst_PROGRAMS = testpcsc pcsc-wirecheck pcsc-wirecheck-gen" \
"noinst_PROGRAMS = testpcsc"
'';
2018-06-21 12:40:15 +02:00
postInstall = ''
# pcsc-spy is a debugging utility and it drags python into the closure
moveToOutput bin/pcsc-spy "$dev"
'';
2020-09-08 14:32:01 +02:00
enableParallelBuilding = true;
nativeBuildInputs = [
autoreconfHook
autoconf-archive
flex
pkg-config
perl
];
buildInputs = [ python3 ]
++ lib.optionals stdenv.isLinux [ systemdLibs ]
++ lib.optionals stdenv.isDarwin [ IOKit ]
++ lib.optionals polkitSupport [ dbus polkit ];
2023-12-06 18:53:21 +01:00
passthru = {
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "pcscd --version";
};
updateScript = nix-update-script { };
};
2023-12-06 18:39:52 +01:00
meta = with lib; {
description = "Middleware to access a smart card using SCard API (PC/SC)";
homepage = "https://pcsclite.apdu.fr/";
changelog = "https://salsa.debian.org/rousseau/PCSC/-/blob/${finalAttrs.version}/ChangeLog";
2014-03-21 22:32:21 +01:00
license = licenses.bsd3;
mainProgram = "pcscd";
maintainers = [ maintainers.anthonyroussel ];
2015-12-03 19:13:31 +01:00
platforms = with platforms; unix;
};
2023-12-06 18:53:21 +01:00
})