guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#61018] [PATCH v7 2/2] gnu: Add pcsc-tools.


From: Jake Leporte
Subject: [bug#61018] [PATCH v7 2/2] gnu: Add pcsc-tools.
Date: Sun, 5 Mar 2023 19:30:27 -0600

* gnu/packages/security-token.scm (pcsc-tools): New variable.
---
 gnu/packages/security-token.scm | 62 +++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index a7f5e3a..41cbafd 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -48,6 +48,7 @@ (define-module (gnu packages security-token)
   #:use-module (guix build-system python)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
@@ -253,6 +254,67 @@ (define-public pcsc-lite
                    license:isc                  ; src/strlcat.c src/strlcpy.c
                    license:gpl3+))))            ; src/spy/*
 
+(define-public pcsc-tools
+  (package
+    (name "pcsc-tools")
+    (version "1.6.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://salsa.debian.org/rousseau/pcsc-tools.git/";)
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "16kvw8y5289fp6y3z8l5w61gfrk872kd500a27sgr5k5dpr9vfbk"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'patch-data-paths
+                 (lambda _
+                   (substitute* "ATR_analysis"
+                     (((string-append
+                        "\"/usr/local/pcsc/smartcard_list.txt\", "
+                        "\"/usr/share/pcsc/smartcard_list.txt\", "
+                        "\"/usr/local/share/pcsc/smartcard_list.txt\""))
+                      (string-append "\""
+                                     #$output
+                                     "/share/pcsc/smartcard_list.txt\"")))
+                   (substitute* "ATR_analysis.1p"
+                     (("^([.]IR [.]/) ,\n$" _ cwd)
+                      (string-append cwd "\n"))
+                     (("^[.]I /usr/local/pcsc/\n$")
+                      "")
+                     (("/usr/share/pcsc/\n$")
+                      (string-append #$output "/share/pcsc/\n")))))
+               (add-after 'patch-shebangs 'wrap-programs
+                 (lambda _
+                   (for-each
+                    (lambda (prog)
+                      (wrap-program (string-append #$output
+                                                   "/bin/"
+                                                   prog)
+                        `("PERL5LIB" =
+                          (,(getenv "PERL5LIB")))))
+                    '("ATR_analysis" "gscriptor" "scriptor"))
+                   (wrap-program (string-append #$output
+                                                "/bin/gscriptor")
+                     `("GI_TYPELIB_PATH" =
+                       (,(getenv "GI_TYPELIB_PATH")))))))))
+    (native-inputs (list autoconf automake libtool gnu-gettext pkg-config))
+    (inputs (list bash-minimal ;for wrap-program
+                  perl
+                  perl-pcsc
+                  perl-gtk3
+                  pcsc-lite))
+    (synopsis "Tools for use with smart cards and PC/SC")
+    (description
+     "This package provides @code{pcsc_scan}, @code{ATR_analysis}, 
@code{scriptor},
+and @code{gscriptor}.")
+    (home-page "https://pcsc-tools.apdu.fr/";)
+    (license license:gpl2+)))
+
 (define-public ykclient
   (package
     (name "ykclient")
-- 
2.39.1






reply via email to

[Prev in Thread] Current Thread [Next in Thread]