unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: Mike Gerwitz <mtg@gnu.org>, guix-devel@gnu.org
Subject: Re: [PATCH 0/2] gnu: Add libpcsclite
Date: Sat, 22 Oct 2016 22:16:34 +0100	[thread overview]
Message-ID: <87r37813v1.fsf@duckhunt.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <cover.1477153372.git.mtg@gnu.org>

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.

  parent reply	other threads:[~2016-10-22 21:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-10-23  1:30   ` [PATCH 0/2] gnu: Add libpcsclite 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r37813v1.fsf@duckhunt.i-did-not-set--mail-host-address--so-tickle-me \
    --to=mbakke@fastmail.com \
    --cc=guix-devel@gnu.org \
    --cc=mtg@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).