unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 1/2] gnu: Add pcsc-lite
  2016-10-24 16:21     ` Marius Bakke
@ 2016-10-22 16:04       ` Mike Gerwitz
  2016-10-22 16:06       ` [PATCH 2/2] gnu: gnupg: patch scdaemon libpcsclite path Mike Gerwitz
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Mike Gerwitz @ 2016-10-22 16:04 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/gnupg.scm (pcsc-lite): New variable.
---
 gnu/packages/gnupg.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 5fcc03a..da48e26 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -9,6 +9,7 @@
 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;; Copyright © 2016 Nils Gillmann <ng0@libertad.pw>
 ;;; Copyright © 2016 Christopher Baines <mail@cbaines.net>
+;;; Copyright © 2016 Mike Gerwitz <mtg@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -30,8 +31,10 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages adns)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages openldap)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pth)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
@@ -73,6 +76,35 @@ Daemon and possibly more in the future.")
     (properties '((ftp-server . "ftp.gnupg.org")
                   (ftp-directory . "/gcrypt/libgpg-error")))))
 
+(define-public pcsc-lite
+  (package
+    (name "pcsc-lite")
+    (version "1.8.18")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://alioth.debian.org/frs/download.php/file/4179/"
+                    "pcsc-lite-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0189s10xsgcmdvc2sixakncwlv47cg6by6m9vdm038gn32q34bdj"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("perl" ,perl)                   ; for pod2man
+       ("pkg-config" ,pkg-config)))
+    (propagated-inputs
+     `(("libudev" ,eudev)))
+    (home-page "https://pcsclite.alioth.debian.org/pcsclite.html")
+    (synopsis "Middleware to access a smart card using PC/SC")
+    (description
+     "pcsc-lite provides an interface to communicate with smartcards and
+readers using the SCard API.  pcsc-lite is used to connect to the PC/SC daemon
+from a client application and provide access to the desired reader.")
+    (license (list license:bsd-3                ; pcsc-lite
+                   license:expat                ; src/sd-daemon.[ch]
+                   license:isc                  ; src/strlcat.c src/strlcpy.c
+                   license:gpl3+))))            ; src/spy/*
+
 (define-public libgcrypt
   (package
     (name "libgcrypt")
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] gnu: gnupg: patch scdaemon libpcsclite path
  2016-10-24 16:21     ` Marius Bakke
  2016-10-22 16:04       ` [PATCH 1/2] gnu: Add pcsc-lite Mike Gerwitz
@ 2016-10-22 16:06       ` Mike Gerwitz
  2016-10-24 18:03       ` [PATCH 0/2] gnu: Add libpcsclite Efraim Flashner
  2016-10-27  1:09       ` Mike Gerwitz
  3 siblings, 0 replies; 11+ messages in thread
From: Mike Gerwitz @ 2016-10-22 16:06 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/gnupg.scm (gnupg): Use absolute path of pcsc-lite for
  libpcsclite in `scd/scdaemon.c'
---
 gnu/packages/gnupg.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index da48e26..52af7c0 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -293,6 +293,7 @@ compatible to GNU Pth.")
        ("libksba" ,libksba)
        ("npth" ,npth)
        ("openldap" ,openldap)
+       ("libpcsclite" ,pcsc-lite)
        ("readline" ,readline)
        ("sqlite" ,sqlite)
        ("zlib" ,zlib)))
@@ -301,9 +302,15 @@ compatible to GNU Pth.")
       #:phases
       (modify-phases %standard-phases
         (add-before 'configure 'patch-config-files
-          (lambda _
+          (lambda* (#:key inputs outputs #:allow-other-keys)
             (substitute* "tests/openpgp/defs.inc"
               (("/bin/pwd") (which "pwd")))
+            (substitute* "scd/scdaemon.c"
+              (("\"(libpcsclite\\.so[^\"]*)\"" _ name)
+               (string-append "\""
+                              (assoc-ref inputs "libpcsclite")
+                              "/lib/" name
+                              "\"")))
             #t)))))
     (home-page "https://gnupg.org/")
     (synopsis "GNU Privacy Guard")
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 0/2] gnu: Add libpcsclite
@ 2016-10-22 16:24 Mike Gerwitz
  2016-10-22 16:24 ` [PATCH 1/2] " Mike Gerwitz
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Mike Gerwitz @ 2016-10-22 16:24 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

This adds libpcsclite for smartcard support.

This is my first Guix package, and I surely screwed something up. :)
I'd appreciate any help or criticism you can give.  This was not a
trivial change.

The description is taken directly from the website, but I'm not fond
of its emphasis of Windows.  Should I change it?


Previous to this patch, commands like `gpg --card-status` did not work
(gpg version 2.1).  Running the following command would yield the
error "Could not find libpcsclite.so.1":

  gpg-agent --debug-all --debug-level guru --server --no-detach \
    <<< 'SCD SERIALNO openpgp'


I tried running `./pre-inst-env guix lint libpcsclite`, but got an
error about an unbound `make-session` variable; I'll post about that
separately, but please forgive any issues that it might have caught.


Mike Gerwitz (2):
  gnu: Add libpcsclite
  gnu: gnupg: libpcsclite propagated input

 gnu/packages/gnupg.scm | 40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

-- 
2.9.3


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/2] gnu: Add libpcsclite
  2016-10-22 16:24 [PATCH 0/2] gnu: Add libpcsclite Mike Gerwitz
@ 2016-10-22 16:24 ` Mike Gerwitz
  2016-10-22 16:24 ` [PATCH 2/2] gnu: gnupg: libpcsclite propagated input Mike Gerwitz
  2016-10-22 21:16 ` [PATCH 0/2] gnu: Add libpcsclite Marius Bakke
  2 siblings, 0 replies; 11+ messages in thread
From: Mike Gerwitz @ 2016-10-22 16:24 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/gnupg.scm (libpcsclite): New variable.
---
 gnu/packages/gnupg.scm | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index 5fcc03a..c4920b0 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -30,8 +30,10 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages adns)
   #:use-module (gnu packages curl)
+  #:use-module (gnu packages linux)
   #:use-module (gnu packages openldap)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pth)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
@@ -73,6 +75,36 @@ Daemon and possibly more in the future.")
     (properties '((ftp-server . "ftp.gnupg.org")
                   (ftp-directory . "/gcrypt/libgpg-error")))))
 
+(define-public libpcsclite
+  (package
+    (name "libpcsclite")
+    (version "1.8.18")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://alioth.debian.org/frs/download.php/file/4179/"
+                    "pcsc-lite-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "0189s10xsgcmdvc2sixakncwlv47cg6by6m9vdm038gn32q34bdj"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("perl" ,perl)                   ; for pod2man
+       ("pkg-config" ,pkg-config)))
+    (propagated-inputs
+     `(("libudev" ,eudev)))
+    (home-page "https://pcsclite.alioth.debian.org/pcsclite.html")
+    (synopsis "Middleware to access a smart card using PC/SC")
+    (description
+     "The purpose of PC/SC Lite is to provide a Windows(R) SCard interface in
+a very small form factor for communicating to smartcards and readers.  The
+PC/SC Lite library is used to connect to the PC/SC daemon from a client
+application and provide access to the desired reader.")
+    (license (list license:bsd-3                ; libpcsclite
+                   license:expat                ; src/sd-daemon.[ch]
+                   license:isc                  ; src/strlcat.c src/strlcpy.c
+                   license:gpl3+))))            ; src/spy/*
+
 (define-public libgcrypt
   (package
     (name "libgcrypt")
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] gnu: gnupg: libpcsclite propagated input
  2016-10-22 16:24 [PATCH 0/2] gnu: Add libpcsclite Mike Gerwitz
  2016-10-22 16:24 ` [PATCH 1/2] " Mike Gerwitz
@ 2016-10-22 16:24 ` Mike Gerwitz
  2016-10-22 21:16 ` [PATCH 0/2] gnu: Add libpcsclite Marius Bakke
  2 siblings, 0 replies; 11+ messages in thread
From: Mike Gerwitz @ 2016-10-22 16:24 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/gnupg.scm (gnupg): Add libpcsclite as propagated-input
---
 gnu/packages/gnupg.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm
index c4920b0..562b377 100644
--- a/gnu/packages/gnupg.scm
+++ b/gnu/packages/gnupg.scm
@@ -296,8 +296,14 @@ compatible to GNU Pth.")
        ("readline" ,readline)
        ("sqlite" ,sqlite)
        ("zlib" ,zlib)))
+    (propagated-inputs
+     `(("libpcsclite" ,libpcsclite)))
    (arguments
-    `(#:configure-flags '("--enable-gpg2-is-gpg")
+    `(#:configure-flags
+      (list "--enable-gpg2-is-gpg"
+            (string-append "LDFLAGS=-Wl,-rpath="
+                           (assoc-ref %build-inputs "libpcsclite")
+                           "/lib"))
       #:phases
       (modify-phases %standard-phases
         (add-before 'configure 'patch-config-files
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] gnu: Add libpcsclite
  2016-10-22 16:24 [PATCH 0/2] gnu: Add libpcsclite Mike Gerwitz
  2016-10-22 16:24 ` [PATCH 1/2] " Mike Gerwitz
  2016-10-22 16:24 ` [PATCH 2/2] gnu: gnupg: libpcsclite propagated input Mike Gerwitz
@ 2016-10-22 21:16 ` Marius Bakke
  2016-10-23  1:30   ` Mike Gerwitz
  2 siblings, 1 reply; 11+ messages in thread
From: Marius Bakke @ 2016-10-22 21:16 UTC (permalink / raw)
  To: Mike Gerwitz, guix-devel

Mike Gerwitz <mtg@gnu.org> writes:

> This adds libpcsclite for smartcard support.
>
> This is my first Guix package, and I surely screwed something up. :)
> I'd appreciate any help or criticism you can give.  This was not a
> trivial change.

Hi Mike,

Thanks a lot for working on this! The patches look mostly good, see
comments below.

> * gnu/packages/gnupg.scm (libpcsclite): New variable.

I think this should be named "pcsc-lite" to match the upstream name.

> +    (propagated-inputs
> +     `(("libudev" ,eudev)))

Generally, libraries do not need to be propagated, as they will be added
to rpath by the Guix ld wrapper when they are linked. More on this below.

> +    (home-page "https://pcsclite.alioth.debian.org/pcsclite.html")
> +    (synopsis "Middleware to access a smart card using PC/SC")
> +    (description
> +     "The purpose of PC/SC Lite is to provide a Windows(R) SCard interface in
> +a very small form factor for communicating to smartcards and readers.  The
> +PC/SC Lite library is used to connect to the PC/SC daemon from a client
> +application and provide access to the desired reader.")

I agree that the Windows reference here is unnecessary. Perhaps the
first sentence could be changed to something generic like "pcsc-lite
provides an interface to communicate with smartcards and readers using
the SCard API".

> * gnu/packages/gnupg.scm (gnupg): Add libpcsclite as propagated-input
[...]

> +    (propagated-inputs
> +     `(("libpcsclite" ,libpcsclite)))
>     (arguments
> -    `(#:configure-flags '("--enable-gpg2-is-gpg")
> +    `(#:configure-flags
> +      (list "--enable-gpg2-is-gpg"
> +            (string-append "LDFLAGS=-Wl,-rpath="
> +                           (assoc-ref %build-inputs "libpcsclite")
> +                           "/lib"))

The intention here is to make gnupg locate the libpcsclite library at
runtime, since it has no build-time checks for it, correct? I think this
approach is fine, if there is no way to make it search the Guix profile
paths for the library.

However, the LDFLAGS need to be in #:make-flags for this to work, and
then pcsc-lite does not need to be propagated, since Guix will scan the
output for store references (including rpath entries) and add them as
runtime dependencies.

Can you see if these changes work for you and send an updated patch?

Meanwhile I'll see if I can find a way to test this with a Yubikey.
Currently I get:
scdaemon[4600]: pcsc_list_readers failed: unknown PC/SC error code (0x8010002e)
..when using the "gpg-agent --debug-all" command mentioned earlier.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] gnu: Add libpcsclite
  2016-10-22 21:16 ` [PATCH 0/2] gnu: Add libpcsclite Marius Bakke
@ 2016-10-23  1:30   ` Mike Gerwitz
  2016-10-24 16:21     ` Marius Bakke
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Gerwitz @ 2016-10-23  1:30 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 3638 bytes --]

Hey, Marius:

Thanks for the quick reply. :)

On Sat, Oct 22, 2016 at 22:16:34 +0100, Marius Bakke wrote:
>> * gnu/packages/gnupg.scm (libpcsclite): New variable.
>
> I think this should be named "pcsc-lite" to match the upstream name.

I wasn't sure what the Guix naming convention was here---in Debian it's
libpcsclite1.  I'll make the change, though.

>> * gnu/packages/gnupg.scm (gnupg): Add libpcsclite as propagated-input
> [...]
>
>> +    (propagated-inputs
>> +     `(("libpcsclite" ,libpcsclite)))
>>     (arguments
>> -    `(#:configure-flags '("--enable-gpg2-is-gpg")
>> +    `(#:configure-flags
>> +      (list "--enable-gpg2-is-gpg"
>> +            (string-append "LDFLAGS=-Wl,-rpath="
>> +                           (assoc-ref %build-inputs "libpcsclite")
>> +                           "/lib"))
>
> The intention here is to make gnupg locate the libpcsclite library at
> runtime, since it has no build-time checks for it, correct?

Correct.  This is where I spent most of my time Guix-wise.

> I think this approach is fine, if there is no way to make it search
> the Guix profile paths for the library.

It uses dlopen which looks in RUNPATH.  I used strace to try to figure
out what else it might be doing, but it looked like the RUNPATH paths
were all it was checking.

That said, I have no idea what I'm doing, so I'd love to hear a better
way!  I saw other packages doing this, so I hoped it was somewhat
acceptable, however dirty.

> However, the LDFLAGS need to be in #:make-flags for this to work, and
> then pcsc-lite does not need to be propagated, since Guix will scan the
> output for store references (including rpath entries) and add them as
> runtime dependencies.

Ah!  Awesome.

Right now I'm using %build-inputs, but that's not going to work anymore
if pcsc-lite isn't an input.  Should I be adding it to the `input' list
instead, or is there a better way?

I assume you're looking for something like this:

   (arguments
    `(#:configure-flags '("--enable-gpg2-is-gpg")
      #:make-flags (string-append "LDFLAGS=-Wl,-rpath="
                                  (assoc-ref %build-inputs "pcsc-lite")
                                  "/lib")

> Meanwhile I'll see if I can find a way to test this with a Yubikey.
> Currently I get:
> scdaemon[4600]: pcsc_list_readers failed: unknown PC/SC error code (0x8010002e)
> ..when using the "gpg-agent --debug-all" command mentioned earlier.

I'm trying to figure out how I got myself into that situation by undoing
configuration changes, but I'm having trouble reproducing it.  Is that
the error you're getting from gpg-agent itself, or from gpg based on
gpg-agent's reply?

I'm not Guix SD yet, but on Trisquel+Guix using my Nitrokey I had to
modify /etc/libccid_Info.plist, which is part of libccid, according to
this:

  https://www.nitrokey.com/documentation/installation
  (Just disable CSS to view without JS.)

I actually completely forgot about libccid.  Perhaps I should add a
package for that too.

Please let me know what solution you find, and if libccid does in fact
solve that problem.  My goal for these changes is to have smartcard
stuff for popular readers work without any additional effort in Guix; I
found I was writing an article with a lot of exceptions for getting GPG
2.1 working, and would rather just tell people to "use Guix". :)

-- 
Mike Gerwitz
Free Software Hacker+Activist | GNU Maintainer & Volunteer
GPG: D6E9 B930 028A 6C38 F43B  2388 FEF6 3574 5E6F 6D05
Old: 2217 5B02 E626 BC98 D7C0  C2E5 F22B B815 8EE3 0EAB
https://mikegerwitz.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] gnu: Add libpcsclite
  2016-10-23  1:30   ` Mike Gerwitz
@ 2016-10-24 16:21     ` Marius Bakke
  2016-10-22 16:04       ` [PATCH 1/2] gnu: Add pcsc-lite Mike Gerwitz
                         ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Marius Bakke @ 2016-10-24 16:21 UTC (permalink / raw)
  To: Mike Gerwitz; +Cc: guix-devel

Mike Gerwitz <mtg@gnu.org> writes:

> Hey, Marius:
>
> Thanks for the quick reply. :)

Hi again,

Sorry for the late reply this time! :)

> On Sat, Oct 22, 2016 at 22:16:34 +0100, Marius Bakke wrote:
>>> * gnu/packages/gnupg.scm (libpcsclite): New variable.
>>
>> I think this should be named "pcsc-lite" to match the upstream name.
>
> I wasn't sure what the Guix naming convention was here---in Debian it's
> libpcsclite1.  I'll make the change, though.

Debian typically separates libraries into their own packages distinct
from any executable binaries. Guix doesn't, although for some very large
packages the libraries may be a separate "output" [0].

Since this package provides both the "pcscd" binary (which is a separate
package in Debian) and libpcsclite.so, using the "project name" is the
correct convention.

[0]: Search the Guix manual for "multiple outputs" for more information
about this. At ~500KiB, multiple outputs is not necessary for pcsc-lite.

>>> * gnu/packages/gnupg.scm (gnupg): Add libpcsclite as propagated-input
>> [...]
>>
>>> +    (propagated-inputs
>>> +     `(("libpcsclite" ,libpcsclite)))
>>>     (arguments
>>> -    `(#:configure-flags '("--enable-gpg2-is-gpg")
>>> +    `(#:configure-flags
>>> +      (list "--enable-gpg2-is-gpg"
>>> +            (string-append "LDFLAGS=-Wl,-rpath="
>>> +                           (assoc-ref %build-inputs "libpcsclite")
>>> +                           "/lib"))
>>
>> The intention here is to make gnupg locate the libpcsclite library at
>> runtime, since it has no build-time checks for it, correct?
>
> Correct.  This is where I spent most of my time Guix-wise.
>
>> I think this approach is fine, if there is no way to make it search
>> the Guix profile paths for the library.
>
> It uses dlopen which looks in RUNPATH.  I used strace to try to figure
> out what else it might be doing, but it looked like the RUNPATH paths
> were all it was checking.
>
> That said, I have no idea what I'm doing, so I'd love to hear a better
> way!  I saw other packages doing this, so I hoped it was somewhat
> acceptable, however dirty.
>
>> However, the LDFLAGS need to be in #:make-flags for this to work, and
>> then pcsc-lite does not need to be propagated, since Guix will scan the
>> output for store references (including rpath entries) and add them as
>> runtime dependencies.
>
> Ah!  Awesome.
>
> Right now I'm using %build-inputs, but that's not going to work anymore
> if pcsc-lite isn't an input.  Should I be adding it to the `input' list
> instead, or is there a better way?
>
> I assume you're looking for something like this:
>
>    (arguments
>     `(#:configure-flags '("--enable-gpg2-is-gpg")
>       #:make-flags (string-append "LDFLAGS=-Wl,-rpath="
>                                   (assoc-ref %build-inputs "pcsc-lite")
>                                   "/lib")

Yes, that's exactly what I meant (note that #:make-flags should be a
list). Then "pcsc-lite" can be moved to (inputs), yet gnupg should be
able to find the library at run-time since it will be added to RUNPATH.

However, since this is only needed for "scdaemon", I noticed NixOS
substitutes the libpcsclite.so with the full path in scdaemon.c [0]
instead of adding it to the RUNPATH of all GPG executables. Can you try
that?

You can verify that an input is referenced after building by running
e.g. `guix gc -R $(./pre-inst-env guix build gnupg)`. These "tricks"
enables us to avoid propagation, so that dependencies of a package does
not end up in your profile.

[1]: https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/security/gnupg/21.nix#L31

>> Meanwhile I'll see if I can find a way to test this with a Yubikey.
>> Currently I get:
>> scdaemon[4600]: pcsc_list_readers failed: unknown PC/SC error code (0x8010002e)
>> ..when using the "gpg-agent --debug-all" command mentioned earlier.
>
> I'm trying to figure out how I got myself into that situation by undoing
> configuration changes, but I'm having trouble reproducing it.  Is that
> the error you're getting from gpg-agent itself, or from gpg based on
> gpg-agent's reply?
>
> I'm not Guix SD yet, but on Trisquel+Guix using my Nitrokey I had to
> modify /etc/libccid_Info.plist, which is part of libccid, according to
> this:
>
>   https://www.nitrokey.com/documentation/installation
>   (Just disable CSS to view without JS.)
>
> I actually completely forgot about libccid.  Perhaps I should add a
> package for that too.

Ah, this was indeed the problem. Forgot that ccid was required too. I
actually made a package for it, but had to employ a few tricks to make
pcsc-lite find the driver: build pcsc-lite with
"--enable-usbdropdir=/var/lib/pcsc/drivers" and then symlink the ccid
drivers there.. Then `gpg --card-status` works after starting pcscd.

This is obviously suboptimal, I'm not sure how to solve it properly yet.
But if it works with pcscd and ccid on a foreign distro, it's not a big
showstopper.

> Please let me know what solution you find, and if libccid does in fact
> solve that problem.  My goal for these changes is to have smartcard
> stuff for popular readers work without any additional effort in Guix; I
> found I was writing an article with a lot of exceptions for getting GPG
> 2.1 working, and would rather just tell people to "use Guix". :)

Awesome :) If you can confirm that it still works for your use case
after the mentioned changes, I think we can push it. Don't forget to add
a copyright line for yourself.

I'll continue working on getting ccid integrated and eventually make a
pcscd service for GuixSD.

I do wonder if we should add a "smartcard.scm" or similar for pcsc, ccid
and friends, since they are not really gnupg projects. Any opinions from
other contributors? This can be fixed up before committing, so just use
gnupg.scm for now.

Can you send an updated patch? :)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] gnu: Add libpcsclite
  2016-10-24 16:21     ` Marius Bakke
  2016-10-22 16:04       ` [PATCH 1/2] gnu: Add pcsc-lite Mike Gerwitz
  2016-10-22 16:06       ` [PATCH 2/2] gnu: gnupg: patch scdaemon libpcsclite path Mike Gerwitz
@ 2016-10-24 18:03       ` Efraim Flashner
  2016-10-27  1:09       ` Mike Gerwitz
  3 siblings, 0 replies; 11+ messages in thread
From: Efraim Flashner @ 2016-10-24 18:03 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 639 bytes --]

On Mon, Oct 24, 2016 at 05:21:18PM +0100, Marius Bakke wrote:
> 
> I do wonder if we should add a "smartcard.scm" or similar for pcsc, ccid
> and friends, since they are not really gnupg projects. Any opinions from
> other contributors? This can be fixed up before committing, so just use
> gnupg.scm for now.
> 

we do have a yubico.scm that doesn't see a lot of action, that could be
renamed to make more generic.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] gnu: Add libpcsclite
  2016-10-24 16:21     ` Marius Bakke
                         ` (2 preceding siblings ...)
  2016-10-24 18:03       ` [PATCH 0/2] gnu: Add libpcsclite Efraim Flashner
@ 2016-10-27  1:09       ` Mike Gerwitz
  2016-10-27  9:03         ` Marius Bakke
  3 siblings, 1 reply; 11+ messages in thread
From: Mike Gerwitz @ 2016-10-27  1:09 UTC (permalink / raw)
  To: Marius Bakke; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

Marius:

Thanks for your mentoring on this. :)

On Mon, Oct 24, 2016 at 17:21:18 +0100, Marius Bakke wrote:
> I'll continue working on getting ccid integrated and eventually make a
> pcscd service for GuixSD.

Is there anything you'd like help on?  I'd be happy to test whatever you
come up with as soon as it's available.

-- 
Mike Gerwitz
Free Software Hacker+Activist | GNU Maintainer & Volunteer
GPG: D6E9 B930 028A 6C38 F43B  2388 FEF6 3574 5E6F 6D05
Old: 2217 5B02 E626 BC98 D7C0  C2E5 F22B B815 8EE3 0EAB
https://mikegerwitz.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] gnu: Add libpcsclite
  2016-10-27  1:09       ` Mike Gerwitz
@ 2016-10-27  9:03         ` Marius Bakke
  0 siblings, 0 replies; 11+ messages in thread
From: Marius Bakke @ 2016-10-27  9:03 UTC (permalink / raw)
  To: Mike Gerwitz; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]

Mike Gerwitz <mtg@gnu.org> writes:

> Marius:
>
> Thanks for your mentoring on this. :)

You're welcome! :)

>
> On Mon, Oct 24, 2016 at 17:21:18 +0100, Marius Bakke wrote:
>> I'll continue working on getting ccid integrated and eventually make a
>> pcscd service for GuixSD.
>
> Is there anything you'd like help on?  I'd be happy to test whatever you
> come up with as soon as it's available.

Not right now, but thanks. The difficulty with getting pcscd working on
GuixSD is that the daemon expects to find all drivers in one location
(e.g. /var/lib/pcsc/drivers). So we need to populate this directory with
drivers before starting the service.

On foreign (non-GuixSD) distros this is not a problem, as gpg users are
expected to use the pcscd service provided by their system anyway.

Anyway, the patches look good, I've made the following minor changes:

* moved pcsc-lite to the newly created "security-token.scm";
* made eudev a regular input instead of propagated;
* renamed the gnupg patch phase and removed superfluous "outputs" key;
* added a configure flag to pcsc so that GuixSD users can manually add
  drivers to "/var/lib/pcsc/drivers" (default is $out/lib/pcsc/drivers).

Also adjusted the commit messages accordingly. Pushed as
cd9ed6c1cbd9fdcfa38825b8109a646fb968b7a8! Thank you!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 454 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-10-27  9:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-22 16:24 [PATCH 0/2] gnu: Add libpcsclite Mike Gerwitz
2016-10-22 16:24 ` [PATCH 1/2] " Mike Gerwitz
2016-10-22 16:24 ` [PATCH 2/2] gnu: gnupg: libpcsclite propagated input Mike Gerwitz
2016-10-22 21:16 ` [PATCH 0/2] gnu: Add libpcsclite Marius Bakke
2016-10-23  1:30   ` Mike Gerwitz
2016-10-24 16:21     ` Marius Bakke
2016-10-22 16:04       ` [PATCH 1/2] gnu: Add pcsc-lite Mike Gerwitz
2016-10-22 16:06       ` [PATCH 2/2] gnu: gnupg: patch scdaemon libpcsclite path Mike Gerwitz
2016-10-24 18:03       ` [PATCH 0/2] gnu: Add libpcsclite Efraim Flashner
2016-10-27  1:09       ` Mike Gerwitz
2016-10-27  9:03         ` Marius Bakke

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).