guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

11/16: gnu: python-tlsh: Update to 4.11.2.


From: guix-commits
Subject: 11/16: gnu: python-tlsh: Update to 4.11.2.
Date: Tue, 9 Aug 2022 18:29:48 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit e3fc94576ec0fac00ffd1e3f79f2a5c7ad8e2265
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Tue Aug 9 22:18:47 2022 +0200

    gnu: python-tlsh: Update to 4.11.2.
    
    * gnu/packages/python-xyz.scm (python-tlsh): Update to 4.11.2.
    [source](uri): Remove "v" prefix from version.
    [arguments]: Add custom check phase.  Use G-expression.
    [inputs]: Remove label.
---
 gnu/packages/python-xyz.scm | 45 +++++++++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index e5326274c0..d18959889e 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -12455,32 +12455,41 @@ $ rm -rf /tmp/env
 (define-public python-tlsh
   (package
     (name "python-tlsh")
-    (version "3.4.5")
+    (version "4.11.2")
     (home-page "https://github.com/trendmicro/tlsh";)
     (source
      (origin
        (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/trendmicro/tlsh";)
-             (commit (string-append "v" version))))
+       (uri (git-reference (url home-page) (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1ydliir308xn4ywy705mmsh7863ldlixdvpqwdhbipzq9vfpmvll"))))
+        (base32 "1gb5j73nw3nmx030rf8pm75rns5syxhv44zxr6i74kjicyly1i9w"))))
     (build-system cmake-build-system)
     (arguments
-     '(#:out-of-source? #f
-       #:phases (modify-phases %standard-phases
-                  (replace
-                   'install
-                   (lambda* (#:key outputs #:allow-other-keys)
-                     ;; Build and install the Python bindings.  The underlying
-                     ;; C++ library is apparently not meant to be installed.
-                     (let ((out (assoc-ref outputs "out")))
-                       (with-directory-excursion "py_ext"
-                         (and (system* "python" "setup.py" "build")
-                              (system* "python" "setup.py" "install"
-                                       (string-append "--prefix=" out))))))))))
-    (inputs `(("python" ,python-wrapper)))        ;for the bindings
+     (list #:out-of-source? #f
+           #:phases
+           #~(modify-phases %standard-phases
+               (replace 'install
+                 (lambda _
+                   ;; Build and install the Python bindings.  The underlying
+                   ;; C++ library is apparently not meant to be installed.
+                   (with-directory-excursion "py_ext"
+                     (and (system* "python" "setup.py" "build")
+                          (system* "python" "setup.py" "install"
+                                   (string-append "--prefix=" #$output))))))
+               ;; Delay tests until the phase above has run.
+               (delete 'check)
+               (add-after 'install 'check
+                 (lambda* (#:key tests? #:allow-other-keys)
+                   (substitute* "Testing/python_test.sh"
+                     ;; The script sets up a working PYTHONPATH, but does not
+                     ;; export it for all subsequent test commands.  Fix that.
+                     (("^PYTHONPATH=\".*" all)
+                      (string-append all "\nexport PYTHONPATH\n")))
+                   (when tests?
+                     (with-directory-excursion "Testing"
+                       (invoke "./python_test.sh"))))))))
+    (inputs (list python-wrapper))      ;for the bindings
     (synopsis "Fuzzy matching library for Python")
     (description
      "Trend Micro Locality Sensitive Hash (TLSH) is a fuzzy matching library.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]