From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 17 15:23:41 2017 Received: (at 28053) by debbugs.gnu.org; 17 Aug 2017 19:23:41 +0000 Received: from localhost ([127.0.0.1]:43140 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diQOE-0006c7-4n for submit@debbugs.gnu.org; Thu, 17 Aug 2017 15:23:41 -0400 Received: from [89.234.186.109] (port=55264 helo=localhost) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1diQOC-0006bz-Dd for 28053@debbugs.gnu.org; Thu, 17 Aug 2017 15:23:33 -0400 Received: from localhost (static-176-182-42-79.ncc.abo.bbox.fr [176.182.42.79]) by localhost (OpenSMTPD) with ESMTPSA id a9388b16 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <28053@debbugs.gnu.org>; Thu, 17 Aug 2017 19:23:31 +0000 (UTC) Date: Thu, 17 Aug 2017 21:22:44 +0200 From: Julien Lepiller To: 28053@debbugs.gnu.org Subject: Re: [bug#28053] Add radare2 (v2) Message-ID: <20170817212244.5e42832d@lepiller.eu> In-Reply-To: <87a82zk0aw.fsf@elephly.net> References: <20170811205612.14cc6088@lepiller.eu> <87a82zk0aw.fsf@elephly.net> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/S_1Si0EkXuxCruJuiBRW.vx" X-Spam-Score: 4.9 (++++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, here is the new version of the patches From 0e893d50f3352d235bb70d1e3f1ce8f1b246d99e Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 11 Aug 2017 20:41:39 +0200 Subject: [PATCH 1/3] gnu: Add capstone. [...] Content analysis details: (4.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FSL_HELO_NON_FQDN_1 No description available. 3.6 HELO_LOCALHOST No description available. 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS X-Debbugs-Envelope-To: 28053 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 4.9 (++++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hi, here is the new version of the patches From 0e893d50f3352d235bb70d1e3f1ce8f1b246d99e Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 11 Aug 2017 20:41:39 +0200 Subject: [PATCH 1/3] gnu: Add capstone. [...] Content analysis details: (4.9 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FSL_HELO_NON_FQDN_1 No description available. 3.6 HELO_LOCALHOST No description available. 1.3 RDNS_NONE Delivered to internal network by a host with no rDNS --MP_/S_1Si0EkXuxCruJuiBRW.vx Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, here is the new version of the patches --MP_/S_1Si0EkXuxCruJuiBRW.vx Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-Add-capstone.patch =46rom 0e893d50f3352d235bb70d1e3f1ce8f1b246d99e Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 11 Aug 2017 20:41:39 +0200 Subject: [PATCH 1/3] gnu: Add capstone. * gnu/packages/engineering.scm (capstone): New variable. --- gnu/packages/engineering.scm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index 650ac2b89..db8dbff1e 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -5,6 +5,7 @@ ;;; Copyright =C2=A9 2016 David Thompson ;;; Copyright =C2=A9 2016, 2017 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2016, 2017 Theodoros Foradis +;;; Copyright =C2=A9 2017 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -1013,3 +1014,40 @@ specified in high-level description language into re= ady-to-compile C code for the API of spice simulators. Based on transformations specified in XML language, ADMS transforms Verilog-AMS code into other target languages.") (license license:gpl3))) + +(define-public capstone + (package + (name "capstone") + (version "3.0.5-rc2") + (source (origin + (method url-fetch) + (uri (string-append "https://github.com/aquynh/capstone/arch= ive/" + version ".tar.gz")) + (file-name (string-append name "-" version ".tar.gz")) + (sha256 + (base32 + "1cqms9r2p43aiwp5spd84zaccp16ih03r7sjhrv16nddahj0jz2q")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f + #:make-flags (list (string-append "PREFIX=3D" %output) + "CC=3Dgcc") + #:phases + (modify-phases %standard-phases + (delete 'configure) + ;; cstool's Makefile overrides LDFLAGS, so we cannot pass it as a= make flag. + (add-before 'build 'fix-cstool-ldflags + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "cstool/Makefile" + (("LDFLAGS =3D") + (string-append "LDFLAGS =3D -Wl,-rpath=3D" (assoc-ref outp= uts "out") + "/lib"))) + #t))))) + (home-page "http://www.capstone-engine.org") + (synopsis "Lightweight multi-platform, multi-architecture disassembly = framework") + (description + "Capstone is a lightweight multi-platform, multi-architecture disasse= mbly +framework. Capstone can disassemble machine code for many supported archi= tectures +such as x86, x86_64, arm, arm64, mips, ppc, sparc, sysz and xcore. It pro= vides +bindings for Python, Java, OCaml and more.") + (license license:bsd-3))) --=20 2.14.1 --MP_/S_1Si0EkXuxCruJuiBRW.vx Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0002-gnu-Add-python-capstone.patch From e881c1cc7b4073e74294e6bf4817743ff0a08d02 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 11 Aug 2017 20:49:04 +0200 Subject: [PATCH 2/3] 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 db8dbff1e..b4ccc446f 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)) -- 2.14.1 --MP_/S_1Si0EkXuxCruJuiBRW.vx Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0003-gnu-Add-radare2.patch From 659376711046c89b2dbb1e00410a3684fb0d81a0 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Fri, 11 Aug 2017 20:54:40 +0200 Subject: [PATCH 3/3] gnu: Add radare2. * gnu/packages/engineering.scm (radare2): New variable. --- gnu/packages/engineering.scm | 55 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm index b4ccc446f..008a96b24 100644 --- a/gnu/packages/engineering.scm +++ b/gnu/packages/engineering.scm @@ -23,6 +23,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages engineering) + #:use-module (srfi srfi-1) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix gexp) @@ -60,6 +61,7 @@ #:use-module (gnu packages linux) ;FIXME: for pcb #:use-module (gnu packages m4) #:use-module (gnu packages maths) + #:use-module (gnu packages multiprecision) #:use-module (gnu packages ncurses) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) @@ -71,8 +73,7 @@ #:use-module (gnu packages tls) #:use-module (gnu packages tex) #:use-module (gnu packages wxwidgets) - #:use-module (gnu packages xorg) - #:use-module (srfi srfi-1)) + #:use-module (gnu packages xorg)) (define-public librecad (package @@ -1078,3 +1079,53 @@ bindings for Python, Java, OCaml and more.") (define-public python2-capstone (package-with-python2 python-capstone)) + +(define-public radare2 + (package + (name "radare2") + (version "1.6.0") + (source (origin + (method url-fetch) + (uri (string-append "http://radare.mikelloc.com/get/" version "/" + name "-" version ".tar.gz")) + (sha256 + (base32 + "16ggsk40zz6hyvclvqj1r4bh4hb78jf0d6ppry1jk4r0j30wm7cm")) + (modules '((guix build utils))) + (snippet + '(begin + (substitute* "libr/asm/p/Makefile" + (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) ")) + (substitute* "libr/parse/p/Makefile" + (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) ")) + (substitute* "libr/bin/p/Makefile" + (("LDFLAGS\\+=") "LDFLAGS+=-Wl,-rpath=$(LIBDIR) ")))))) + (build-system gnu-build-system) + (arguments + '(#:tests? #f; tests require git and network access + #:phases + (modify-phases %standard-phases + (add-before 'configure 'mklibdir + (lambda* (#:key inputs #:allow-other-keys) + (mkdir-p (string-append (assoc-ref %outputs "out") "/lib")) + #t))) + #:configure-flags + (list "--with-sysmagic" "--with-syszip" "--with-openssl" + "--without-nonpic" "--with-rpath" "--with-syscapstone") + #:make-flags + (list "CC=gcc"))) + (inputs + `(("openssl" ,openssl) + ("zip" ,zip) + ("gmp" ,gmp) + ("capstone" ,capstone))) + (native-inputs + `(("pkg-config" ,pkg-config))) + (home-page "https://radare.org/") + (synopsis "Portable reversing framework") + (description + "Radare project started as a forensics tool, a scriptable commandline +hexadecimal editor able to open disk files, but later support for analyzing +binaries, disassembling code, debugging programs, attaching to remote gdb +servers, ...") + (license license:lgpl3))) -- 2.14.1 --MP_/S_1Si0EkXuxCruJuiBRW.vx--