guix-commits
[Top][All Lists]
Advanced

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

01/04: gnu: Add python-tlsh.


From: Ludovic Courtès
Subject: 01/04: gnu: Add python-tlsh.
Date: Thu, 15 Oct 2015 21:12:05 +0000

civodul pushed a commit to branch master
in repository guix.

commit d8c4998fd4449a82bcb2392f35da944c753640a8
Author: Ludovic Courtès <address@hidden>
Date:   Thu Oct 15 22:12:38 2015 +0200

    gnu: Add python-tlsh.
    
    * gnu/packages/python.scm (python-tlsh, python2-tlsh): New variable.
---
 gnu/packages/python.scm |   49 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 3319938..2a240fa 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -72,6 +72,7 @@
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system cmake)
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
   #:use-module (srfi srfi-1))
@@ -5617,3 +5618,51 @@ Python Package Index (PyPI).")
 
 (define-public python2-pip
   (package-with-python2 python-pip))
+
+(define-public python-tlsh
+  (package
+    (name "python-tlsh")
+    (version "3.4.1")                             ;according to CMakeLists.txt
+    (home-page "https://github.com/trendmicro/tlsh";)
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url home-page)
+                    ;; This is a commit right after 3.4.1; see
+                    ;; <https://github.com/trendmicro/tlsh/issues/9>.
+                    (commit "3ae3f1f")))
+              (sha256
+               (base32
+                "12cvnr5ndm5cg6i7lch93id90kgwgrigjgrj8f186nh3h4bf9chj"))
+              (file-name (string-append name "-" version "-checkout"))))
+    (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
+    (synopsis "Fuzzy matching library for Python")
+    (description
+     "Trend Micro Locality Sensitive Hash (TLSH) is a fuzzy matching library.
+Given a byte stream with a minimum length of 256 bytes, TLSH generates a hash
+value which can be used for similarity comparisons.  Similar objects have
+similar hash values, which allows for the detection of similar objects by
+comparing their hash values.  The byte stream should have a sufficient amount
+of complexity; for example, a byte stream of identical bytes will not generate
+a hash value.")
+    (license asl2.0)))
+
+(define-public python2-tlsh
+  (package
+    (inherit python-tlsh)
+    (name "python2-tlsh")
+    (inputs `(("python" ,python-2)))))



reply via email to

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