[PATCH 0/4] Fix python-yubikey-manager build and update to 5.1.1.

  • Done
  • quality assurance status badge
Details
2 participants
  • John Kehayias
  • Pierre Langlois
Owner
unassigned
Submitted by
Pierre Langlois
Severity
normal
P
P
Pierre Langlois wrote on 7 May 2023 23:07
(address . guix-patches@gnu.org)
875y93u9mt.fsf@gmx.com
Hi Guix!

I recently noticed python-yubikey-manager fails to build on master,
here are a few patches to fix it by updating it and some of its
dependencies. Also cleaned the packages a little bit, and most
importantly enabled tests.

Thanks,
Pierre

Pierre Langlois (4):
gnu: python-pyscard: Update to 2.0.7.
gnu: python-fido2: Update to 1.1.1.
gnu: Add python-makefun.
gnu: python-yubikey-manager: Update to 5.1.1.

gnu/packages/python-xyz.scm | 22 ++++++++-
gnu/packages/security-token.scm | 86 ++++++++++++++++-----------------
2 files changed, 63 insertions(+), 45 deletions(-)


base-commit: 4c3532d7ab81a20e21d23bcf25e06999fcee2571
--
2.39.2
-----BEGIN PGP SIGNATURE-----

iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmRYFLoYHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31UhXgH/RLb8kufeJU3uU0XUUp8Ju5u
3Fo9dwJWq5DsUCx7vFTpXID50KMCszcSPp9Ot6un5U+aXjoBhtW6xffsZKSBUsmD
UIBhtALCK5L81xVnbANIRXsPU3gh+UeQBdLI4mAwwRpyml7Oh5SP48MJxEVPwTFN
CnAQQIQX7UkMKmLcHKyEjHYW0m6qRBDE6eSX/RhJz+KnP0kpJbBydLolbBc8fD7S
SwB7guNJekscTUqSm7pFNVyG0LcZUa3Ua4k/c80KxAI5UW/NAGnxStxfLvGzn4lA
QhCVV5+yS8uisvR7MkzH/hCNSVcIfemVi/76Yi/w7vE1d0u3nsLkl2wR3MB7jM4=
=jszb
-----END PGP SIGNATURE-----

P
P
Pierre Langlois wrote on 7 May 2023 23:19
[PATCH 1/4] gnu: python-pyscard: Update to 2.0.7.
(address . 63354@debbugs.gnu.org)(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
f5ce5c7361d0abb08ceddde8b47e73ced7e2086e.1683493656.git.pierre.langlois@gmx.com
* gnu/packages/security-token.scm (python-pyscard): Update to 2.0.7.
[arguments]<#:phases>: Use search-input-direcotry. Do not return #t.
---
gnu/packages/security-token.scm | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)

