python-lzo + python-lz4

* gnu/packages/compression.scm (python-lzo, python-lz4): New variables.

Co-authored-by: ng0 <ngillm...@runbox.com>
---
 gnu/packages/compression.scm | 64 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index 6504641..30d05ea 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -14,6 +14,7 @@
 ;;; Copyright © 2016 David Craven <da...@craven.ch>
 ;;; Copyright © 2016 Kei Kebreau <k...@openmailbox.org>
 ;;; Copyright © 2016 Marius Bakke <mba...@fastmail.com>
+;;; Copyright © 2016 ng0 <ngillm...@runbox.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +39,7 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system perl)
+  #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
@@ -45,6 +47,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages python)
   #:use-module (gnu packages valgrind)
   #:use-module ((srfi srfi-1) #:select (last)))
 
@@ -361,6 +364,39 @@ LZO is written in ANSI C.  Both the source code and the compressed data
 format are designed to be portable across platforms.")
     (license license:gpl2+)))
 
+(define-public python-lzo
+  (package
+    (name "python-lzo")
+    (version "1.11")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "python-lzo" version))
+       (sha256
+        (base32
+         "11p3ifg14p086byhhin6azx5svlkg8dzw2b5abixik97xd6fm81q"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:test-target "check"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-setuppy
+           (lambda _
+             (substitute* "setup.py"
+               (("include_dirs.append.*")
+                (string-append "include_dirs.append(\""
+                               (assoc-ref %build-inputs "lzo") "/include/lzo" "\")
+"))))))))
+    (inputs
+     `(("lzo" ,lzo)))
+    (home-page "https://github.com/jd-boyd/python-lzo";)
+    (synopsis "Python bindings for the LZO data compression library")
+    (description
+     "Python-LZO provides Python bindings for LZO, i.e. you can access
+the LZO library from your Python scripts thereby compressing ordinary
+Python strings.")
+    (license license:gpl2+)))
+
 (define-public lzop
   (package
     (name "lzop")
@@ -632,6 +668,34 @@ time for compression ratio.")
     ;; line interface programs (lz4, fullbench, fuzzer, datagen) are GPL2+.
     (license (list license:bsd-2 license:gpl2+))))
 
+(define-public python-lz4
+  (package
+    (name "python-lz4")
+    (version "0.8.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "lz4" version))
+       (sha256
+        (base32
+         "1irad4sq4hdr30fr53smvv3zzk4rddcf9b4jx19w8s9xsxhr1x3b"))))
+    (build-system python-build-system)
+    (inputs
+     `(("python-nose" ,python-nose)))
+    (home-page "https://github.com/python-lz4/python-lz4";)
+    (synopsis "LZ4 Bindings for Python")
+    (description
+     "This package provides python bindings for the lz4 compression library
+by Yann Collet.  The project contains bindings for the LZ4 block format and
+the LZ4 frame format.")
+    (license license:bsd-3)))
+
+(define-public python2-lz4
+  (package
+    (inherit (package-with-python2
+              (strip-python2-variant python-lz4)))
+    (native-inputs `(("python2-setuptools" ,python2-setuptools)))))
+
 (define-public squashfs-tools
   (package
     (name "squashfs-tools")

Reply via email to