Skip to contentSkip to conversation

hackrf-host: new package

PATCH New Jason Pruitt 2 participants 2 messages Oct 22, 2015 – Mar 17, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hackrf-host: new package

This patch adds hackrf/host tools and lib for the HackRF SDR.

---
 package/Config.in                                  |  1 +
 .../0001-make_hackrf-tools_optional.patch          | 21 ++++++++
 .../0002-disabled_shared_library_in_build.patch    | 61 ++++++++++++++++++++++
 package/hackrf-host/Config.in                      | 33 ++++++++++++
 package/hackrf-host/hackrf-host.mk                 | 27 ++++++++++
 5 files changed, 143 insertions(+)
 create mode 100644 package/hackrf-host/0001-make_hackrf-tools_optional.patch
 create mode 100644 package/hackrf-host/0002-disabled_shared_library_in_build.patch
 create mode 100644 package/hackrf-host/Config.in
 create mode 100644 package/hackrf-host/hackrf-host.mk
package/Config.in +1 -0
index 9994bcd..2e264e4 100644
@@ -862,6 +862,7 @@ menu "Hardware handling"
 	source "package/ccid/Config.in"
 	source "package/dtc/Config.in"
 	source "package/gnu-efi/Config.in"
+	source "package/hackrf-host/Config.in"
 	source "package/lcdapi/Config.in"
 	source "package/libaio/Config.in"
 	source "package/libatasmart/Config.in"
package/hackrf-host/0001-make_hackrf-tools_optional.patch new file +21 -0
new file mode 100644
index 0000000..85e199f
@@ -0,0 +1,21 @@
+hackrf-host: Make hackrf-tools optional.
+
+Enables hackrf-tools to be a compile time option for build.
+
+signed-off-by Jason Pruitt <[email protected]>
+---
+diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
+index 874163f..b14896e 100644
+--- a/host/CMakeLists.txt
++++ b/host/CMakeLists.txt
+@@ -4,7 +4,10 @@ cmake_minimum_required(VERSION 2.8)
+ project (hackrf_all)
+ 
+ add_subdirectory(libhackrf)
++
++if(BR2_PACKAGE_HACKRF_TOOLS)
+ add_subdirectory(hackrf-tools)
++endif()
+ 
+ ########################################################################
+ # Create uninstall target
package/hackrf-host/0002-disabled_shared_library_in_build.patch new file +61 -0

61 lines not on this page · raw message

package/hackrf-host/Config.in new file +33 -0
new file mode 100644
index 0000000..eabc4b2
@@ -0,0 +1,33 @@
+comment "hackrf-host needs a toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+
+menuconfig BR2_PACKAGE_HACKRF_HOST
+	bool "hackrf-host"
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Library and tools for accessing HackRF SDR boards.
+
+	  https://github.com/mossmann/hackrf/tree/master/host
+
+if BR2_PACKAGE_HACKRF_HOST
+
+config BR2_PACKAGE_LIBHACKRF
+	bool "libhackrf"
+	select BR2_PACKAGE_LIBUSB
+	help
+	  Library for HackRF SDR boards.
+
+if BR2_PACKAGE_LIBHACKRF
+
+config BR2_PACKAGE_HACKRF_TOOLS
+	bool "hackrf-tools"
+	depends on !BR2_STATIC_LIBS && BR2_PACKAGE_HACKRF_HOST
+	help
+	  Tools for accessing and updating HackRF SDR boards.
+
+comment "hackrf-tools needs a toolchain w/ dynamic libs"
+	depends on BR2_STATIC_LIBS
+
+endif
+
+endif
package/hackrf-host/hackrf-host.mk new file +27 -0
new file mode 100644
index 0000000..1eb6424
@@ -0,0 +1,27 @@
+################################################################################
+#
+# HACKRF_HOST 
+#
+################################################################################
+
+HACKRF_HOST_VERSION = v2015.07.2
+HACKRF_HOST_SITE = $(call github,mossmann,hackrf,$(HACKRF_HOST_VERSION))
+HACKRF_HOST_LICENSE = GPLv2 GPLv2+ BSD-3c
+HACKRF_HOST_LICENSE_FILES = COPYING
+HACKRF_HOST_DEPENDENCIES = libusb
+HACKRF_HOST_SUBDIR = host
+HACKRF_HOST_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+HACKRF_HOST_CONF_OPTS += -DINSTALL_UDEV_RULES=ON
+else
+HACKRF_HOST_CONF_OPTS += -DINSTALL_UDEV_RULES=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_HACKRF_TOOLS),y)
+HACKRF_HOST_CONF_OPTS += -DBUILD_HACKRF_TOOLS=ON
+else
+HACKRF_HOST_CONF_OPTS += -DBUILD_HACKRF_TOOLS=OFF
+endif
+
+$(eval $(cmake-package))
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 hackrf-host: new package

