diff mbox series

[bug#61018,1/2] gnu: Add perl-pcsc.

Message ID MN2PR20MB2605BBA2E4B956F0C7C6618BACC89@MN2PR20MB2605.namprd20.prod.outlook.com
State New
Headers show
Series Add pcsc-tools, and missing dependency perl-pcsc | expand

Commit Message

Jake Leporte Jan. 23, 2023, 4:39 a.m. UTC
---
 gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index edf47f6..1972830 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -85,6 +85,7 @@  (define-module (gnu packages perl)
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages sdl)
+  #:use-module (gnu packages security-token)
   #:use-module (gnu packages textutils)
   #:use-module (gnu packages video)
   #:use-module (gnu packages web)
@@ -12270,6 +12271,41 @@  (define-public perl-path-iterator-rule
 arduous to type for one-liners.")
     (license license:asl2.0)))
 
+(define-public perl-pcsc
+  (package
+    (name "perl-pcsc")
+    (version "1.4.14")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "mirror://cpan/authors/id/W/WH/WHOM/pcsc-perl-" version
+                    ".tar.bz2"))
+              (sha256
+               (base32
+                "17f6i16jv6ci6459vh6y3sz94vgcvykjjszcl4xsykryakjvf8i7"))))
+    (build-system perl-build-system)
+    (arguments
+     `(;; The tests for this package require access to a
+       ;; card reader with a card inserted, so they won't be
+       ;; possible to run in the build environment
+       #:tests? #f
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'patch-dlopen
+                    (lambda* (#:key inputs #:allow-other-keys)
+                      (substitute* "PCSCperl.h"
+                        (("dlopen\\(\"libpcsclite.so.1\"")
+                         (string-append "dlopen(\""
+                                        (assoc-ref inputs "pcsc-lite")
+                                        "/lib/libpcsclite.so.1\""))))))))
+    (native-inputs (list pkg-config))
+    (inputs (list pcsc-lite))
+    (synopsis "Perl library for PC/SC")
+    (description
+     "This library allows communication with a smart card using PC/SC from a Perl
+script.")
+    (home-page "https://pcsc-perl.apdu.fr/")
+    (license license:gpl2+)))
+
 (define-public perl-pod-constants
   (package
     (name "perl-pod-constants")