Skip to contentSkip to conversation

hackrf: new package

PATCH New Arnout Vandecappelle (Essensium/Mind) 3 participants 4 messages Mar 31, 2018 – Apr 2, 2018 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hackrf: new package

From: Jason Pruitt <[email protected]>

This patch adds hackrf/host tools for HackRF, a low cost, open source Software Defined Radio platform.

Sources of host tools are available on GitHub here:
https://github.com/mossmann/hackrf/tree/master/host

[Arnout:
- Rename package to hackrf to match upstream name;
- Reorder dependencies and remove empty line (check-package);
- Use only sha256 hash;
- Add hash for license file;
- Bump to 2018.01.1;
- Use uploaded tarball rather than github-generated one;
- Fix dependencies of comment (|| instead of &&)
- Add UDEV_RULES_GROUP=plugdev in case the build host doesn't have this group;
- Add patch fixing build without C++ compiler.
]

---
v2: Changes by Arnout, see above

Alexey and/or Jason, can you re-test with this version?

---
 package/Config.in                                  |  1 +
 .../hackrf/0001-Don-t-require-a-C-compiler.patch   | 37 ++++++++++++++++++++++
 package/hackrf/Config.in                           | 16 ++++++++++
 package/hackrf/hackrf.hash                         |  3 ++
 package/hackrf/hackrf.mk                           | 26 +++++++++++++++
 5 files changed, 83 insertions(+)
 create mode 100644 package/hackrf/0001-Don-t-require-a-C-compiler.patch
 create mode 100644 package/hackrf/Config.in
 create mode 100644 package/hackrf/hackrf.hash
 create mode 100644 package/hackrf/hackrf.mk
package/Config.in +1 -0
index de10dd0613..f0eee40ca0 100644
@@ -1201,6 +1201,7 @@ menu "Hardware handling"
 	source "package/ccid/Config.in"
 	source "package/dtc/Config.in"
 	source "package/gnu-efi/Config.in"
+	source "package/hackrf/Config.in"
 	source "package/hidapi/Config.in"
 	source "package/lcdapi/Config.in"
 	source "package/let-me-create/Config.in"
package/hackrf/0001-Don-t-require-a-C-compiler.patch new file +37 -0
new file mode 100644
index 0000000000..3369dca670
@@ -0,0 +1,37 @@
+From 8b0a8b2be8cf2e4a76c03d3bcdf99bff5025ba22 Mon Sep 17 00:00:00 2001
+From: "Arnout Vandecappelle (Essensium/Mind)" <[email protected]>
+Date: Sat, 31 Mar 2018 22:50:37 +0200
+Subject: [PATCH] Don't require a C++ compiler
+
+By default, CMake assumes that the project is using both C and C++.  By
+explicitly passing 'C' as argument of the project() macro, we tell CMake
+that only C is used, which prevents CMake from erroring out if a C++
+compiler doesn't exist.
+
+Upstream status: https://github.com/mossmann/hackrf/pull/469
+
+This patch differs from upstream because:
+- project name upstream has been changed into HackRF;
+- in Buildroot, we are only interested in host, not firmware.
+
+Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
+---
+ host/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
+index 874163f..d9cbe31 100644
+--- a/host/CMakeLists.txt
++++ b/host/CMakeLists.txt
+@@ -1,7 +1,7 @@
+ #top dir cmake project for libhackrf + tools
+ 
+ cmake_minimum_required(VERSION 2.8)
+-project (hackrf_all)
++project (hackrf_all C)
+ 
+ add_subdirectory(libhackrf)
+ add_subdirectory(hackrf-tools)
+-- 
+2.16.3
+
package/hackrf/Config.in new file +16 -0
new file mode 100644
index 0000000000..4fa27699c4
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_HACKRF
+	bool "hackrf"
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_FFTW_PRECISION_SINGLE
+	select BR2_PACKAGE_LIBUSB
+	help
+	  Library and tools for accessing HackRF SDR boards.
+
+	  https://github.com/mossmann/hackrf/tree/master/host
+
+comment "hackrf needs a toolchain w/ threads, dynamic library"
+	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS
+
+comment "hackrf needs fftw's single precision"
+	depends on !BR2_PACKAGE_FFTW_PRECISION_SINGLE
package/hackrf/hackrf.hash new file +3 -0
new file mode 100644
index 0000000000..c0cf732213
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  a89badc09a1d2fa18367b3b2c974580ad5f6ce93aaa4e54557dc3d013c029d14  hackrf-2018.01.1.tar.xz
+sha256  49b60a6288f90f49074228cc1fae0fb16871ba36b756013abdf7c2fc92f01fad  COPYING
package/hackrf/hackrf.mk new file +26 -0
new file mode 100644
index 0000000000..acab0be1d3
@@ -0,0 +1,26 @@
+################################################################################
+#
+# hackrf
+#
+################################################################################
+
+HACKRF_VERSION = 2018.01.1
+HACKRF_SITE = https://github.com/mossmann/hackrf/releases/download/v$(HACKRF_VERSION)
+HACKRF_SOURCE = hackrf-$(HACKRF_VERSION).tar.xz
+HACKRF_LICENSE = GPL-2.0+ BSD-3c
+HACKRF_LICENSE_FILES = COPYING
+HACKRF_DEPENDENCIES = fftw libusb
+HACKRF_SUBDIR = host
+HACKRF_INSTALL_STAGING = YES
+
+HACKRF_CONF_OPTS += -DBUILD_HACKRF_TOOLS=ON
+
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+HACKRF_CONF_OPTS += \
+	-DINSTALL_UDEV_RULES=ON \
+	-DUDEV_RULES_GROUP=plugdev
+else
+HACKRF_CONF_OPTS += -DINSTALL_UDEV_RULES=OFF
+endif
+
+$(eval $(cmake-package))
Signature · 1 line
2.16.3
#1 lore raw

