Add radare2

  • Done
  • quality assurance status badge
Details
3 participants
  • Julien Lepiller
  • Marius Bakke
  • Ricardo Wurmus
Owner
unassigned
Submitted by
Julien Lepiller
Severity
normal

Debbugs page

J
J
Julien Lepiller wrote on 11 Aug 2017 11:56
(address . guix-patches@gnu.org)
20170811205612.14cc6088@lepiller.eu
Hi, these patches add radare2, a reversing framework.
From fa5478ac8eccf51a62af574ef2be6316ba5c247b Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
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 | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 650ac2b89..8c6280c14 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -1013,3 +1013,38 @@ specified in high-level description language into ready-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/archive/"
+ 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=" %output)
+ "CC=gcc")
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'build 'fix-cstool-ldflags
+ (lambda* (#:key outputs #:allow-other-keys)
+ (substitute* "cstool/Makefile"
+ (("LDFLAGS =")
+ (string-append "LDFLAGS = -Wl,-rpath=" (assoc-ref outputs "out")
+ "/lib"))))))))
+ (home-page "http://www.capstone-engine.org")
+ (synopsis "Lightweight multi-platform, multi-architecture disassembly framework")
+ (description
+ "Capstone is a lightweight multi-platform, multi-architecture disassembly
+framework. Capstone can disassemble machine code for many supported architectures
+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)))
--
2.14.1
From 078c0cdedb620e7acdf9baea8924499ad5f8311a Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
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 | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)

