[PATCH 0/2] Add pcsc-tools, and missing dependency perl-pcsc

  • Done
  • quality assurance status badge
Details
2 participants
  • Jake Leporte
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Jake Leporte
Severity
normal
J
J
Jake Leporte wrote on 23 Jan 2023 05:29
(address . guix-patches@gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB26056405D5D05425ED070BC1ACC89@MN2PR20MB2605.namprd20.prod.outlook.com
This patch series adds PCSC Tools, which is a set of utilities useful for
debugging a smart card setup.

The `gscriptor' component doesn't seem to be working, but on my end, that
seems like a problem with `perl-gtk3' on Guix. At any rate, the other PCSC
Tools are working, and since they are recommended in several smart card setup
tutorials for GNU/Linux, they would be nice to have in the distribution.

Jake Leporte (2):
gnu: Add perl-pcsc.
gnu: Add pcsc-tools.

gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++
gnu/packages/security-token.scm | 42 +++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+)


base-commit: 2b1e5cb6a82e60298b620ef8d2dbf90cfb925015
prerequisite-patch-id: 55ebfdbee35b36ac06da23b716337ecfef350452
prerequisite-patch-id: 12b9437ce6c6849e83e52cabad56672a5c73e2a7
prerequisite-patch-id: 52c97b6e4d8d4b78217423a3f1323d95a609de8c
prerequisite-patch-id: 213e646246e9cda4b2da70df3f2b3f9eb09612a2
--
2.34.1
J
J
Jake Leporte wrote on 23 Jan 2023 05:39
[PATCH 1/2] gnu: Add perl-pcsc.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB2605BBA2E4B956F0C7C6618BACC89@MN2PR20MB2605.namprd20.prod.outlook.com
---
gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (56 lines)
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")
--
2.34.1
J
J
Jake Leporte wrote on 23 Jan 2023 05:40
[PATCH 2/2] gnu: Add pcsc-tools.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB2605D6978F03AC0933A15E53ACC89@MN2PR20MB2605.namprd20.prod.outlook.com
---
gnu/packages/security-token.scm | 42 +++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)

