diff options
| author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-06-26 23:58:00 +0200 |
|---|---|---|
| committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2018-07-02 23:12:40 +0200 |
| commit | 929d4d2f4ad8f7d1c04793ac2e436e7e0c14edd5 (patch) | |
| tree | 4ad3a1d87d87bbc785f4e25b9e112400b932a936 /gnu | |
| parent | 84be0e9a74e08b33e6a89caf61ec179308e7347e (diff) | |
gnu: python-pylibscrypt: Improve speed.
* gnu/packages/python-crypto.scm (python-pylibscrypt): Use "libscrypt"
implementation instead of "openssl".
"hashlib.scrypt" requires Python 3.6+ and OpenSSL 1.1+. Since Python is built
with OpenSSL 1.0, the library is unavailable. "pylibscrypt" defaults to a slow
pure Python implementation. Instead, rely on the much faster "libscrypt".
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/packages/python-crypto.scm | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm index 1d1e495d9fa..80875ad45a8 100644 --- a/gnu/packages/python-crypto.scm +++ b/gnu/packages/python-crypto.scm | |||
| @@ -884,14 +884,29 @@ through the Engine interface.") | |||
| 884 | "1b3rgzl6dbzs08vhv41b6y4n5189wv7lr27acxn104hs45745abs")))) | 884 | "1b3rgzl6dbzs08vhv41b6y4n5189wv7lr27acxn104hs45745abs")))) |
| 885 | (build-system python-build-system) | 885 | (build-system python-build-system) |
| 886 | (arguments | 886 | (arguments |
| 887 | `(#:tests? #f)) ;FIXME: unable to find libraries | 887 | `(#:phases |
| 888 | (modify-phases %standard-phases | ||
| 889 | (add-before 'build 'hard-code-path-to-libscrypt | ||
| 890 | (lambda* (#:key inputs #:allow-other-keys) | ||
| 891 | (let ((libscrypt (assoc-ref inputs "libscrypt"))) | ||
| 892 | (substitute* "pylibscrypt/pylibscrypt.py" | ||
| 893 | (("find_library\\('scrypt'\\)") | ||
| 894 | (string-append "'" libscrypt "/lib/libscrypt.so'"))) | ||
| 895 | #t)))) | ||
| 896 | ;; The library can use various scrypt implementations and tests all of | ||
| 897 | ;; them. Since we only provide a single implementation, most tests | ||
| 898 | ;; fail. Simply skip them. | ||
| 899 | #:tests? #f)) | ||
| 900 | ;; FIXME: Using "libscrypt" is the second best choice. The best one | ||
| 901 | ;; requires "hashlib.scrypt", provided by Python 3.6+ built with OpenSSL | ||
| 902 | ;; 1.1+. Use that as soon as Guix provides it. | ||
| 888 | (inputs | 903 | (inputs |
| 889 | `(("openssl" ,openssl))) | 904 | `(("libscrypt" ,libscrypt))) |
| 890 | (home-page "https://github.com/jvarho/pylibscrypt") | 905 | (home-page "https://github.com/jvarho/pylibscrypt") |
| 891 | (synopsis "Scrypt for Python") | 906 | (synopsis "Scrypt for Python") |
| 892 | (description "There are a lot of different scrypt modules for Python, but | 907 | (description "There are a lot of different scrypt modules for Python, but |
| 893 | none of them have everything that I'd like, so here's one more. It uses | 908 | none of them have everything that I'd like, so here's one more. It uses |
| 894 | hashlib.scrypt on Python 3.6 and OpenSSL 1.1.") | 909 | @code{libscrypt}.") |
| 895 | (license license:isc))) | 910 | (license license:isc))) |
| 896 | 911 | ||
| 897 | (define-public python-libnacl | 912 | (define-public python-libnacl |