Hi Jason,

Quoted 1 line · Jason Pruitt

This patch adds hackrf/host tools and lib for the HackRF SDR.

could you rebase the patch on the latest BR master?

Have you tried to upstream your patches?

Quoted 165 lines
---
 package/Config.in                                  |  1 +
 .../0001-make_hackrf-tools_optional.patch          | 21 ++++++++
 .../0002-disabled_shared_library_in_build.patch    | 61 ++++++++++++++++++++++
 package/hackrf-host/Config.in                      | 33 ++++++++++++
 package/hackrf-host/hackrf-host.mk                 | 27 ++++++++++
 5 files changed, 143 insertions(+)
 create mode 100644 package/hackrf-host/0001-make_hackrf-tools_optional.patch
 create mode 100644 package/hackrf-host/0002-disabled_shared_library_in_build.patch
 create mode 100644 package/hackrf-host/Config.in
 create mode 100644 package/hackrf-host/hackrf-host.mk
package/Config.in +1 -0
index 9994bcd..2e264e4 100644
@@ -862,6 +862,7 @@ menu "Hardware handling"
        source "package/ccid/Config.in"
        source "package/dtc/Config.in"
        source "package/gnu-efi/Config.in"
+       source "package/hackrf-host/Config.in"
        source "package/lcdapi/Config.in"
        source "package/libaio/Config.in"
        source "package/libatasmart/Config.in"