Toggle diff (55 lines)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 619be42..162c3d5 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -253,6 +253,48 @@ (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"))))))))
+ (native-inputs (list autoconf automake libtool gnu-gettext pkg-config))
+ (inputs (list pcsc-lite))
+ (propagated-inputs (list perl perl-pcsc perl-gtk3))
+ (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.34.1
J
J
Jake Leporte wrote on 24 Jan 2023 00:01
[PATCH v2] gnu: Add perl-pcsc.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB260511B08280E765D75EC451ACC89@MN2PR20MB2605.namprd20.prod.outlook.com
I've been notified that another one of my patches used the old "assoc-ref"-style
code, and noticed that I had done the same for my `perl-pcsc` patch. I've now
updated this patch to use the new G-Exps style.

---
gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (62 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index edf47f6..61ade11 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
+ (list
+ ;; 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"
+ (("libpcsclite.so.1")
+ (search-input-file inputs
+ "/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")

base-commit: 2b1e5cb6a82e60298b620ef8d2dbf90cfb925015
prerequisite-patch-id: 55ebfdbee35b36ac06da23b716337ecfef350452
prerequisite-patch-id: 12b9437ce6c6849e83e52cabad56672a5c73e2a7
prerequisite-patch-id: 52c97b6e4d8d4b78217423a3f1323d95a609de8c
prerequisite-patch-id: c95a220593ae5d078a06605d9b0b228ab2c9592c
--
2.34.1
J
J
Jake Leporte wrote on 27 Jan 2023 03:26
[PATCH v2] gnu: Add pcsc-tools.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB26050D3875BB073653E109A5ACCC9@MN2PR20MB2605.namprd20.prod.outlook.com
After finally understanding wrap-program, I've corrected the `pcsc-tools'
package definition. Everything, including `gscriptor', now works properly.

---
gnu/packages/security-token.scm | 67 +++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)

Toggle diff (87 lines)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 619be42..e57c919 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -253,6 +253,73 @@ (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-source-shebangs 'patch-env-shebangs
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* '("ATR_analysis" "gscriptor"
+ "scriptor")
+ (("/usr/bin/env perl")
+ (search-input-file inputs "/bin/perl")))))
+ (add-after 'patch-shebangs 'wrap-programs
+ (lambda _
+ (for-each (lambda (prog)
+ (wrap-program (string-append #$output
+ "/bin/"
+ prog)
+ `("PERL5LIB" =
+ (,(getenv "PERL5LIB") ,
+ (string-append #$(this-package-input
+ "perl-gtk3")
+ "/lib/perl5/site_perl")))))
+ '("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")

base-commit: 2b1e5cb6a82e60298b620ef8d2dbf90cfb925015
prerequisite-patch-id: 55ebfdbee35b36ac06da23b716337ecfef350452
prerequisite-patch-id: 12b9437ce6c6849e83e52cabad56672a5c73e2a7
prerequisite-patch-id: 52c97b6e4d8d4b78217423a3f1323d95a609de8c
prerequisite-patch-id: 90b350ab4778843697da28bb10344a84ccacc70c
prerequisite-patch-id: 0d5a1f7cfe93822a3f3b11c19f4b2662a79cda17
--
2.34.1
J
J
Jake Leporte wrote on 27 Jan 2023 18:37
[PATCH v3 1/2] gnu: Add perl-pcsc.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB2605BE7594F38FE99EF86CDCACCC9@MN2PR20MB2605.namprd20.prod.outlook.com
I made a mistake and sent a bad patch in my last message. Just to be clear, I'm
re-sending the two-patch series with my most recent, working patches. I
apologize for the mistake.

---
gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (62 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index edf47f6..61ade11 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
+ (list
+ ;; 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"
+ (("libpcsclite.so.1")
+ (search-input-file inputs
+ "/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")

base-commit: dbf965dd7b76dfa50ee80e037a7404e163b9917c
prerequisite-patch-id: 55ebfdbee35b36ac06da23b716337ecfef350452
prerequisite-patch-id: 6cb7b2d1972d3eeb5ad8b82239b17043e7263ab0
prerequisite-patch-id: 52c97b6e4d8d4b78217423a3f1323d95a609de8c
prerequisite-patch-id: 90b350ab4778843697da28bb10344a84ccacc70c
--
2.34.1
J
J
Jake Leporte wrote on 27 Jan 2023 18:37
[PATCH v3 2/2] gnu: Add pcsc-tools.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB2605A1D89CF2C42969673341ACCC9@MN2PR20MB2605.namprd20.prod.outlook.com
---
gnu/packages/security-token.scm | 65 +++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)

Toggle diff (85 lines)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 619be42..45f4f27 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,70 @@ (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") ,
+ (string-append #$(this-package-input
+ "perl-gtk3")
+ "/lib/perl5/site_perl")))))
+ '("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.34.1
J
J
Jake Leporte wrote on 28 Jan 2023 03:57
[PATCH v4] gnu: Add pcsc-tools.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB2605E1B9AE9D1BA793F51DCDACCD9@MN2PR20MB2605.namprd20.prod.outlook.com
---
gnu/packages/security-token.scm | 62 +++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)

Toggle diff (82 lines)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 619be42..cddb438 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.34.1
J
J
Jake Leporte wrote on 18 Feb 2023 01:36
[PATCH v5 1/2] gnu: Add perl-pcsc.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB26059BE67AC58AC990B3393DACA69@MN2PR20MB2605.namprd20.prod.outlook.com
Re-submitting full patch series with bumped version number in order to
run QA.

