Archived
1
0
Fork 0

gnu: python-tlsh: Fix build.

* gnu/packages/python-xyz.scm (python-tlsh) [build-system]: Switch to
python-build-system.
[arguments]: Remove #:out-of-source.  Remove install phase override.  Add a
configure, chdir and adjust the check phase override.
[inputs]: Delete field.
[native-inputs]: New field.
This commit is contained in:
Maxim Cournoyer 2023-04-24 21:31:56 -04:00
parent c9f82d57eb
commit 971f00f237
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -13490,32 +13490,22 @@ $ rm -rf /tmp/env
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "1gb5j73nw3nmx030rf8pm75rns5syxhv44zxr6i74kjicyly1i9w")))) (base32 "1gb5j73nw3nmx030rf8pm75rns5syxhv44zxr6i74kjicyly1i9w"))))
(build-system cmake-build-system) (build-system python-build-system)
(arguments (arguments
(list #:out-of-source? #f (list #:phases
#:phases
#~(modify-phases %standard-phases #~(modify-phases %standard-phases
(replace 'install (add-before 'build 'configure
(lambda _ (lambda _
;; Build and install the Python bindings. The underlying (invoke "cmake" "."))) ;to generate tlsh_version.h
;; C++ library is apparently not meant to be installed. (add-after 'configure 'chdir
(with-directory-excursion "py_ext" (lambda _
(and (system* "python" "setup.py" "build") (chdir "py_ext")))
(system* "python" "setup.py" "install" (replace 'check
(string-append "--prefix=" #$output))))))
;; Delay tests until the phase above has run.
(delete 'check)
(add-after 'install 'check
(lambda* (#:key tests? #:allow-other-keys) (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? (when tests?
(with-directory-excursion "Testing" (with-directory-excursion "../Testing"
(invoke "./python_test.sh")))))))) (invoke "./python_test.sh"))))))))
(inputs (list python-wrapper)) ;for the bindings (native-inputs (list cmake-minimal))
(synopsis "Fuzzy matching library for Python") (synopsis "Fuzzy matching library for Python")
(description (description
"Trend Micro Locality Sensitive Hash (TLSH) is a fuzzy matching library. "Trend Micro Locality Sensitive Hash (TLSH) is a fuzzy matching library.