PATCH 1/1 hackrf: new package

Quoted 27 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]> writes:

From: Jason Pruitt <[email protected]>
This patch adds hackrf/host tools for HackRF, a low cost, open source Software Defined Radio platform.

Sources of host tools are available on GitHub here:
https://github.com/mossmann/hackrf/tree/master/host

[Arnout:
- Rename package to hackrf to match upstream name;
- Reorder dependencies and remove empty line (check-package);
- Use only sha256 hash;
- Add hash for license file;
- Bump to 2018.01.1;
- Use uploaded tarball rather than github-generated one;
- Fix dependencies of comment (|| instead of &&)
- Add UDEV_RULES_GROUP=plugdev in case the build host doesn't have this group;
- Add patch fixing build without C++ compiler.
]

---
v2: Changes by Arnout, see above

package/hackrf/Config.in line 5

Quoted 5 lines
package/hackrf/Config.in new file +5 -0
+config BR2_PACKAGE_HACKRF
+	bool "hackrf"
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_FFTW_PRECISION_SINGLE

While not strictly required I think we should select BR2_PACKAGE_FFTW so it cannot easily be deselected in menuconfig.

Committed with that fixed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 hackrf: new package

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Peter" == Peter Korsgaard <[email protected]> writes:

Hi,

Quoted 10 lines

package/hackrf/Config.in line 5

Quoted 5 lines
package/hackrf/Config.in new file +5 -0
+config BR2_PACKAGE_HACKRF
+	bool "hackrf"
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_PACKAGE_FFTW_PRECISION_SINGLE

While not strictly required I think we should select BR2_PACKAGE_FFTW so it cannot easily be deselected in menuconfig.

Committed with that fixed, thanks.

Ehh, skip that - kconf gets confused about that:

package/fftw/Config.in:24:error: recursive dependency detected!

package/fftw/Config.in:24:      choice <choice> contains symbol BR2_PACKAGE_FFTW
package/fftw/Config.in:1:       symbol BR2_PACKAGE_FFTW is selected by BR2_PACKAGE_HACKRF
package/hackrf/Config.in:1:     symbol BR2_PACKAGE_HACKRF depends on BR2_PACKAGE_FFTW_PRECISION_SINGLE
package/fftw/Config.in:30:      symbol BR2_PACKAGE_FFTW_PRECISION_SINGLE is part of choice <choice>

grr, I hate choice options :/

Committed without the select.

Signature · 1 line
Bye, Peter Korsgaard

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

PATCH 1/1 hackrf: new package

Hi Arnout,

Quoted 38 lines · Arnout Vandecappelle

Hi Alexey,

Sorry, I forgot to put you in Cc.

Regards,
Arnout

-------- Forwarded Message --------
Subject: [PATCH] hackrf: new package
Date: Sat, 31 Mar 2018 22:57:58 +0200
From: Arnout Vandecappelle (Essensium/Mind) <[email protected]>
To: buildroot at buildroot.org
CC: Jason Pruitt <[email protected]>, Arnout Vandecappelle <[email protected]>

From: Jason Pruitt <[email protected]>

This patch adds hackrf/host tools for HackRF, a low cost, open source Software Defined Radio platform.

Sources of host tools are available on GitHub here:
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_mossmann_hackrf_tree_master_host&d=DwICaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=OtZvQ4lNHIbjtyy
sXrNW8RbX6WFkigcev-xByzJ_fLk&m=3fPnQrE4rSy5zQsDX4KiuyrN0_yo_bx7cMjSZbnpQ9Y&s=JvoE14lAkMAbq6U9--tXF7zDwrs3YxMuCP2i7XieViA&e=

[Arnout:
- Rename package to hackrf to match upstream name;
- Reorder dependencies and remove empty line (check-package);
- Use only sha256 hash;
- Add hash for license file;
- Bump to 2018.01.1;
- Use uploaded tarball rather than github-generated one;
- Fix dependencies of comment (|| instead of &&)
- Add UDEV_RULES_GROUP=plugdev in case the build host doesn't have this group;
- Add patch fixing build without C++ compiler.
]

Quoted 5 lines

---
v2: Changes by Arnout, see above

Alexey and/or Jason, can you re-test with this version?

I made a quick build test and it's all OK. Unfortunately I don't have access to HackRF hardware ATM so cannot run-test it.

Thanks for taking care of this one.

-Alexey