hackrf: new package

  • Done
  • quality assurance status badge
Details
6 participants
  • Christopher Howard
  • Christopher Howard
  • Danny Milosavljevic
  • Guillaume Le Vaillant
  • Jack Hill
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Howard
Severity
normal

Debbugs page

Christopher Howard wrote 5 years ago
(address . guix-patches@gnu.org)
33d8820578a5011bfd66f694b32f2e60d273469d.camel@librehacker.com
Patch is attached for new package `hackrf'. Installing this package
installs the userspace hackrf utilities and C library. To install the
hackrf udev rules, you must add this package as a system service via
modify-services. E.g.:

'''
(services
(modify-services
(append
#| your other services |#
(udev-service-type config =>
(udev-configuration (inherit config)
(rules (cons hackrf
(udev-configuration-rules config)))))))
'''

And also you need to add your local user to the `dialout' group. I did
a simple test with my HackRF One and hackrf_info was able to detect the
board, indicating that package works on x86_64.

--
Christopher Howard
p: +1 (907) 374-0257
gpg: ADDEAADE5D607C8D (keys.gnupg.net)
From 68c43c038675b142deddfa5cf8f4c4d62125ed11 Mon Sep 17 00:00:00 2001
From: Christopher Howard <christopher@librehacker.com>
Date: Tue, 17 Dec 2019 05:22:52 -0900
Subject: [PATCH] hackrf: new package

---
gnu/packages/hackrf.scm | 72 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 72 insertions(+)
create mode 100644 gnu/packages/hackrf.scm