package/hackrf-host/0001-make_hackrf-tools_optional.patch new file +21 -0
new file mode 100644
index 0000000..85e199f
@@ -0,0 +1,21 @@
+hackrf-host: Make hackrf-tools optional.
+
+Enables hackrf-tools to be a compile time option for build.
+
+signed-off-by Jason Pruitt <[email protected]>
+---
+diff --git a/host/CMakeLists.txt b/host/CMakeLists.txt
+index 874163f..b14896e 100644
+--- a/host/CMakeLists.txt
++++ b/host/CMakeLists.txt
+@@ -4,7 +4,10 @@ cmake_minimum_required(VERSION 2.8)
+ project (hackrf_all)
+
+ add_subdirectory(libhackrf)
++
++if(BR2_PACKAGE_HACKRF_TOOLS)
+ add_subdirectory(hackrf-tools)
++endif()
+
+ ########################################################################
+ # Create uninstall target
package/hackrf-host/0002-disabled_shared_library_in_build.patch new file +61 -0
new file mode 100644
index 0000000..d9e1b38
@@ -0,0 +1,61 @@
+hackrf-host: disable shared library target in build for libhackrf
+
+Disable libhackrf shared library target if BUILD_SHARED_LIBS if OFF.
+
+signed-off-by Jason Pruitt <[email protected]>
+---
+diff --git a/host/libhackrf/src/CMakeLists.txt b/host/libhackrf/src/CMakeLists.txt
+index 9d54a8c..13d6906 100644
+--- a/host/libhackrf/src/CMakeLists.txt
++++ b/host/libhackrf/src/CMakeLists.txt
+@@ -27,8 +27,10 @@ set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/hackrf.c CACHE INTERNAL "List of C sou
+ set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/hackrf.h CACHE INTERNAL "List of C headers")
+
+ # Dynamic library
+-add_library(hackrf SHARED ${c_sources})
+-set_target_properties(hackrf PROPERTIES VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.0 SOVERSION 0)
++if(BUILD_SHARED_LIBS)
++        add_library(hackrf SHARED ${c_sources})
++        set_target_properties(hackrf PROPERTIES VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.0 SOVERSION 0)
++endif()
+
+ # Static library
+ add_library(hackrf-static STATIC ${c_sources})
+@@ -38,12 +40,17 @@ else()
+       set_target_properties(hackrf-static PROPERTIES OUTPUT_NAME "hackrf")
+ endif()
+
+-set_target_properties(hackrf PROPERTIES CLEAN_DIRECT_OUTPUT 1)
++if(BUILD_SHARED_LIBS)
++        set_target_properties(hackrf PROPERTIES CLEAN_DIRECT_OUTPUT 1)
++endif()
+ set_target_properties(hackrf-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
++
+ # Dependencies
+-target_link_libraries(hackrf ${LIBUSB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+-
++if(BUILD_SHARED_LIBS)
++        target_link_libraries(hackrf ${LIBUSB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
++endif()
++
+ # For cygwin just force UNIX OFF and WIN32 ON
+ if( ${CYGWIN} )
+   SET(UNIX OFF)
+@@ -51,10 +58,12 @@ if( ${CYGWIN} )
+ endif( ${CYGWIN} )
+
+ if( ${UNIX} )
+-   install(TARGETS hackrf
+-           LIBRARY DESTINATION lib${LIB_SUFFIX}
+-           COMPONENT sharedlibs
+-           )
++   if(BUILD_SHARED_LIBS)
++           install(TARGETS hackrf
++                   LIBRARY DESTINATION lib${LIB_SUFFIX}
++                   COMPONENT sharedlibs
++                   )
++   endif()
+    install(TARGETS hackrf-static
+            ARCHIVE DESTINATION lib${LIB_SUFFIX}
+            COMPONENT staticlibs
package/hackrf-host/Config.in new file +33 -0
new file mode 100644
index 0000000..eabc4b2
@@ -0,0 +1,33 @@
+comment "hackrf-host needs a toolchain w/ threads"
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
+
+menuconfig BR2_PACKAGE_HACKRF_HOST
+       bool "hackrf-host"
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       help
+         Library and tools for accessing HackRF SDR boards.
+
+         https://github.com/mossmann/hackrf/tree/master/host
+
+if BR2_PACKAGE_HACKRF_HOST
+
+config BR2_PACKAGE_LIBHACKRF
+       bool "libhackrf"
+       select BR2_PACKAGE_LIBUSB
+       help
+         Library for HackRF SDR boards.
+
+if BR2_PACKAGE_LIBHACKRF
+
+config BR2_PACKAGE_HACKRF_TOOLS
+       bool "hackrf-tools"
+       depends on !BR2_STATIC_LIBS && BR2_PACKAGE_HACKRF_HOST
+       help
+         Tools for accessing and updating HackRF SDR boards.
+
+comment "hackrf-tools needs a toolchain w/ dynamic libs"
+       depends on BR2_STATIC_LIBS
+
+endif
+
+endif
package/hackrf-host/hackrf-host.mk new file +1 -0
new file mode 100644
index 0000000..1eb6424
@@ -0,0 +1,27 @@
+################################################################################

package/hackrf-host/hackrf-host.mk line 11

Quoted 10 lines
package/hackrf-host/hackrf-host.mk new file +10 -0
+#
+# HACKRF_HOST
+#
+################################################################################
+
+HACKRF_HOST_VERSION = v2015.07.2
+HACKRF_HOST_SITE = $(call github,mossmann,hackrf,$(HACKRF_HOST_VERSION))
+HACKRF_HOST_LICENSE = GPLv2 GPLv2+ BSD-3c
+HACKRF_HOST_LICENSE_FILES = COPYING
+HACKRF_HOST_DEPENDENCIES = libusb

please add host-pkgconf dependency

Quoted 23 lines
package/hackrf-host/hackrf-host.mk new file +16 -1
+HACKRF_HOST_SUBDIR = host
+HACKRF_HOST_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
+HACKRF_HOST_CONF_OPTS += -DINSTALL_UDEV_RULES=ON
+else
+HACKRF_HOST_CONF_OPTS += -DINSTALL_UDEV_RULES=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_HACKRF_TOOLS),y)
+HACKRF_HOST_CONF_OPTS += -DBUILD_HACKRF_TOOLS=ON
+else
+HACKRF_HOST_CONF_OPTS += -DBUILD_HACKRF_TOOLS=OFF
+endif
+
+$(eval $(cmake-package))
--

2.1.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot