guix-commits
[Top][All Lists]
Advanced

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

02/04: gnu: Add python-libarchive-c.


From: Ludovic Courtès
Subject: 02/04: gnu: Add python-libarchive-c.
Date: Thu, 15 Oct 2015 21:12:06 +0000

civodul pushed a commit to branch master
in repository guix.

commit d96034ed697bcbac90b65304a08c90c5a0b08e33
Author: Ludovic Courtès <address@hidden>
Date:   Thu Oct 15 22:37:26 2015 +0200

    gnu: Add python-libarchive-c.
    
    * gnu/packages/python.scm (python-libarchive-c, python2-libarchive-c):
      New variables.
---
 gnu/packages/python.scm |   47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 2a240fa..c972b62 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -36,6 +36,7 @@
   #:use-module ((guix licenses) #:select (expat zlib) #:prefix license:)
   #:use-module (gnu packages)
   #:use-module (gnu packages attr)
+  #:use-module (gnu packages backup)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages fontutils)
@@ -5666,3 +5667,49 @@ a hash value.")
     (inherit python-tlsh)
     (name "python2-tlsh")
     (inputs `(("python" ,python-2)))))
+
+(define-public python-libarchive-c
+  (package
+    (name "python-libarchive-c")
+    (version "2.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    
"https://pypi.python.org/packages/source/l/libarchive-c/libarchive-c-";
+                    version ".tar.gz"))
+              (sha256
+               (base32
+                "089lrz6xyrfnk55v35vis6jyqyyl77w093057djyspnd2744wi2n"))))
+    (build-system python-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-before
+                   'build 'reference-libarchive
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     ;; Retain the absolute file name of libarchive.so.
+                     (let ((libarchive (assoc-ref inputs "libarchive")))
+                       (substitute* "libarchive/ffi.py"
+                         (("find_library\\('archive'\\)")
+                          (string-append "'" libarchive
+                                         "/lib/libarchive.so'"))))
+
+                     ;; Do not make a compressed egg (see
+                     ;; <http://bugs.gnu.org/20765>).
+                     (let ((port (open-file "setup.cfg" "a")))
+                       (display "\n[easy_install]\nzip_ok = 0\n"
+                                port)
+                       (close-port port)
+                       #t))))))
+    (inputs
+     `(("python-setuptools" ,python-setuptools)
+       ("libarchive" ,libarchive)))
+    (home-page "https://github.com/Changaco/python-libarchive-c";)
+    (synopsis "Python interface to libarchive")
+    (description
+     "This package provides Python bindings to libarchive, a C library to
+access possibly compressed archives in many different formats.  It uses
+Python's @code{ctypes} foreign function interface (FFI).")
+    (license lgpl2.0+)))
+
+(define-public python2-libarchive-c
+  (package-with-python2 python-libarchive-c))



reply via email to

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