Toggle diff (80 lines)
diff --git a/gnu/packages/hackrf.scm b/gnu/packages/hackrf.scm
new file mode 100644
index 0000000000..9b225573a2
--- /dev/null
+++ b/gnu/packages/hackrf.scm
@@ -0,0 +1,72 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2019 Christopher Howard <christopher@librehacker.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages hackrf)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module (guix packages)
+ #:use-module (guix utils)
+ #:use-module (guix download)
+ #:use-module (guix git-download)
+ #:use-module (guix build-system cmake)
+ #:use-module (gnu packages)
+ #:use-module (gnu packages algebra)
+ #:use-module (gnu packages libusb)
+ #:use-module (gnu packages pkg-config))
+
+(define-public hackrf
+ ;; Using a git commit because there have been many many commits
+ ;; since the relase two years ago
+ (let ((commit "e9c6c2d2e6f9c2e903c1e69de9a48aa4b28a1e55")
+ (revision "0"))
+ (package
+ (name "hackrf")
+ (version (git-version "2018.01.1" revision commit))
+ (source
+ (origin (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mossmann/hackrf.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0vqlr0nph9r7wpqn81ghhdbb131803b8wi328iaz37304mrr6hkw"))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:configure-flags
+ (list "-DUDEV_RULES_GROUP=dialout"
+ (string-append "-DUDEV_RULES_PATH="
+ (assoc-ref %outputs "out")
+ "/lib/udev/rules.d"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'enter-source-directory
+ (lambda _ (chdir "host") #t))
+ (add-before 'install-license-files 'leave-source-directory
+ (lambda _ (chdir "..") #t)))
+ #:tests? #f)) ; no test suite
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("fftw" ,fftw)
+ ("fftwf" ,fftwf)
+ ("libusb" ,libusb)))
+ (home-page "https://greatscottgadgets.com/hackrf/")
+ (synopsis "User-space library and utilities for HackRF SDR")
+ (description
+ "Command line utilities and a C library for controlling the HackRF
+Software Defined Radio (SDR) over USB.")
+ (license license:gpl2))))
--
2.24.0
Danny Milosavljevic wrote 5 years ago
(name . Christopher Howard)(address . christopher@librehacker.com)(address . 38650@debbugs.gnu.org)
20191223090002.5c1403c2@scratchpost.org
Hi,

thanks for the patch!

Please, if possible, ask upstream to provide a release.

It's not a good idea to use a random git commit in an official GNU distribution--
much better to just have them release a version.

On Tue, 17 Dec 2019 05:45:14 -0900
Christopher Howard <christopher@librehacker.com> wrote:

Toggle quote (17 lines)
> Patch is attached for new package `hackrf'. Installing this package
> installs the userspace hackrf utilities and C library. To install the
> hackrf udev rules, you must add this package as a system service via
> modify-services. E.g.:
>
> '''
> (services
> (modify-services
> (append
> #| your other services |#
> (udev-service-type config =>
> (udev-configuration (inherit config)
> (rules (cons hackrf
> (udev-configuration-rules config)))))))
> '''
> And also you need to add your local user to the `dialout' group.

Please document that in the description so it's not lost (description
can do texinfo markup).
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAl4AdAIACgkQ5xo1VCww
uqVXewf/XbqweE/d815kSXCVStM0CTwaqiGkNgZlQcmbqeL+WprjoWWOF1lFDqQH
yOLnAvkJCONzPjTSgH4yEJ6EpzPPlfn9MtHLYETj0xwtOKExiLL9ACjNc2b6U86L
W+f3f6Xh54RxAU77yOyLEJLN+hB/PyGpMlvw8uY8Y2Dbwcr9nxatvRRIvc9Wcwm7
l0Qdgk6DEwOj26H3DPoyZS/M3zdLSlgaUhkZ/FOdlwFiVUZs81FpjG8GRqQr+duN
g0+J1ZgIMPqlA1Y+ygnaTkbr9LOcPDxyJKwWPsSp9aj7sEQabR2EBI/Um2ONsQ04
joS3hXpR3PXcVYktaxcvRQy2+CD/ew==
=p2ki
-----END PGP SIGNATURE-----


Jack Hill wrote 5 years ago
hackrf.scm add to gnu/local.mk
(address . 38650@debbugs.gnu.org)(name . Christopher Howard)(address . christopher@librehacker.com)
alpine.DEB.2.20.1912231615430.11560@marsh.hcoop.net
Hi,

I believe that the new gnu/packages/hackrf.scm file also need to be added
to gnu/local.mk

Best,
Jack
Christopher Howard wrote 5 years ago
Re: [bug#38650] hackrf: new package
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)(address . 38650@debbugs.gnu.org)
a9e315eb09ff80f234819378f120bdcf409402c1.camel@librehacker.com
HackRF team says they are preparing a new release, but it may be a few
weeks yet.

--
Christopher Howard
p: +1 (907) 374-0257
gpg: ADDEAADE5D607C8D (keys.gnupg.net)

On Mon, 2019-12-23 at 09:00 +0100, Danny Milosavljevic wrote:
Toggle quote (34 lines)
> Hi,
>
> thanks for the patch!
>
> Please, if possible, ask upstream to provide a release.
>
> It's not a good idea to use a random git commit in an official GNU
> distribution--
> much better to just have them release a version.
>
> On Tue, 17 Dec 2019 05:45:14 -0900
> Christopher Howard <christopher@librehacker.com> wrote:
>
> > Patch is attached for new package `hackrf'. Installing this package
> > installs the userspace hackrf utilities and C library. To install
> > the
> > hackrf udev rules, you must add this package as a system service
> > via
> > modify-services. E.g.:
> >
> > '''
> > (services
> > (modify-services
> > (append
> > #| your other services |#
> > (udev-service-type config =>
> > (udev-configuration (inherit config)
> > (rules (cons hackrf
> > (udev-configuration-rules config)))))))
> > '''
> > And also you need to add your local user to the `dialout' group.
>
> Please document that in the description so it's not lost (description
> can do texinfo markup).
Christopher Baines wrote 5 years ago
(name . Christopher Howard)(address . christopher@librehacker.com)
87imik9swm.fsf@cbaines.net
Christopher Howard <christopher@librehacker.com> writes:

Toggle quote (3 lines)
> HackRF team says they are preparing a new release, but it may be a few
> weeks yet.

Looks like there's been a new release now:


Just letting you know in case you don't :)

Chris
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl6DpmpfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XenUw//UF5vsemeJ76FlO3dWcJUb1sb6JkIAd48arYAkTK3CbaEm07/ThWxQUi0
ukTprfGFU+l6NLx9jFQYiCcf460SKV+oEAT4mLSq/9NxFpVbrA5UweoaQbZSFFHq
N+vsyJOdoWrhDnON6awpiWt4jRHgUlZfwJeSZtO/3Mfd01LYCepDToz2s8yN8KJT
MITMXx6inwhNbpm+CbVLFr26pZRsRcxMiqQe5ZzXIYSRqHWeVzyFTv4scSiK+iQM
/Y6dFx7sGJzuocA2HVifw+M4grjLoP1SrIYIvtAFvwJ4onbVmsG+k9EdVFuAF1m1
sSVVGD2STyMyD1EK0rrwn8YYizi0Mb7jut9notDWOXhBmfi3Obo4FX4/p9IlyQmt
F+D14b79soG1CyW6xbvNfbVXqIWs60QRVul1BrhdDw14L0+2tgYBmxYUieRAePy2
12fWrT0wE7JzLSI9tbmodYaakKCzJa9a+RDFdu9Xwbx+MP4Y+MWzsP4D+VqyCE37
T7uTcNH7lZuesbOlB0W6Ucp8Mua7TPtbz52KIx9i2k65uPzErPR6vdY9otZwh+cs
s27qW3rKicKfb7sUWsJBl1Q/JtSQzigBv1OANMn563Fi172oXenu/R2L0ijGEKge
xPeJjQ3a09U+zKl785P0IOcFGwsMgm0WNs2FV6Xh5MnpC6CfRB8=
=AabE
-----END PGP SIGNATURE-----

Christopher Howard wrote 5 years ago
(name . Christopher Baines)(address . mail@cbaines.net)
7c6607867a4919fc0162076f63d87ad52dacb69c.camel@librehacker.com
Hi, that is the release from two years ago.

--
Christopher Howard
p: +1 (907) 374-0257
gpg: ADDEAADE5D607C8D (keys.gnupg.net)

On Tue, 2020-03-31 at 21:22 +0100, Christopher Baines wrote:
Toggle quote (13 lines)
> Christopher Howard <christopher@librehacker.com> writes:
>
> > HackRF team says they are preparing a new release, but it may be a
> > few
> > weeks yet.
>
> Looks like there's been a new release now:
>
> https://github.com/mossmann/hackrf/releases/tag/v2018.01.1
>
> Just letting you know in case you don't :)
>
> Chris
Christopher Baines wrote 5 years ago
(name . Christopher Howard)(address . christopher@librehacker.com)
87a73v9l47.fsf@cbaines.net
Christopher Howard <christopher@librehacker.com> writes:

Toggle quote (2 lines)
> Hi, that is the release from two years ago.

Ah, sorry, I saw January and didn't notice the year!
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl6EzdhfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XcGxw//WzKPsRpjCaiCXp2H/fjRVbqurXQO+145B6vfua8RNIblwaPeTyPaeFVy
I/KCFn08z3K+sLD+7ObHnr7603Nja8gPw1DZIku/iGwujH08dE4HBnSGz9Wwka4T
zK0OujTuVaa+gfPZ5UqCepdPelQNxcrYq0itfB/78G6AX5x9G5zwhDMvBfYw+nqV
1ybm40ed9ZYaYoIPzODKzsN9jPju9vZ+sKNwzU2dEI7LkP7ZsShvfjMJ48Z458ko
RCSNOPWKK3jWxwgvwpv+pLBX87NRpJtHdDoRCtLtSSP2YJ6S2xldC6BbVzP8esju
trhOOfBhksUl9+O2BtsjcJVxtOfXKzkwmIIgv7hCX0jRWQyuI7cqU8yH5nJst2R6
TU2iLuBXzarPJXILYxbkaRRADu9r24vFSQpdENi7bjo3mjSJ6HR9HqPf0X0bGBvF
o+JkTMQXfc/1WJ1JF++AUAaaMHSHmS6lvF5VHlEsSt6XzUi4SXVuQYH5TFdpCH/6
PrYEfo7P5HgvHQtxUCPzCahNN70LsFrxxye857WH/aA//wMY7K9pWxLXX5b4jtzD
8XDsVUKua5eE7GK543TOI/ymbpMJB8OouyGYSx+m58zO6Q9y6zbO6RHzHtAdAe1b
vnR+P6YFfAQZHiuLyODUHlWzHNSD8Kdset7YtDWPJjBnJl3GpWQ=
=rSrw
-----END PGP SIGNATURE-----

Christopher Howard wrote 5 years ago
[PATCH] gnu: adds hackrf
(address . 38650@debbugs.gnu.org)
542784b9e65b06a69bf1cd17f10cf4343b411b8e.camel@qlfiles.net
I have asked many times about the new release over the last few months,
and each time hackrf team says it is a week or so away. But their last
git commit was in February. Requesting to please proceed with the
latest commit as represented in this patch. I have added information to
the description as requested.

Using the old 2018 release would be unsatisfactory due to an annoying
bug related to maintaining connections to hackrf devices.

As an additional motivation for adding this, I believe you need
libhackrf installed to use hackrf with gnuradio, through the osmocom
interface. (I'm not at the moment quite clear on what exactly you have
to enable in the gnuradio package definitions to link those together.)

--
Christopher Howard
p: +1 (907) 374-0257
gpg: ADDEAADE5D607C8D (keys.gnupg.net)
From 7567d155fd3922fe27a3aaa3d155dc4f9db0a329 Mon Sep 17 00:00:00 2001
From: Christopher Howard <christopher@librehacker.com>
Date: Sun, 26 Apr 2020 02:52:48 -0800
Subject: [PATCH] gnu: adds hackrf

---
gnu/packages/radio.scm | 57 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)

Toggle diff (70 lines)
diff --git a/gnu/packages/radio.scm b/gnu/packages/radio.scm
index fff68cf657..91908d47b5 100644
--- a/gnu/packages/radio.scm
+++ b/gnu/packages/radio.scm
@@ -654,6 +654,63 @@ for correctness.")
(home-page "http://www.w1hkj.com/")
(license license:gpl3+)))
+(define-public hackrf
+ ;; Using a git commit because there have been many many commits
+ ;; since the relase two years ago, but no sign of a promised
+ ;; release for many months now.
+ (let ((commit "43e6f99fe8543094d18ff3a6550ed2066c398862")
+ (revision "0"))
+ (package
+ (name "hackrf")
+ (version (git-version "2018.01.1" revision commit))
+ (source
+ (origin (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mossmann/hackrf.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0avnv693xi0zsnrvkbfn0ln1r3s1iyj0bz7sc3gxay909av0pvbc"))))
+ (build-system cmake-build-system)
+ (arguments
+ '(#:configure-flags
+ (list "-DUDEV_RULES_GROUP=dialout"
+ (string-append "-DUDEV_RULES_PATH="
+ (assoc-ref %outputs "out")
+ "/lib/udev/rules.d"))
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'configure 'enter-source-directory
+ (lambda _ (chdir "host") #t))
+ (add-before 'install-license-files 'leave-source-directory
+ (lambda _ (chdir "..") #t)))
+ #:tests? #f)) ; no test suite
+ (native-inputs
+ `(("pkg-config" ,pkg-config)))
+ (inputs
+ `(("fftw" ,fftw)
+ ("fftwf" ,fftwf)
+ ("libusb" ,libusb)))
+ (home-page "https://greatscottgadgets.com/hackrf/")
+ (synopsis "User-space library and utilities for HackRF SDR")
+ (description
+ "Command line utilities and a C library for controlling the HackRF
+Software Defined Radio (SDR) over USB. Installing this package installs
+the userspace hackrf utilities and C library. To install the hackrf
+udev rules, you must add this package as a system service via
+modify-services. E.g.:
+
+@lisp
+(services
+ (modify-services
+ %desktop-services
+ (udev-service-type config =>
+ (udev-configuration (inherit config)
+ (rules (cons hackrf
+ (udev-configuration-rules config)))))))
+@end lisp")
+ (license license:gpl2))))
+
(define-public hamlib
(package
(name "hamlib")
--
2.26.2
Guillaume Le Vaillant wrote 5 years ago
(address . 38650@debbugs.gnu.org)(address . christopher@librehacker.com)
871ro97xjz.fsf@yamatai
Hi,

Christopher Howard <christopher.howard@qlfiles.net> skribis:

Toggle quote (9 lines)
> I have asked many times about the new release over the last few months,
> and each time hackrf team says it is a week or so away. But their last
> git commit was in February. Requesting to please proceed with the
> latest commit as represented in this patch. I have added information to
> the description as requested.
>
> Using the old 2018 release would be unsatisfactory due to an annoying
> bug related to maintaining connections to hackrf devices.

I noticed that the package definition builds 'lib/libhackrf.a';
installing static libraries is usually disabled for Guix packages.
Also, some of the lines of the package definition are indented with tabs
instead of spaces, and the commit message is missing the
" * gnu/packages/radio.scm (hackrf): New variable." line.

Toggle quote (6 lines)
> As an additional motivation for adding this, I believe you need
> libhackrf installed to use hackrf with gnuradio, through the osmocom
> interface. (I'm not at the moment quite clear on what exactly you have
> to enable in the gnuradio package definitions to link those together.)
> E.g., https://packages.debian.org/stretch/gr-osmosdr

In theory, adding the hackrf package as input of the gnuradio-osmosdr
package should be enough (the library should be auto-detected when
compiling and the support activated).
However, I don't have the hardware to test if it really works.
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQQkUwKxurH4Z/3KlryPP4Yfgut6mgUCXqb7YAAKCRCPP4Yfgut6
mpnOAQDl+HefmcSbpkgLbtp/c2MAul41exwMGMQUDE9PQI6AqwD+P5UHwS7Vkckj
muBix02T7ZYTqb5TgKnsCE27Evb3QQg=
=CniY
-----END PGP SIGNATURE-----

Christopher Howard wrote 5 years ago
29924c336e19292151b1f9fbf991f89531446477.camel@librehacker.com
Can those minor tweaks be added by whomever is applying the patch, or
do I need to submit a new patch?

--
Christopher Howard
p: +1 (907) 374-0257
gpg: ADDEAADE5D607C8D (keys.gnupg.net)

On Mon, 2020-04-27 at 17:33 +0200, Guillaume Le Vaillant wrote:
Toggle quote (37 lines)
> Hi,
>
> Christopher Howard <christopher.howard@qlfiles.net> skribis:
>
> > I have asked many times about the new release over the last few
> > months,
> > and each time hackrf team says it is a week or so away. But their
> > last
> > git commit was in February. Requesting to please proceed with the
> > latest commit as represented in this patch. I have added
> > information to
> > the description as requested.
> >
> > Using the old 2018 release would be unsatisfactory due to an
> > annoying
> > bug related to maintaining connections to hackrf devices.
>
> I noticed that the package definition builds 'lib/libhackrf.a';
> installing static libraries is usually disabled for Guix packages.
> Also, some of the lines of the package definition are indented with
> tabs
> instead of spaces, and the commit message is missing the
> " * gnu/packages/radio.scm (hackrf): New variable." line.
>
> > As an additional motivation for adding this, I believe you need
> > libhackrf installed to use hackrf with gnuradio, through the
> > osmocom
> > interface. (I'm not at the moment quite clear on what exactly you
> > have
> > to enable in the gnuradio package definitions to link those
> > together.)
> > E.g., https://packages.debian.org/stretch/gr-osmosdr
>
> In theory, adding the hackrf package as input of the gnuradio-osmosdr
> package should be enough (the library should be auto-detected when
> compiling and the support activated).
> However, I don't have the hardware to test if it really works.
Guillaume Le Vaillant wrote 5 years ago
(address . 38650-done@debbugs.gnu.org)(name . Christopher Howard)(address . christopher@librehacker.com)
871ro82eu2.fsf@yamatai
Christopher Howard <christopher@librehacker.com> skribis:

Toggle quote (3 lines)
> Can those minor tweaks be added by whomever is applying the patch, or
> do I need to submit a new patch?

I pushed the patch with the modifications
(commit 79c4fb4f366cff3ad75982b4a09c6bd82e604674).

I also added hackrf support to gnuradio-osmosdr (commit
62d45e463c3b1ecad90004c47356cba342dd23d8).
Could you test if it works with real hackrf hardware, and create a bug
report if it doesn't?
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQQkUwKxurH4Z/3KlryPP4Yfgut6mgUCXqfpZQAKCRCPP4Yfgut6
mhO8APwLodGGej4MxYE4j6hsjR700x+o94CFdndou+pZEo3oqAD/QgG8kF2BV367
njudX595buVLU9bF1Fy5SVYgDBHYtgM=
=H8uM
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 38650
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
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help