diff mbox

python-lzo + python-lz4

Message ID 8760pl5nda.fsf@we.make.ritual.n0.is
State New
Headers show

Commit Message

ng0 Sept. 24, 2016, 3:27 p.m. UTC
lz4: builds. lzo: I don't know how to make it find lzo headers, help
requested.

Comments

Danny Milosavljevic Sept. 24, 2016, 6:12 p.m. UTC | #1
On Sat, 24 Sep 2016 15:27:45 +0000
ng0 <ngillmann@runbox.com> wrote:

> lz4: builds. lzo: I don't know how to make it find lzo headers, help
> requested.

python-lzo-1.11/setup.py hard-codes /usr/include/lzo . Substitute that by (assoc-ref inputs "lzo") or something. Probably also set -Wl,-rpath there. When testing, make sure to not have lzo in your profile.
Danny Milosavljevic Sept. 24, 2016, 6:25 p.m. UTC | #2
On Sat, 24 Sep 2016 15:27:45 +0000
ng0 <ngillmann@runbox.com> wrote:
> +               (("^include_dirs.append")
                     ^ remove "^"

And add .*

so

 ("include_dirs.append.*")
...

Note that this also matches the newline codepoint (sigh), so you have to re-add it in the substitution at the end.
 
 ("include_dirs.append.*") "......./include/lzo
"
^newline
Danny Milosavljevic Sept. 24, 2016, 6:27 p.m. UTC | #3
On Sat, 24 Sep 2016 15:27:45 +0000
ng0 <ngillmann@runbox.com> wrote:

Note: Also add

     #:test-target "check"
ng0 Sept. 24, 2016, 7:16 p.m. UTC | #4
Hi,

Danny Milosavljevic <dannym@scratchpost.org> writes:

> On Sat, 24 Sep 2016 15:27:45 +0000
> ng0 <ngillmann@runbox.com> wrote:
>> +               (("^include_dirs.append")
>                      ^ remove "^"
>
> And add .*
>
> so
>
>  ("include_dirs.append.*")
> ...
>
> Note that this also matches the newline codepoint (sigh), so you have to re-add it in the substitution at the end.
>  
>  ("include_dirs.append.*") "......./include/lzo
> "
> ^newline
>
>
Thanks for your tips.
I tried to apply, but I might've gotten it wrong. Can you send this in
patch form so I can be sure of what I change? Especially the linebreak
is not good to understand just in ascii.

Thanks
Danny Milosavljevic Sept. 24, 2016, 7:58 p.m. UTC | #5
Hi,

On Sat, 24 Sep 2016 19:16:23 +0000
ng0 <ngillmann@runbox.com> wrote:

> Thanks for your tips.
> I tried to apply, but I might've gotten it wrong. Can you send this in
> patch form so I can be sure of what I change? Especially the linebreak
> is not good to understand just in ascii.

Sure. (It's a normal line break in a string literal)

I've posted the new patch.
Leo Famulari Sept. 25, 2016, 5:01 p.m. UTC | #6
On Sat, Sep 24, 2016 at 03:27:45PM +0000, ng0 wrote:
> From 2fb504abdf78e63de0d538fd2cebef43b9fc38f6 Mon Sep 17 00:00:00 2001
> From: ng0 <ngillmann@runbox.com>
> Date: Wed, 21 Sep 2016 23:21:39 +0000
> Subject: [PATCH 1/2] gnu: Add python-lz4.
> 
> * gnu/packages/compression.scm (python-lz4): New variable.

This bundles the upstream lz4 library. We should try to make it not use
the bundled copy of the library.
diff mbox

Patch

From 2b96177def2703329cc5544efddcc740264d7944 Mon Sep 17 00:00:00 2001
From: ng0 <ngillmann@runbox.com>
Date: Thu, 22 Sep 2016 00:08:21 +0000
Subject: [PATCH 2/2] gnu: Add python-lzo.

* gnu/packages/compression.scm (python-lzo): New variable.
---
 gnu/packages/compression.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index b1d5338..30e69c6 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -364,6 +364,37 @@  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
+     `(#: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" "\")"))))))))
+    (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")
-- 
2.10.0