Toggle diff (62 lines)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index b51d67427a..e702bcd9d3 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -20,6 +20,7 @@
;;; Copyright © 2023 Jake Leporte <jakeleporte@outlook.com>
;;; Copyright © 2023 Timotej Lazar <timotej.lazar@araneo.si>
;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2023 Pierre Langlois <pierre.langlois@gmx.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -462,7 +463,7 @@ (define-public yubikey-personalization
(define-public python-pyscard
(package
(name "python-pyscard")
- (version "1.9.9")
+ (version "2.0.7")
(source (origin
(method url-fetch)
;; The maintainer publishes releases on various sites, but
@@ -472,7 +473,7 @@ (define-public python-pyscard
version "/pyscard-" version ".tar.gz"))
(sha256
(base32
- "082cjkbxadaz2jb4rbhr0mkrirzlqyqhcf3r823qb0q1k50ybgg6"))))
+ "1gy1hmzrhfa7bqs132v89pchm9q3rpnqf3a6225vwpx7bx959017"))))
(build-system python-build-system)
(arguments
`(#:phases
@@ -480,24 +481,21 @@ (define-public python-pyscard
;; Tell pyscard where to find the PCSC include directory.
(add-after 'unpack 'patch-platform-include-dirs
(lambda* (#:key inputs #:allow-other-keys)
- (let ((pcsc-include-dir (string-append
- (assoc-ref inputs "pcsc-lite")
- "/include/PCSC")))
+ (let ((pcsc-include-dir (search-input-directory
+ inputs "/include/PCSC")))
(substitute* "setup.py"
(("platform_include_dirs = \\[.*?\\]")
(string-append
- "platform_include_dirs = ['" pcsc-include-dir "']")))
- #t)))
+ "platform_include_dirs = ['" pcsc-include-dir "']"))))))
;; pyscard wants to dlopen libpcsclite, so tell it where it is.
(add-after 'unpack 'patch-dlopen
(lambda* (#:key inputs #:allow-other-keys)
(substitute* "smartcard/scard/winscarddll.c"
(("lib = \"libpcsclite\\.so\\.1\";")
- (simple-format #f
- "lib = \"~a\";"
- (search-input-file inputs
- "/lib/libpcsclite.so.1"))))
- #t)))))
+ (simple-format
+ #f
+ "lib = \"~a\";"
+ (search-input-file inputs "/lib/libpcsclite.so.1")))))))))
(inputs
(list pcsc-lite))
(native-inputs
--
2.39.2
P
P
Pierre Langlois wrote on 7 May 2023 23:19
[PATCH 2/4] gnu: python-fido2: Update to 1.1.1.
(address . 63354@debbugs.gnu.org)(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
8d96a2b53c1dc023ca4b62dfb7237d0820bd757b.1683493656.git.pierre.langlois@gmx.com
* gnu/packages/security-tokens.scm (python-fido2): Update to 1.1.1.
[build-system]: Switch to pyproject-build-system.
[arguments]<#:tests?>: Enable.
[arguments]<#:phases>: Gexpify.
[propagated-inputs]: Remove python-six. Add python-pyscard.
[native-inputs]: Remove python-mock and python-pyflakefs. Add
python-poetry-core and python-pytest.
---
gnu/packages/security-token.scm | 41 +++++++++++++++++----------------
1 file changed, 21 insertions(+), 20 deletions(-)

Toggle diff (79 lines)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index e702bcd9d3..79c197cd42 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -50,6 +50,7 @@ (define-module (gnu packages security-token)
#:use-module (guix build-system gnu)
#:use-module (guix build-system glib-or-gtk)
#:use-module (guix build-system python)
+ #:use-module (guix build-system pyproject)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
@@ -81,6 +82,7 @@ (define-module (gnu packages security-token)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-build)
#:use-module (gnu packages python-crypto)
#:use-module (gnu packages python-xyz)
#:use-module (gnu packages swig)
@@ -682,7 +684,7 @@ (define-public pam-u2f
(define-public python-fido2
(package
(name "python-fido2")
- (version "0.9.3")
+ (version "1.1.1")
(source (origin
(method url-fetch)
(uri
@@ -691,31 +693,30 @@ (define-public python-fido2
version "/fido2-" version ".tar.gz"))
(sha256
(base32
- "1v366h449f8q74jkmy1291ffj2345nm7cdsipgqvgz4w22k8jpml"))
+ "1hwz0xagkmy6hhcyfl66dxf2vfa69lqqqjrv70vw7harik59bi2x"))
(snippet
;; Remove bundled dependency.
'(delete-file "fido2/public_suffix_list.dat"))))
- (build-system python-build-system)
+ (build-system pyproject-build-system)
(arguments
- `(;; This attempts to access
- ;; /System/Library/Frameworks/IOKit.framework/IOKit
- ;; The recommendation is to use tox for testing.
- #:tests? #false
- #:phases
- (modify-phases %standard-phases
- (add-after 'unpack 'install-public-suffix-list
- (lambda* (#:key inputs #:allow-other-keys)
- (copy-file
- (search-input-file inputs
- (string-append
- "/share/public-suffix-list-"
- ,(package-version public-suffix-list)
- "/public_suffix_list.dat"))
- "fido2/public_suffix_list.dat"))))))
+ (list
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'install-public-suffix-list
+ (lambda* (#:key inputs #:allow-other-keys)
+ (copy-file
+ (search-input-file inputs
+ (string-append
+ "/share/public-suffix-list-"
+ #$(package-version public-suffix-list)
+ "/public_suffix_list.dat"))
+ "fido2/public_suffix_list.dat"))))))
(propagated-inputs
- (list python-cryptography python-six))
+ (list python-cryptography python-pyscard))
(native-inputs
- (list python-mock python-pyfakefs public-suffix-list))
+ (list python-poetry-core
+ python-pytest
+ public-suffix-list))
(home-page "https://github.com/Yubico/python-fido2")
(synopsis "Python library for communicating with FIDO devices over USB")
(description
--
2.39.2
P
P
Pierre Langlois wrote on 7 May 2023 23:19
[PATCH 3/4] gnu: Add python-makefun.
(address . 63354@debbugs.gnu.org)(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
d2b16e806560c13118db8dd95ed35498efe6c8b4.1683493656.git.pierre.langlois@gmx.com
* gnu/packages/python-xyz.scm (python-makefun): New variable.
---
gnu/packages/python-xyz.scm | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)

Toggle diff (40 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a5c99a6f20..92ab43ac95 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -61,7 +61,7 @@
;;; Copyright © 2019, 2023 Jack Hill <jackhill@jackhill.us>
;;; Copyright © 2019, 2020, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
-;;; Copyright © 2019, 2020, 2021, 2022 Pierre Langlois <pierre.langlois@gmx.com>
+;;; Copyright © 2019, 2020, 2021, 2022, 2023 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2019 Jacob MacDonald <jaccarmac@gmail.com>
;;; Copyright © 2019, 2020, 2021 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2019 Wiktor ?elazny <wzelazny@vurv.cz>
@@ -4690,6 +4690,26 @@ (define-public python-linkify-it-py
@end itemize")
(license license:expat)))

+(define-public python-makefun
+ (package
+ (name "python-makefun")
+ (version "1.15.1")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "makefun" version))
+ (sha256
+ (base32
+ "19a8dga8rnmjn5gy1cy1wdi28swbkdkypwbqikbxil6ynqcg3c20"))))
+ (build-system pyproject-build-system)
+ (native-inputs
+ (list python-setuptools-scm python-pytest))
+ (home-page "https://github.com/smarie/python-makefun")
+ (synopsis "Library to dynamically create python functions")
+ (description "@code{makefun} helps create functions dynamically with a
+given signature. It was largely inspired by @code{python-decorator} and
+@code{functools}.")
+ (license license:bsd-3)))
+
(define-public python-markdown-it-py
(package
(name "python-markdown-it-py")
--
2.39.2
P
P
Pierre Langlois wrote on 7 May 2023 23:19
[PATCH 4/4] gnu: python-yubikey-manager: Update to 5.1.1.
(address . 63354@debbugs.gnu.org)(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
50dbfc2145aac4c09f1e44101dbd60be3f027857.1683493656.git.pierre.langlois@gmx.com
* gnu/packages/security-tokens.scm (python-yubikey-manager): Update to
5.1.1.
[build-system]: Switch to pyproject-build-system.
[arguments]: Delete.
[propagated-inputs]: Remove python-six. Add python-keyring.
[native-inputs]: Add python-makefun, python-poetry-code and
python-pytest.
---
gnu/packages/security-token.scm | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)

Toggle diff (49 lines)
diff --git a/gnu/packages/security-token.scm b/gnu/packages/security-token.scm
index 79c197cd42..4e8283a9ea 100644
--- a/gnu/packages/security-token.scm
+++ b/gnu/packages/security-token.scm
@@ -738,33 +738,32 @@ (define-public python-fido2
(define-public python-yubikey-manager
(package
(name "python-yubikey-manager")
- (version "4.0.7")
+ (version "5.1.1")
(source (origin
(method url-fetch)
(uri (string-append
"https://developers.yubico.com/yubikey-manager/Releases"
- "/yubikey-manager-" version ".tar.gz"))
+ "/yubikey_manager-" version ".tar.gz"))
(sha256
(base32
- "0kzwal7i4kyywm4f5zh8b823mh0ih2nsh5c0c4dfn4vw3j5dnwlr"))))
- (build-system python-build-system)
- (arguments
- '(;; This attempts to access
- ;; /System/Library/Frameworks/IOKit.framework/IOKit
- ;; The recommendation is to use tox for testing.
- #:tests? #false))
+ "1kma08rxvpzn2gf8b9vxyyb2pvrakm7hhpdmbnb54nwbdnbxp1v4"))))
+ (build-system pyproject-build-system)
(propagated-inputs
- (list python-six
- python-pyscard
+ (list python-pyscard
python-pyusb
python-click
python-cryptography
+ python-keyring
python-pyopenssl
python-fido2))
(inputs
(list pcsc-lite))
(native-inputs
- (list swig python-mock))
+ (list swig
+ python-makefun
+ python-mock
+ python-poetry-core
+ python-pytest))
(home-page "https://developers.yubico.com/yubikey-manager/")
(synopsis "Command line tool and library for configuring a YubiKey")
(description
--
2.39.2
J
J
John Kehayias wrote on 14 Jul 2023 18:26
Re: bug#63354: [PATCH 0/4] Fix python-yubikey-manager build and update to 5.1.1.
(name . Pierre Langlois)(address . pierre.langlois@gmx.com)(address . 63354-done@debbugs.gnu.org)
87fs5q1mub.fsf@protonmail.com
Hi Pierre,

On Sun, May 07, 2023 at 10:07 PM, Pierre Langlois wrote:

Toggle quote (11 lines)
> Hi Guix!
>
> I recently noticed python-yubikey-manager fails to build on master,
> here are a few patches to fix it by updating it and some of its
> dependencies. Also cleaned the packages a little bit, and most
> importantly enabled tests.
>
> Thanks,
> Pierre
>

Thanks! I had actually done a lot of similar work but had got distracted
by the python build system changes (and poetry) and never looked to see
if the yubikey-manager part could be extracted out in:

So, I combined what I had with yours to clean up a little more. I edited
some commit messages, fixed some typos, and checked everything builds.

Unfortunately I lost you as the author in the commit log, not sure what
happened. I was so careful locally in a branch but then missed it when I
went to actually push to master. Sorry about that! If there is a way to
remedy this or something else I can do anyone knows, please do share.

Pushed the series starting at 221806905b68f9b52b90bd5c80722d4a5ab3f353

Thanks again!

Toggle quote (12 lines)
> Pierre Langlois (4):
> gnu: python-pyscard: Update to 2.0.7.
> gnu: python-fido2: Update to 1.1.1.
> gnu: Add python-makefun.
> gnu: python-yubikey-manager: Update to 5.1.1.
>
> gnu/packages/python-xyz.scm | 22 ++++++++-
> gnu/packages/security-token.scm | 86 ++++++++++++++++-----------------
> 2 files changed, 63 insertions(+), 45 deletions(-)
>
>
> base-commit: 4c3532d7ab81a20e21d23bcf25e06999fcee2571
Closed
?