From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: Re: [PATCH 0/2] gnu: Add libpcsclite Date: Sat, 22 Oct 2016 22:16:34 +0100 Message-ID: <87r37813v1.fsf@duckhunt.i-did-not-set--mail-host-address--so-tickle-me> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1by3ej-00062q-47 for guix-devel@gnu.org; Sat, 22 Oct 2016 17:16:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1by3ef-0004G0-V7 for guix-devel@gnu.org; Sat, 22 Oct 2016 17:16:41 -0400 In-Reply-To: List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Mike Gerwitz , guix-devel@gnu.org Mike Gerwitz 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.