summary refs log tree commit diff
path: root/gnu/packages/python-xyz.scm
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2022-08-09 22:18:47 +0200
committerMarius Bakke <marius@gnu.org>2022-08-10 00:29:00 +0200
commite3fc94576ec0fac00ffd1e3f79f2a5c7ad8e2265 (patch)
tree978106e6e0f2b395c6d23bea32163da68482a945 /gnu/packages/python-xyz.scm
parent0a9d99bc8cf8348d7fdb989e4bec364cc083ed67 (diff)
downloadguix-e3fc94576ec0fac00ffd1e3f79f2a5c7ad8e2265.tar.gz
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.
Diffstat (limited to 'gnu/packages/python-xyz.scm')
-rw-r--r--gnu/packages/python-xyz.scm45
1 files 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.