Toggle diff (44 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 8c6280c14..6ba5131e7 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -32,7 +32,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)
@@ -1048,3 +1048,28 @@ 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)))
+
+;; 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
+ `(#:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'chdir-and-fix-setup-py
+ (lambda _
+ (chdir "bindings/python")
+ (substitute* "setup.py" ((".* build_libraries.*") ""))
+ (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
From ad50754454fdda9d4be91f6bc739df07fe63ecb6 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
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 | 49 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)

Toggle diff (59 lines)
diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
index 6ba5131e7..130703e93 100644
--- a/gnu/packages/engineering.scm
+++ b/gnu/packages/engineering.scm
@@ -1073,3 +1073,52 @@ 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
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'mklibdir
+ (lambda* (#:key inputs #:allow-other-keys)
+ (mkdir-p (string-append (assoc-ref %outputs "out") "/lib")))))
+ #: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
R
R
Ricardo Wurmus wrote on 16 Aug 2017 08:19
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 28053@debbugs.gnu.org)
87a82zk0aw.fsf@elephly.net
Hi Julien,

Toggle quote (8 lines)
> Hi, these patches add radare2, a reversing framework.>From fa5478ac8eccf51a62af574ef2be6316ba5c247b Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> Date: Fri, 11 Aug 2017 20:41:39 +0200
> Subject: [PATCH 1/3] gnu: Add capstone.
>
> * gnu/packages/engineering.scm (capstone): New variable.
> ---

Don’t forget to add a copyright line for yourself!

Toggle quote (28 lines)
> +
> +(define-public capstone
> + (package
> + (name "capstone")
> + (version "3.0.5-rc2")
> + (source (origin
> + (method url-fetch)
> + (uri (string-append "https://github.com/aquynh/capstone/archive/"
> + 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=" %output)
> + "CC=gcc")
> + #:phases
> + (modify-phases %standard-phases
> + (delete 'configure)
> + (add-before 'build 'fix-cstool-ldflags
> + (lambda* (#:key outputs #:allow-other-keys)
> + (substitute* "cstool/Makefile"
> + (("LDFLAGS =")
> + (string-append "LDFLAGS = -Wl,-rpath=" (assoc-ref outputs "out")
> + "/lib"))))))))

Please add “#t” to the end of this phase. Is it necessary to do this in
a build phase or could we add this to the make-flags instead?

Toggle quote (32 lines)
>>From 078c0cdedb620e7acdf9baea8924499ad5f8311a Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> 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 | 27 ++++++++++++++++++++++++++-
> 1 file changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
> index 8c6280c14..6ba5131e7 100644
> --- a/gnu/packages/engineering.scm
> +++ b/gnu/packages/engineering.scm
> @@ -32,7 +32,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)
> @@ -1048,3 +1048,28 @@ 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)))
> +
> +;; This package has a timestamp embedded in
> +;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc

Please add “FIXME: ” before the comment.

Toggle quote (10 lines)
> +(define-public python-capstone
> + (package
> + (inherit capstone)
> + (name "python-capstone")
> + (propagated-inputs
> + `(("capstone" ,capstone)))
> + (build-system python-build-system)
> + (arguments
> + `(#:tests? #f

Please add a comment that tells us why the tests are disabled.

Toggle quote (11 lines)
> + #:phases
> + (modify-phases %standard-phases
> + (add-after 'unpack 'chdir-and-fix-setup-py
> + (lambda _
> + (chdir "bindings/python")
> + (substitute* "setup.py" ((".* build_libraries.*") ""))
> + (substitute* "capstone/__init__.py"
> + (("pkg_resources.resource_filename.*")
> + (string-append "'" (assoc-ref %build-inputs "capstone") "/lib',\n")))
> + #t)))))))

Could you please add a comment explaining why these substitutions are
necessary?

Toggle quote (43 lines)
>>From ad50754454fdda9d4be91f6bc739df07fe63ecb6 Mon Sep 17 00:00:00 2001
> From: Julien Lepiller <julien@lepiller.eu>
> 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 | 49 ++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 49 insertions(+)
>
> diff --git a/gnu/packages/engineering.scm b/gnu/packages/engineering.scm
> index 6ba5131e7..130703e93 100644
> --- a/gnu/packages/engineering.scm
> +++ b/gnu/packages/engineering.scm
> @@ -1073,3 +1073,52 @@ 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

As above, please add a comment here.

Toggle quote (6 lines)
> + #:phases
> + (modify-phases %standard-phases
> + (add-before 'configure 'mklibdir
> + (lambda* (#:key inputs #:allow-other-keys)
> + (mkdir-p (string-append (assoc-ref %outputs "out") "/lib")))))

Please use

(add-before 'configure 'mklibdir
(lambda* (#:key outputs #:allow-other-keys)
(mkdir-p (string-append (assoc-ref outputs "out") "/lib"))
#t)))

Why does this need to happen before the configure phase? Can this be
done before the install phase?

Toggle quote (4 lines)
> + #:configure-flags
> + (list "--with-sysmagic" "--with-syszip" "--with-openssl"
> + "--without-nonpic" "--with-rpath" "--with-syscapstone")

Why “without-nonpic”? Should we add support for nonpic at a later
point?

Toggle quote (6 lines)
> + (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, ...")

The description could be improved. The sentence is not complete as it’s
missing a verb.

Toggle quote (2 lines)
> + (license license:lgpl3)))

LGPL version 3 only?

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
R
R
Ricardo Wurmus wrote on 16 Aug 2017 08:19
control message for bug #28053
(address . control@debbugs.gnu.org)
E1di06Z-0003eJ-Fv@debbugs.gnu.org
tags 28053 moreinfo
M
M
Marius Bakke wrote on 16 Aug 2017 15:24
Re: [bug#28053] Add radare2
(address . 28053@debbugs.gnu.org)
87mv6zywvv.fsf@fastmail.com
Ricardo Wurmus <rekado@elephly.net> writes:
Toggle quote (6 lines)
>> +
>> +;; This package has a timestamp embedded in
>> +;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
>
> Please add “FIXME: ” before the comment.

FYI, there is an upstream patch (in review) that makes Python respect
SOURCE_DATE_EPOCH when compiling bytecode. I'm going to try picking
that for the 3.6 update, so this comment won't be necessary for long.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlmUxgQACgkQoqBt8qM6
VPpClwf+PsAfpjc7+z3ra6lxARoSxtyHwP3n7YZfV/sGG52rxnrfp8bBmDZcF9ik
Km/auLIkUvqG3vgJ+1gDRHFmCI2Vm/Cy/LS0BXuCX7Zce7D0DZxCzmILihEQrEc1
1AsDZcjsObXc3W2AM+a6tmfCmvU0ymCn/quWmi/7S9TMuIgsKozu2CLBpzTPy9Fe
hzVAHYJ/rPJ+YqhSzOQQMOkkq+sBWHTj/VdArjcotEfp0zupoGZ3E2hFrJaVtNYf
CNVzdz84zCUcPoe9ZIXhVtMHZKLi9qJCVFCCxhpegxOCCg16uFSNedmZkKVNfOWR
RJLDA7wu2uOHDduIK0nyJmrTSpzrCg==
=RBvb
-----END PGP SIGNATURE-----

R
R
Ricardo Wurmus wrote on 16 Aug 2017 23:57
(name . Marius Bakke)(address . mbakke@fastmail.com)
877ey2k7fw.fsf@elephly.net
Marius Bakke <mbakke@fastmail.com> writes:

Toggle quote (11 lines)
> Ricardo Wurmus <rekado@elephly.net> writes:
>>> +
>>> +;; This package has a timestamp embedded in
>>> +;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
>>
>> Please add “FIXME: ” before the comment.
>
> FYI, there is an upstream patch (in review) that makes Python respect
> SOURCE_DATE_EPOCH when compiling bytecode. I'm going to try picking
> that for the 3.6 update, so this comment won't be necessary for long.

Oh, that’s good. Will this fix the remaining reproducibility problems
with Python?

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC
J
J
Julien Lepiller wrote on 17 Aug 2017 12:22
Re: [bug#28053] Add radare2 (v2)
(address . 28053@debbugs.gnu.org)
20170817212244.5e42832d@lepiller.eu
Hi,

here is the new version of the patches
From 0e893d50f3352d235bb70d1e3f1ce8f1b246d99e Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
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(+)

Toggle diff (55 lines)
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 © 2016 David Thompson <davet@gnu.org>
;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016, 2017 Theodoros Foradis <theodoros.for@openmailbox.org>
+;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1013,3 +1014,40 @@ specified in high-level description language into ready-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/archive/"
+ 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=" %output)
+ "CC=gcc")
+ #: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 =")
+ (string-append "LDFLAGS = -Wl,-rpath=" (assoc-ref outputs "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 disassembly
+framework. Capstone can disassemble machine code for many supported architectures
+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)))
--
2.14.1
From e881c1cc7b4073e74294e6bf4817743ff0a08d02 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
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(-)

Toggle diff (46 lines)
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
From 659376711046c89b2dbb1e00410a3684fb0d81a0 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
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(-)

Toggle diff (86 lines)
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 <http://www.gnu.org/licenses/>.
(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
M
M
Marius Bakke wrote on 17 Aug 2017 13:35
Re: [bug#28053] Add radare2
(name . Ricardo Wurmus)(address . rekado@elephly.net)
87efsaylta.fsf@fastmail.com
Ricardo Wurmus <rekado@elephly.net> writes:

Toggle quote (16 lines)
> Marius Bakke <mbakke@fastmail.com> writes:
>
>> Ricardo Wurmus <rekado@elephly.net> writes:
>>>> +
>>>> +;; This package has a timestamp embedded in
>>>> +;; lib/python3.5/site-packages/capstone/__pycache__/__iti__.cpython-35.pyc
>>>
>>> Please add “FIXME: ” before the comment.
>>
>> FYI, there is an upstream patch (in review) that makes Python respect
>> SOURCE_DATE_EPOCH when compiling bytecode. I'm going to try picking
>> that for the 3.6 update, so this comment won't be necessary for long.
>
> Oh, that’s good. Will this fix the remaining reproducibility problems
> with Python?

We also need to provide a stable PYTHONHASHSEED, but I do believe these
measures will fix the vast majority of Python reproducibility issues.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlmV/hEACgkQoqBt8qM6
VPrfwQf/drb+6EY+CuE5oS0PGkFGL5iN3arua57l7y7SO4jTtTk9HxtFIR6QXbv9
hqoPTunHYATck1J167blX/QYaIoaFi6I+iHVuSiwm4Ut8EnWwY5PcSPwh16y2Ic8
mfbbJ4NJ2HSvihTAUezhpiXjILNvHel2AgF15AKhxkE8t06Yi9WiEoontKFZmI1n
F3sMpKo6zpd8o4z3Yzv+cPWB1dKLoL5I0+2+wLrkKGUhQQ4GznFesRUt41cPFTVd
ynG34XTVAcxiRAPiDcCzEf33b2k4XKil/Rz12SXrp3UKh1c6ph3GmjRKCE7Wy2KB
ur7i/63pesCB2v7wKSv4qWUEdL5lEw==
=kKIz
-----END PGP SIGNATURE-----

J
J
Julien Lepiller wrote on 26 Aug 2017 04:04
Re: [bug#28053] Add radare2 (v2)
(address . 28053-done@debbugs.gnu.org)
20170826130404.617e8393@lepiller.eu
Pushed as 6febda9443e34adda38b7c365ff2d7368f589995 -
446695775d6d8d15546c5d0fc535e9f5c83a7b7e

Le Thu, 17 Aug 2017 21:22:44 +0200,
Julien Lepiller <julien@lepiller.eu> a écrit :

Toggle quote (3 lines)
> Hi,
>
> here is the new version of the patches
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 28053@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 28053
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch