summary refs log tree commit diff
path: root/pkgs/tools/security/pcsclite
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2020-09-08 20:32:01 +0800
committerPeter Hoeg <peter@hoeg.com>2021-04-03 19:09:48 +0800
commit2b93e96d0bdf5cd98c6d7bd60af6e4dded4ab3d1 (patch)
treee6be346a10a78552f0f34188eafb695481be49f0 /pkgs/tools/security/pcsclite
parentc1db6868bb2c8b4ef6bdb11b8e533fa29423efa6 (diff)
downloadnixpkgs-2b93e96d0bdf5cd98c6d7bd60af6e4dded4ab3d1.tar
nixpkgs-2b93e96d0bdf5cd98c6d7bd60af6e4dded4ab3d1.tar.gz
nixpkgs-2b93e96d0bdf5cd98c6d7bd60af6e4dded4ab3d1.tar.bz2
nixpkgs-2b93e96d0bdf5cd98c6d7bd60af6e4dded4ab3d1.tar.lz
nixpkgs-2b93e96d0bdf5cd98c6d7bd60af6e4dded4ab3d1.tar.xz
nixpkgs-2b93e96d0bdf5cd98c6d7bd60af6e4dded4ab3d1.tar.zst
nixpkgs-2b93e96d0bdf5cd98c6d7bd60af6e4dded4ab3d1.zip
pcsclite: add policy kit support
Diffstat (limited to 'pkgs/tools/security/pcsclite')
-rw-r--r--pkgs/tools/security/pcsclite/default.nix38
1 files changed, 30 insertions, 8 deletions
diff --git a/pkgs/tools/security/pcsclite/default.nix b/pkgs/tools/security/pcsclite/default.nix
index 2a75c409305..71bd13c4a72 100644
--- a/pkgs/tools/security/pcsclite/default.nix
+++ b/pkgs/tools/security/pcsclite/default.nix
@@ -1,4 +1,15 @@
-{ lib, stdenv, fetchurl, pkg-config, udev, dbus, perl, python3, IOKit }:
+{ stdenv
+, lib
+, fetchurl
+, autoreconfHook
+, pkg-config
+, perl
+, python3
+, dbus
+, polkit
+, systemd
+, IOKit
+}:
 
 stdenv.mkDerivation rec {
   pname = "pcsclite";
@@ -13,14 +24,23 @@ stdenv.mkDerivation rec {
 
   patches = [ ./no-dropdir-literals.patch ];
 
+  postPatch = ''
+    sed -i configure.ac \
+      -e "s@polkit_policy_dir=.*@polkit_policy_dir=$bin/share/polkit-1/actions@"
+  '';
+
   configureFlags = [
+    "--enable-confdir=/etc"
     # The OS should care on preparing the drivers into this location
     "--enable-usbdropdir=/var/lib/pcsc/drivers"
-    "--enable-confdir=/etc"
-  ] ++ lib.optional stdenv.isLinux
-    "--with-systemdsystemunitdir=\${out}/etc/systemd/system"
-  ++ lib.optional (!stdenv.isLinux)
-    "--disable-libsystemd";
+  ]
+  ++ (if stdenv.isLinux then [
+    "--enable-ipcdir=/run/pcscd"
+    "--enable-polkit"
+    "--with-systemdsystemunitdir=${placeholder "bin"}/lib/systemd/system"
+  ] else [
+    "--disable-libsystemd"
+  ]);
 
   postConfigure = ''
     sed -i -re '/^#define *PCSCLITE_HP_DROPDIR */ {
@@ -33,10 +53,12 @@ stdenv.mkDerivation rec {
     moveToOutput bin/pcsc-spy "$dev"
   '';
 
-  nativeBuildInputs = [ pkg-config perl ];
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ autoreconfHook pkg-config perl ];
 
   buildInputs = [ python3 ]
-    ++ lib.optionals stdenv.isLinux [ udev dbus ]
+    ++ lib.optionals stdenv.isLinux [ dbus polkit systemd ]
     ++ lib.optionals stdenv.isDarwin [ IOKit ];
 
   meta = with lib; {