[PATCH] gnu: Add urh.

  • Done
  • quality assurance status badge
Details
5 participants
  • Arun Isaac
  • Danny Milosavljevic
  • Guillaume Le Vaillant
  • Tobias Geerinckx-Rice
  • zimoun
Owner
unassigned
Submitted by
Arun Isaac
Severity
normal
A
A
Arun Isaac wrote on 6 Apr 2019 12:10
(address . guix-patches@gnu.org)(name . Arun Isaac)(address . arunisaac@systemreboot.net)
20190406101033.24342-1-arunisaac@systemreboot.net
* gnu/packages/ham-radio.scm (urh): New variable.
---
gnu/packages/ham-radio.scm | 40 +++++++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)

Toggle diff (67 lines)
diff --git a/gnu/packages/ham-radio.scm b/gnu/packages/ham-radio.scm
index 6e91866905..16965810fc 100644
--- a/gnu/packages/ham-radio.scm
+++ b/gnu/packages/ham-radio.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2017, 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,11 +20,13 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module (gnu packages gtk)
#:use-module (gnu packages libusb)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
+ #:use-module (gnu packages qt)
#:use-module (gnu packages xml)
#:use-module (guix build-system cmake)
#:use-module (guix build-system python))
@@ -82,3 +84,39 @@ growing list of radios across several manufacturers and allows transferring of
memory contents between them.")
(license (list license:gpl3+
license:lgpl3+)))) ; chirp/elib_intl.py
+
+(define-public urh
+ (package
+ (name "urh")
+ (version "2.5.7")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/jopohl/urh")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "110fwlj2fw8jgrsgqfkha7lx8f06w0ymh51mgpckx8a0wycznhcy"))))
+ (build-system python-build-system)
+ (inputs
+ `(("python-numpy" ,python-numpy)
+ ("python-psutil" ,python-psutil)
+ ("python-pyqt" ,python-pyqt)
+ ("python-pyzmq" ,python-pyzmq)))
+ (native-inputs
+ `(("python-cython" ,python-cython)))
+ (arguments
+ `(#:tests? #f)) ; tests require an X server
+ (home-page "https://github.com/jopohl/urh")
+ (synopsis "Investigate unknown wireless protocols")
+ (description "The Universal Radio Hacker (URH) is a software for
+investigating unknown wireless protocols. Features include hardware
+interfaces for common Software Defined Radios, easy demodulation of signals,
+assigning participants to keep overview of your data, customizable decodings
+to crack even sophisticated encodings like CC1101 data whitening, assign
+labels to reveal the logic of the protocol, fuzzing component to find security
+leaks, modulation support to inject the data back into the system, simulation
+environment to perform stateful attacks.")
+ (license license:gpl3)))
--
2.21.0
D
D
Danny Milosavljevic wrote on 6 Apr 2019 12:22
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 35169@debbugs.gnu.org)
20190406122240.2a140630@scratchpost.org
On Sat, 6 Apr 2019 15:40:33 +0530
Arun Isaac <arunisaac@systemreboot.net> wrote:

Toggle quote (2 lines)
> + `(#:tests? #f)) ; tests require an X server

urh uses Qt as GUI library, so maybe

(setenv "QT_QPA_PLATFORM" "offscreen")

would be enough (in a phase before 'check).

Otherwise make it start an X server :)

Otherwise LGTM!
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlyoffAACgkQ5xo1VCww
uqXUkwf9Hx80oJvwndGLStQRL+dfQTehNmwTcdeGv03Z1y2wHACJjgPHJQPrdQmy
xsnXwgShN5qlteCwcNwvsvD/EEbykpGKO63nrdVcG9jA/iQYe1YREw0sVJp96npD
rCCzgAnZcaiBFaB2WJ/YelDcUMY7HD6yws8QusmNOGqOVygdU2dCPfq6Dvj/DlOd
VKb2XcC5oI45CvAf6e4M/Wi/KleVhk+31jK7Sr5k7FA24naHyOFJb4C0ldaVASOf
DZ5VAbbYwyTU2I37dcnltcP8128oiwiaEwTpS+vkn5Enc5WIjTVHzsXpnufh6MWS
OGart72MRJENlLEi3i+SC05Q/yDt0A==
=UlxM
-----END PGP SIGNATURE-----


A
A
Arun Isaac wrote on 9 Apr 2019 11:24
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 35169@debbugs.gnu.org)
cu7o95fbkf8.fsf@systemreboot.net
Toggle quote (10 lines)
>> + `(#:tests? #f)) ; tests require an X server
>
> urh uses Qt as GUI library, so maybe
>
> (setenv "QT_QPA_PLATFORM" "offscreen")
>
> would be enough (in a phase before 'check).
>
> Otherwise make it start an X server :)

I'll work on this over the weekend and get back to you.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAlysZNsACgkQLiXui2GA
K7OFGwf/crYA2msojhmeXBkOFM9JNnxFzEG7KoKMesq4l6SZKl7AyqP/jIilgI/7
KdOb/jlPXyF33DlVas8gQ7WpMIcQTBA8gDAJ+/H+Rf+E8VsaUlrCSDS417ymuBvM
KOwS5QD6jV6OWDqT0KUC+yroMhHpYaM9N3rgaZcr4H51x3SINPpGdVKzop1Jc7ea
Q1FBaSrillJY2NyXGk4IN6QKOM2+s8Sd6ZmoiqYUGVAQVS9QJcg14vdHW8AlXT/G
Uv4HEiyopNBsf61NTNjLupMDblgM+4aROKx/pTz4dXgToP6b82rXzVdz+CS09E1x
7cP8UZD22rnR8SD5F5Lm2fqPyS/v+w==
=kXid
-----END PGP SIGNATURE-----

A
A
Arun Isaac wrote on 16 Apr 2019 12:31
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 35169@debbugs.gnu.org)
cu7mukqnsvs.fsf@systemreboot.net
Toggle quote (6 lines)
>> + `(#:tests? #f)) ; tests require an X server
>
> urh uses Qt as GUI library, so maybe
>
> (setenv "QT_QPA_PLATFORM" "offscreen")

This works, but there are a lot of other failing tests. Many of them
appear to be upstream bugs. I'm trying to fix them one by one and get
this package ready.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAly1rwgACgkQLiXui2GA
K7M89AgAmnwiidQDFvyytWFZ3znEOQBwKwAUwwmmaH+A/HipKXjNSg+pvLgmaG2u
yxBK4bPtuVTiNuKzlLbgntIhWYB/timc+jAHlzjbV2mG/X4CpP8nXGhlV0elf2Jy
8H0WNpW0x3hpNLl0Ux4Wge6WKRW7UBO54M/NdFspqJWrTc8Nd92fBwVABD9LdAyo
V12DRok1eT0YxSfs2rVvF9yHSihmMvZVNuZO3ASV5d8oFcoUn2Sst/qlYLadLlS6
W2B6nZlKdoGtmUESH9Dfbk/S77JxErpECF3yESHPQ7kV/rmbAoWfFESm6T56F4Xm
Q7lLXHMKsELjlSRIlSfS7bufpXTPxA==
=eiKt
-----END PGP SIGNATURE-----

A
A
Arun Isaac wrote on 25 Apr 2019 20:20
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 35169@debbugs.gnu.org)
cu7lfzyx7yy.fsf@systemreboot.net
Finally got it working!
From 81957a3ac8526eca7a27780e8c0fe1873123de53 Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunisaac@systemreboot.net>
Date: Thu, 25 Apr 2019 20:32:13 +0530
Subject: [PATCH 1/2] gnu: Add hackrf.

* gnu/packages/ham-radio.scm (hackrf): New variable.
---
gnu/packages/ham-radio.scm | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)

Toggle diff (57 lines)
diff --git a/gnu/packages/ham-radio.scm b/gnu/packages/ham-radio.scm
index 6e91866905..e9521032cc 100644
--- a/gnu/packages/ham-radio.scm
+++ b/gnu/packages/ham-radio.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
+;;; Copyright © 2017, 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -20,6 +20,7 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (gnu packages algebra)
#:use-module (gnu packages gtk)
#:use-module (gnu packages libusb)
#:use-module (gnu packages pkg-config)
@@ -82,3 +83,35 @@ growing list of radios across several manufacturers and allows transferring of
memory contents between them.")
(license (list license:gpl3+
license:lgpl3+)))) ; chirp/elib_intl.py
+
+(define-public hackrf
+ (package
+ (name "hackrf")
+ (version "2018.01.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/mossmann/hackrf/releases/download/v"
+ version "/hackrf-" version ".tar.xz"))
+ (sha256
+ (base32
+ "054x08y02gfwax2yb95ajg7gdm8ab1sckcmkcy1s2bqxkb0av6x8"))))
+ (build-system cmake-build-system)
+ (inputs
+ `(("fftwf" ,fftwf)
+ ("libusb" ,libusb)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (arguments
+ `(#:tests? #f ; no tests
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'chdir-to-source
+ (lambda _
+ (chdir "host")
+ #t)))))
+ (home-page "https://github.com/mossmann/hackrf")
+ (synopsis "Driver for HackRF, a general purpose software defined radio")
+ (description "@code{hackrf} provides drivers for HackRF, a general purpose
+software defined radio (SDR).")
+ (license license:gpl2+)))
--
2.21.0
From 4693278e0b249d3edb0556d507d8eeb6ee5d2c4b Mon Sep 17 00:00:00 2001
From: Arun Isaac <arunisaac@systemreboot.net>
Date: Sat, 6 Apr 2019 14:44:44 +0530
Subject: [PATCH 2/2] gnu: Add urh.

* gnu/packages/ham-radio.scm (urh): New variable.
---
gnu/packages/ham-radio.scm | 68 ++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)

Toggle diff (91 lines)
diff --git a/gnu/packages/ham-radio.scm b/gnu/packages/ham-radio.scm
index e9521032cc..58a8161851 100644
--- a/gnu/packages/ham-radio.scm
+++ b/gnu/packages/ham-radio.scm
@@ -20,12 +20,15 @@
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix download)
+ #:use-module (guix git-download)
#:use-module (gnu packages algebra)
+ #:use-module (gnu packages check)
#:use-module (gnu packages gtk)
#:use-module (gnu packages libusb)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages python-xyz)
+ #:use-module (gnu packages qt)
#:use-module (gnu packages xml)
#:use-module (guix build-system cmake)
#:use-module (guix build-system python))
@@ -115,3 +118,68 @@ memory contents between them.")
(description "@code{hackrf} provides drivers for HackRF, a general purpose
software defined radio (SDR).")
(license license:gpl2+)))
+
+(define-public urh
+ (package
+ (name "urh")
+ (version "2.5.7")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/jopohl/urh")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "110fwlj2fw8jgrsgqfkha7lx8f06w0ymh51mgpckx8a0wycznhcy"))))
+ (build-system python-build-system)
+ (inputs
+ `(("hackrf" ,hackrf)
+ ("python-numpy" ,python-numpy)
+ ("python-psutil" ,python-psutil)
+ ("python-pyqt" ,python-pyqt)
+ ("python-pyzmq" ,python-pyzmq)
+ ("rtl-sdr" ,rtl-sdr)))
+ (native-inputs
+ `(("python-cython" ,python-cython)
+ ("python-pytest" ,python-pytest)))
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'configure-compiler
+ (lambda _
+ ;; Use gcc as compiler
+ (substitute* "src/urh/dev/native/ExtensionHelper.py"
+ (("compiler = ccompiler\\.new_compiler\\(\\)\n" all)
+ (string-append
+ all " compiler.set_executables(compiler='gcc',"
+ " compiler_so='gcc', linker_exe='gcc', linker_so='gcc -shared')\n")))
+ #t))
+ (replace 'build
+ (lambda _
+ (invoke "python" "setup.py" "build" "build_ext")
+ (invoke "python" "src/urh/cythonext/build.py")))
+ (replace 'check
+ (lambda _
+ ;; Run X server tests offscreen in headless mode
+ (setenv "QT_QPA_PLATFORM" "offscreen")
+ (setenv "HOME" "/tmp")
+ ;; Fix permissions
+ (with-directory-excursion "tests/data"
+ (for-each (lambda (file)
+ (chmod file #o755))
+ (list "decode.py" "encode.py")))
+ ;; Run tests
+ (invoke "pytest"))))))
+ (home-page "https://github.com/jopohl/urh")
+ (synopsis "Investigate unknown wireless protocols")
+ (description "The Universal Radio Hacker (URH) is a software for
+investigating unknown wireless protocols. Features include hardware
+interfaces for common software defined radios, easy demodulation of signals,
+assigning participants to keep an overview of your data, customizable
+decodings to crack even sophisticated encodings like CC1101 data whitening,
+assigning labels to reveal the logic of the protocol, a fuzzing component to
+find security leaks, modulation support to inject data back into the system
+and a simulation environment to perform stateful attacks.")
+ (license license:gpl3+)))
--
2.21.0
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAlzB+mUACgkQLiXui2GA
K7ODRgf9HBwmmPhoz1h7+qMqet8HseEPr32PaVI447yAF3VTKADZkLkDzO7an6+6
BPZJI0RbEDhZIvmhFqObsqUyj4ynE+r2MCP9tehrps4xWnPxUKxmCcLkMJz6KFl9
CMFJGEJCuLgNECl0bSe38okbRNJu2nGWeh9sRrockjkDMYKgG7I3wjn+3kgPfDA6
Wvt0REGTgqkIOQD+CczbxhkD4PekCLVt7mNGj1D3ZAXRKsYPdiF/O6qwErVFX28K
HMi51aiB4fpKW0sEutcivkiu7g5jhRTPhP+15aXCzC1KB/3Bc7HVkd8A0XM7xsxW
gdo7Gp3sL7mrelcWfXtqa/YePIh5SA==
=NsMQ
-----END PGP SIGNATURE-----

T
T
Tobias Geerinckx-Rice wrote on 25 Apr 2019 20:45
(address . 35169@debbugs.gnu.org)
87mukd2abi.fsf@nckx
Arun,

Arun Isaac wrote:
Toggle quote (7 lines)
> + (synopsis "Driver for HackRF, a general purpose software
> defined radio")
> + (description "@code{hackrf} provides drivers for HackRF, a
> general purpose
> +software defined radio (SDR).")

Drivers for… Linux? CUSE? Something else? (URH?)

Kind regards,

T G-R
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQT12iAyS4c9C3o4dnINsP+IT1VteQUCXMIAQQAKCRANsP+IT1Vt
ed/bAQD7wF2PhWjPzf0ybjHsmBlJlbWjSD9Rq1cZcJR9WYXbCQEAxU5l3QiACHI1
cpKIGfBPbMzhPC+BB6IF6rNQU2DjcAg=
=wv/l
-----END PGP SIGNATURE-----

A
A
Arun Isaac wrote on 26 Apr 2019 09:00
(name . Tobias Geerinckx-Rice)(address . me@tobias.gr)(address . 35169@debbugs.gnu.org)
cu7ftq5xnd5.fsf@systemreboot.net
Toggle quote (8 lines)
>> + (synopsis "Driver for HackRF, a general purpose software
>> defined radio")
>> + (description "@code{hackrf} provides drivers for HackRF, a
>> general purpose
>> +software defined radio (SDR).")
>
> Drivers for… Linux? CUSE? Something else? (URH?)

Actually, this package provides a library that uses libusb to interface
with the HackRF software defined radio. Shall I rewrite the synopsis and
description as follows, replacing "driver" with "library"? Or, should I
say "userspace driver" instead of "library"?

synopsis:

Interface library for the HackRF software defined radio

description:

@code{hackrf} provides a library to interface with HackRF, a general
purpose software defined radio.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAlzCrHYACgkQLiXui2GA
K7OJ6Af6AsLvNAdOo2JNVBOk1/E36olIDeiFv3AlIMSA4VOLoHhyYpCWrQrS+mXS
nEqnyQ096F9jA6J27C1vH+a+w/waF4ETSVjWUXasPGEaEjI+2GpmYTIoglGfN5oa
NaEs/vz1A6MVJPDv3NUzaUg1tJsSIOJQFpywZXbFX9FNPvFayxtq95lpilCJsU1a
hmZ4YamGsM1GY+h9WDktu4oRG5K5bJPA5z5vcFZTz1u2ubnNS6fh6KB8nWOWDWqg
W358WQphoFE8RYUlWXJSGek32ht3r4u0VCQR5IbYICrbWtsrC6VWGkXvZUenB450
85LnGvQxPoALoi89VzIarYVcxk5+dA==
=lfYZ
-----END PGP SIGNATURE-----

Z
Z
zimoun wrote on 7 Apr 2022 14:41
Re: bug#35169: [PATCH] gnu: Add urh.
(name . Arun Isaac)(address . arunisaac@systemreboot.net)
86czht2hia.fsf_-_@gmail.com
Hi,

Looking at old patch submission, I hit this:


and I miss why it is not merged…

On Fri, 26 Apr 2019 at 12:30, Arun Isaac <arunisaac@systemreboot.net> wrote:
Toggle quote (22 lines)
>>> + (synopsis "Driver for HackRF, a general purpose software
>>> defined radio")
>>> + (description "@code{hackrf} provides drivers for HackRF, a
>>> general purpose
>>> +software defined radio (SDR).")
>>
>> Drivers for… Linux? CUSE? Something else? (URH?)
>
> Actually, this package provides a library that uses libusb to interface
> with the HackRF software defined radio. Shall I rewrite the synopsis and
> description as follows, replacing "driver" with "library"? Or, should I
> say "userspace driver" instead of "library"?
>
> synopsis:
>
> Interface library for the HackRF software defined radio
>
> description:
>
> @code{hackrf} provides a library to interface with HackRF, a general
> purpose software defined radio.

…I mean, description and synopsis are important but they should not be a
blocker here. :-)

Arun, could you rebase and merge it?


Cheers,
simon
A
A
Arun Isaac wrote on 19 Apr 2022 12:09
(name . zimoun)(address . zimon.toutoune@gmail.com)
87ee1tbd11.fsf@systemreboot.net
Hi zimoun,

Sorry for the very late response! hackrf is already packaged for Guix
thanks to an unrelated commit by Christopher Howard in
79c4fb4f366cff3ad75982b4a09c6bd82e604674. urh is many new versions ahead
and my old patch no longer works. On casual inspection, I found that it
might take significantly more work to get working again. But, I'm not
using urh any longer and I'm not interested in it any more. Would it be
ok to close this issue without merging?

Regards,
Arun
G
G
Guillaume Le Vaillant wrote on 29 Apr 2022 14:45
(name . Arun Isaac)(address . arunisaac@systemreboot.net)(address . 35169-done@debbugs.gnu.org)
87pml0gilt.fsf@kitej
Hi Arun,

I made an updated package definition for urh based on yours and pushed
it as 653eef9b41ad74cb0e0aa10ed4ca691359b2515a.
Thanks.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCYmvezg8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j+AHQD9Fgrt42O8PBNgxKKJCwFUzZTvHhTjajPyAf19
dqS+lS0BAI3WaaxGfxbNfK2bAPInMv4EGpWPfqQtRqNd3syYUkdG
=O95X
-----END PGP SIGNATURE-----

Closed
A
A
Arun Isaac wrote on 2 May 2022 07:54
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 35169-done@debbugs.gnu.org)
87o80g32dq.fsf@systemreboot.net
Thanks, Guillaume!
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 35169@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 35169
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