[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/03: gnu: Add python-capstone.
From: |
julien lepiller |
Subject: |
02/03: gnu: Add python-capstone. |
Date: |
Sat, 26 Aug 2017 07:03:14 -0400 (EDT) |
roptat pushed a commit to branch master
in repository guix.
commit f70be0113f135d81db8ce3ee1acf997c0bcefe00
Author: Julien Lepiller <address@hidden>
Date: Fri Aug 11 20:49:04 2017 +0200
gnu: Add python-capstone.
* gnu/packages/engineering.scm (python-capstone, python2-capstone): New
variables.
---
gnu/packages/engineering.scm | 29 ++++++++++++++++++++++++++++-
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index db8dbff..b4ccc44 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -33,7 +33,7 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
- #:use-module (guix build-system cmake)
+ #:use-module (guix build-system python)
#:use-module (gnu packages)
#:use-module (gnu packages algebra)
#:use-module (gnu packages autotools)
@@ -1051,3 +1051,30 @@ framework. Capstone can disassemble machine code for
many supported architectur
such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It provides
bindings for Python, Java, OCaml and more.")
(license license:bsd-3)))
+
+;; FIXME: This package has a timestamp embedded in
+;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
+(define-public python-capstone
+ (package
+ (inherit capstone)
+ (name "python-capstone")
+ (propagated-inputs
+ `(("capstone" ,capstone)))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'chdir-and-fix-setup-py
+ (lambda _
+ (chdir "bindings/python")
+ ;; Do not build the library again, because we already have it.
+ (substitute* "setup.py" ((".* build_libraries.*") ""))
+ ;; This substitution tells python-capstone where to find the
+ ;; library.
+ (substitute* "capstone/__init__.py"
+ (("pkg_resources.resource_filename.*")
+ (string-append "'" (assoc-ref %build-inputs "capstone")
"/lib',\n")))
+ #t)))))))
+
+(define-public python2-capstone
+ (package-with-python2 python-capstone))