---
gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (60 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index 62f19ed..4d8a9d1 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -86,6 +86,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)
@@ -12271,6 +12272,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
+ (list
+ ;; 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"
+ (("libpcsclite.so.1")
+ (search-input-file inputs
+ "/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")

base-commit: 6dce27abbba01cb4e249c9bdb3c132cecc0a5c51
prerequisite-patch-id: 55ebfdbee35b36ac06da23b716337ecfef350452
prerequisite-patch-id: cc81d1d3eb9c0687793c8baf949901cd49c42650
prerequisite-patch-id: 52c97b6e4d8d4b78217423a3f1323d95a609de8c
prerequisite-patch-id: 90b350ab4778843697da28bb10344a84ccacc70c
--
2.39.1
J
J
Jake Leporte wrote on 18 Feb 2023 01:36
[PATCH v5 2/2] gnu: Add pcsc-tools.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB260564983C8A0605C189166FACA69@MN2PR20MB2605.namprd20.prod.outlook.com
Worked with the upstream developer to use m4 to substitute the correct
pcsc_dir value during configure, so the `patch-data-paths' phase will
be unneccessary in the next release.

---
gnu/packages/security-token.scm | 62 +++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)

Toggle diff (80 lines)
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
J
J
Jake Leporte wrote on 27 Feb 2023 01:42
[PATCH v6 0/2] Add pcsc-tools and dependency.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB260533C032E94C774F80B6EEACAF9@MN2PR20MB2605.namprd20.prod.outlook.com
Re-submitting with proper commit messages, and hoping to get QA to succeed.

Jake Leporte (2):
gnu: Add perl-pcsc.
gnu: Add pcsc-tools.

gnu/packages/perl.scm | 36 +++++++++++++++++++
gnu/packages/security-token.scm | 62 +++++++++++++++++++++++++++++++++
2 files changed, 98 insertions(+)


base-commit: 81fbf5d71fb95367a0a93e45a86de5e930589a05
prerequisite-patch-id: 55ebfdbee35b36ac06da23b716337ecfef350452
prerequisite-patch-id: cc81d1d3eb9c0687793c8baf949901cd49c42650
prerequisite-patch-id: 52c97b6e4d8d4b78217423a3f1323d95a609de8c
prerequisite-patch-id: 90b350ab4778843697da28bb10344a84ccacc70c
--
2.39.1
J
J
Jake Leporte wrote on 27 Feb 2023 01:42
[PATCH v6 1/2] gnu: Add perl-pcsc.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB260576229538DE036720E5BBACAF9@MN2PR20MB2605.namprd20.prod.outlook.com
* gnu/packages/perl.scm (perl-pcsc): New variable.
---
gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (56 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index b6fb81e..a1a9983 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -86,6 +86,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)
@@ -12269,6 +12270,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
+ (list
+ ;; 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"
+ (("libpcsclite.so.1")
+ (search-input-file inputs
+ "/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")
--
2.39.1
J
J
Jake Leporte wrote on 27 Feb 2023 01:42
[PATCH v6 2/2] gnu: Add pcsc-tools.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB2605E95842D8C54DA733762CACAF9@MN2PR20MB2605.namprd20.prod.outlook.com
* gnu/packages/security-token.scm (pcsc-tools): New variable.
---
gnu/packages/security-token.scm | 62 +++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)

Toggle diff (82 lines)
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
J
J
Jake Leporte wrote on 6 Mar 2023 02:30
[PATCH v7 1/2] gnu: Add perl-pcsc.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB26051C7816FD8FB469354D27ACB69@MN2PR20MB2605.namprd20.prod.outlook.com
* gnu/packages/perl.scm (perl-pcsc): New variable.
---
gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)

Toggle diff (62 lines)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index b6fb81e..a1a9983 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -86,6 +86,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)
@@ -12269,6 +12270,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
+ (list
+ ;; 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"
+ (("libpcsclite.so.1")
+ (search-input-file inputs
+ "/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")

base-commit: bbf88ad4e0cf98c2899542897c7a78ee4005c913
prerequisite-patch-id: 55ebfdbee35b36ac06da23b716337ecfef350452
prerequisite-patch-id: cc81d1d3eb9c0687793c8baf949901cd49c42650
prerequisite-patch-id: 52c97b6e4d8d4b78217423a3f1323d95a609de8c
prerequisite-patch-id: 76ab662c68c7b45a8c84eab1ec3dadc60a886ac3
--
2.39.1
J
J
Jake Leporte wrote on 6 Mar 2023 02:30
[PATCH v7 2/2] gnu: Add pcsc-tools.
(address . 61018@debbugs.gnu.org)(name . Jake Leporte)(address . jakeleporte@outlook.com)
MN2PR20MB2605E15EEAFE80B1FFB1A096ACB69@MN2PR20MB2605.namprd20.prod.outlook.com
* gnu/packages/security-token.scm (pcsc-tools): New variable.
---
gnu/packages/security-token.scm | 62 +++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)

Toggle diff (82 lines)
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
M
M
Maxim Cournoyer wrote on 22 Mar 2023 02:40
Re: bug#61018: [PATCH 0/2] Add pcsc-tools, and missing dependency perl-pcsc
(name . Jake Leporte)(address . jakeleporte@outlook.com)(address . 61018@debbugs.gnu.org)
87jzz9k1gf.fsf_-_@gmail.com
Hi,

Jake Leporte <jakeleporte@outlook.com> writes:

Toggle quote (60 lines)
> * gnu/packages/perl.scm (perl-pcsc): New variable.
> ---
> gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
> index b6fb81e..a1a9983 100644
> --- a/gnu/packages/perl.scm
> +++ b/gnu/packages/perl.scm
> @@ -86,6 +86,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)
> @@ -12269,6 +12270,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
> + (list
> + ;; 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"
> + (("libpcsclite.so.1")
> + (search-input-file inputs
> + "/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")

I've installed this change with the following small modification
(reword the comment and end it with a period):

Toggle snippet (31 lines)
modified gnu/packages/perl.scm
@@ -12339,17 +12339,16 @@ (define-public perl-pcsc
(build-system perl-build-system)
(arguments
(list
- ;; 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"
- (("libpcsclite.so.1")
- (search-input-file inputs
- "/lib/libpcsclite.so.1"))))))))
+ ;; The test suite is disabled because it requires access to a card
+ ;; reader with a card inserted.
+ #:tests? #f
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-dlopen
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "PCSCperl.h"
+ (("libpcsclite.so.1")
+ (search-input-file inputs
+ "/lib/libpcsclite.so.1"))))))))
(native-inputs (list pkg-config))
(inputs (list pcsc-lite))
(synopsis "Perl library for PC/SC")

--
Thanks,
Maxim
M
M
Maxim Cournoyer wrote on 22 Mar 2023 02:50
(name . Jake Leporte)(address . jakeleporte@outlook.com)(address . 61018-done@debbugs.gnu.org)
87edphk10m.fsf_-_@gmail.com
Hello,

Jake Leporte <jakeleporte@outlook.com> writes:

Toggle quote (57 lines)
> * gnu/packages/perl.scm (perl-pcsc): New variable.
> ---
> gnu/packages/perl.scm | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
> index b6fb81e..a1a9983 100644
> --- a/gnu/packages/perl.scm
> +++ b/gnu/packages/perl.scm
> @@ -86,6 +86,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)
> @@ -12269,6 +12270,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
> + (list
> + ;; 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"
> + (("libpcsclite.so.1")
> + (search-input-file inputs
> + "/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+)))
> +

I've also installed this one with the following changes:

modified gnu/packages/security-token.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
;;; Copyright © 2022 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
+;;; Copyright © 2023 Jake Leporte <jakeleporte@outlook.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -278,13 +279,12 @@ (define-public pcsc-tools
"\"/usr/local/pcsc/smartcard_list.txt\", "
"\"/usr/share/pcsc/smartcard_list.txt\", "
"\"/usr/local/share/pcsc/smartcard_list.txt\""))
- (string-append "\""
- #$output
+ (string-append "\"" #$output
"/share/pcsc/smartcard_list.txt\"")))
(substitute* "ATR_analysis.1p"
- (("^([.]IR [.]/) ,\n$" _ cwd)
+ (("^(\\.IR \\./) ,\n$" _ cwd)
(string-append cwd "\n"))
- (("^[.]I /usr/local/pcsc/\n$")
+ (("^\\.I /usr/local/pcsc/\n$")
"")

Because \\. is more widespread (conventional) than [.] in the guix code
base.

(("/usr/share/pcsc/\n$")
(string-append #$output "/share/pcsc/\n")))))
@@ -292,26 +292,22 @@ (define-public pcsc-tools
(lambda _
(for-each
(lambda (prog)
- (wrap-program (string-append #$output
- "/bin/"
- prog)
- `("PERL5LIB" =
- (,(getenv "PERL5LIB")))))
+ (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")))))))))
+ (wrap-program (string-append #$output "/bin/gscriptor")
+ `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))))))))

Tightened the indentation a bit (I guess this was 'guix style', which
doesn't always produce perfect results).

(native-inputs (list autoconf automake libtool gnu-gettext pkg-config))
- (inputs (list bash-minimal ;for wrap-program
+ (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}.")
+ pcsc-lite
+ perl-pcsc))
+ (synopsis "Smart cards and PC/SC tools")

I streamlined the synopsis a bit,

+ (description "This package provides the @command{pcsc_scan},
+@command{ATR_analysis}, @command{scriptor}, and @command{gscriptor} commands,
+which are useful tools to test a PC/SC driver, card or reader or send commands
+in a friendly environment (text or graphical user interface).")

and expounded the description, changing @code to @command.

Thank you!

--
Maxim
Closed
?