summaryrefslogtreecommitdiff
path: root/modules/tanelorn/packages/engineering.scm
blob: 2fb25548e68c14eb9b71a17441c8151d4939d896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
;;; Copyright © 2025 bdunahu <bdunahu@operationnull.com>
;;;
;;; SPDX-License-Identifier: GPL-3.0-or-later

(define-module (tanelorn packages engineering)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system meson)
  #:use-module (guix build-system gnu)
  #:use-module (guix git-download)
  #:use-module (guix gexp)
  #:use-module (guix packages)
  #:use-module (tanelorn packages)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages digest)
  #:use-module (gnu packages engineering)
  #:use-module (gnu packages javascript)
  #:use-module (gnu packages libevent)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages tls))

(define-public sdb
  (package
    (name "sdb")
    (version "2.2.4")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                     (url "https://github.com/radareorg/sdb.git")
                     (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "15pc807s2nmhnr3mspyz9h47rkxkv1r07x959ir17v5b6zs7wxvw"))))
    (build-system meson-build-system)
    (arguments
     (list
      #:phases
      #~(modify-phases %standard-phases
          ;; The meson config offloads the work of running the tests to
          ;; the Makefile, which 1) assumes the source directory is the parent
          ;; of the build directory, and 2) the CC environment variable is set.
          (add-before 'check 'fix-meson-test-declaration
            (lambda _
              (substitute* "../source/meson.build"
                (("env: \\[(.*)$" _ end)
                 (string-append "env: ['CC=gcc', " end))
                (("workdir: join_paths.*$")
                 "workdir: meson.project_source_root(),\n")))))))
    (home-page "https://github.com/radareorg/sdb")
    (synopsis "Simple and fast string based key-value database")
    (description "SDB is a simple key/value database based on djb's cdb disk
storage that supports JSON and array introspection.")
    (license license:expat)))

(define-public radare2-6.0.7
  (package
    (name "radare2")
    (version "6.0.7")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                     (url "https://github.com/radareorg/radare2")
                     (commit version)))
              (sha256
               (base32
                "1nkqa8mkmvmbc3812gf5ayfmzyf0krjgc1695rpkphw3fsl76rgx"))
              (file-name (git-file-name name version))
              (patches
               (tanelorn-patches "radare2-fix-meson-build-to-use-sys-sdb.patch"
				 "radare2-fix-meson-build-to-use-sys-qjs.patch"))))
    (build-system meson-build-system)
    (arguments
     (list
      #:configure-flags
      #~(list "-Duse_sys_capstone=true"
              "-Duse_sys_magic=true"
              "-Duse_sys_zip=true"
              "-Duse_sys_zlib=true"
              "-Duse_sys_lz4=true"
              "-Duse_sys_xxhash=true"
              "-Duse_sys_openssl=true")
      #:phases
      #~(modify-phases %standard-phases
          ;; CHECK LATER: This patches an incorrect relative include.
          (add-before 'build 'fix-relative-include
            (lambda* _
              (substitute* "../source/libr/arch/p/java/plugin.c"
                (("include \".." all)
                 (string-append all "/..")))))
          ;; These tests require sample binaries from an external repository.
          (add-before 'check 'skip-tests
            (lambda* _
              (substitute* '("../source/test/unit/test_bin.c"
                             "../source/test/unit/test_dwarf.c"
                             "../source/test/unit/test_dwarf_info.c"
                             "../source/test/unit/test_dwarf_integration.c"
                             "../source/test/unit/test_pdb.c"
                             "../source/test/unit/test_r2pipe.c")
                (("(^| )main *\\(.*" all)
                 (string-append all " exit (77);\n"))))))))
    (inputs
     (list capstone
	   gmp
	   libuv
	   libzip
	   lz4
	   openssl
	   python
	   quickjs-ng
	   sdb
	   zip
           zlib))
    (native-inputs
     (list pkg-config))
    (propagated-inputs
     (list xxhash))
    (home-page "https://radare.org/")
    (synopsis "Reverse engineering framework")
    (description
     "Radare2 is a complete framework for reverse-engineering, debugging, and
analyzing binaries.  It is composed of a set of small utilities that can be
used together or independently from the command line.

Radare2 is built around a scriptable disassembler and hexadecimal editor that
support a variety of executable formats for different processors and operating
systems, through multiple back ends for local and remote files and disk
images.

It can also compare (@dfn{diff}) binaries with graphs and extract information
like relocation symbols.  It is able to deal with malformed binaries, making
it suitable for security research and analysis.")
    (license license:lgpl3)))

(define-public python-austin
  (package
   (name "python-austin")
   (version "3.7.0")
   (source
    (origin
     (method git-fetch)
     (uri (git-reference
             (url "https://github.com/P403n1x87/austin")
             (commit (string-append "v" version))
             (recursive? #f)))
     (sha256
      (base32 "0074gjkf7agkbgs7k9py2gk7i4ir27bq12mbnslm3fwnxl3vyxk0"))
     (file-name (git-file-name name version))))
   (build-system gnu-build-system)
   (native-inputs (list autoconf automake))
   (home-page "https://github.com/P403n1x87/austin")
   (synopsis "Python frame stack sampler for CPython")
   (description
    "Austin is a Python frame stack sampler for CPython written in pure C.
Samples are collected by reading the CPython interpreter virtual memory space
to retrieve information about the currently running threads along with the stack
of the frames that are being executed. Hence, one can use Austin to easily make
powerful statistical profilers that have minimal impact on the target
application and that don't require any instrumentation.")
   (license (list license:gpl3+))))