summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-libs/libhackrf')
-rw-r--r--net-libs/libhackrf/Manifest1
-rw-r--r--net-libs/libhackrf/files/hackrf-disable-static-2022.09.1.patch30
-rw-r--r--net-libs/libhackrf/libhackrf-2021.03.1.ebuild9
-rw-r--r--net-libs/libhackrf/libhackrf-2022.09.1.ebuild54
-rw-r--r--net-libs/libhackrf/libhackrf-9999.ebuild18
5 files changed, 107 insertions, 5 deletions
diff --git a/net-libs/libhackrf/Manifest b/net-libs/libhackrf/Manifest
index d7597c7d3297..7e62402c90df 100644
--- a/net-libs/libhackrf/Manifest
+++ b/net-libs/libhackrf/Manifest
@@ -1 +1,2 @@
DIST hackrf-2021.03.1.tar.xz 13661964 BLAKE2B 0a00b2d24cc6ac7ca36f66e8f5b3029cfd446a6c5b5427f7d25db6dd191693c1e1c010abd85907813d55c6bd367780c70860b4f7e7f83fb9970d425311893780 SHA512 4a88b877a9f6fee0c8d9496eb265655af4baa678e862ca6147596cd3a1d85dd50315da6531efa54d050847ce5068c4726393b4897d40576888d10a898ad57139
+DIST hackrf-2022.09.1.tar.xz 21534956 BLAKE2B fd1b3469372fdb0558465c84f3645859791af9bd1302f63c63185ce7c47d24779ed0baf47eccbfc8ddb771e9737edb2a37a073fb749377d87f4e67c11eb6ef76 SHA512 c3b8b6f18cb80e3506c09dc71f2c01c127ad6d88ed028be3b659953cf7bb1e36b9dba83b4bb04c916bd7c2b66faeae1e602c53368e1e56454d6fe831961e01ee
diff --git a/net-libs/libhackrf/files/hackrf-disable-static-2022.09.1.patch b/net-libs/libhackrf/files/hackrf-disable-static-2022.09.1.patch
new file mode 100644
index 000000000000..f7e9fa39cc5e
--- /dev/null
+++ b/net-libs/libhackrf/files/hackrf-disable-static-2022.09.1.patch
@@ -0,0 +1,30 @@
+diff -Naur libhackrf-orig/src/CMakeLists.txt libhackrf/src/CMakeLists.txt
+--- libhackrf-orig/src/CMakeLists.txt 2022-09-29 09:47:10.899630179 -0400
++++ libhackrf/src/CMakeLists.txt 2022-09-29 09:47:30.835629516 -0400
+@@ -31,15 +31,11 @@
+ set_target_properties(hackrf PROPERTIES VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.0 SOVERSION 0)
+
+ # Static library
+-add_library(hackrf-static STATIC ${c_sources})
+ if(MSVC)
+ set_target_properties(hackrf-static PROPERTIES OUTPUT_NAME "hackrf_static")
+-else()
+- set_target_properties(hackrf-static PROPERTIES OUTPUT_NAME "hackrf")
+ endif()
+
+ set_target_properties(hackrf PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+-set_target_properties(hackrf-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+
+ # Dependencies
+ target_link_libraries(hackrf ${LIBUSB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
+@@ -55,10 +51,6 @@
+ LIBRARY DESTINATION lib${LIB_SUFFIX}
+ COMPONENT sharedlibs
+ )
+- install(TARGETS hackrf-static
+- ARCHIVE DESTINATION lib${LIB_SUFFIX}
+- COMPONENT staticlibs
+- )
+ install(FILES ${c_headers}
+ DESTINATION include/${PROJECT_NAME}
+ COMPONENT headers
diff --git a/net-libs/libhackrf/libhackrf-2021.03.1.ebuild b/net-libs/libhackrf/libhackrf-2021.03.1.ebuild
index 8021c6bcf616..764d01a827d6 100644
--- a/net-libs/libhackrf/libhackrf-2021.03.1.ebuild
+++ b/net-libs/libhackrf/libhackrf-2021.03.1.ebuild
@@ -40,5 +40,12 @@ src_configure() {
}
pkg_postinst() {
- use udev && einfo "Users in the usb group can use hackrf."
+ if use udev; then
+ einfo "Users in the usb group can use hackrf."
+ udev_reload
+ fi
+}
+
+pkg_postrm() {
+ udev_reload
}
diff --git a/net-libs/libhackrf/libhackrf-2022.09.1.ebuild b/net-libs/libhackrf/libhackrf-2022.09.1.ebuild
new file mode 100644
index 000000000000..586e9f4bd1ec
--- /dev/null
+++ b/net-libs/libhackrf/libhackrf-2022.09.1.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake udev
+
+DESCRIPTION="library for communicating with HackRF SDR platform"
+HOMEPAGE="http://greatscottgadgets.com/hackrf/"
+
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/greatscottgadgets/hackrf.git"
+ inherit git-r3
+ EGIT_CHECKOUT_DIR="${WORKDIR}/hackrf"
+ S="${WORKDIR}/hackrf/host/libhackrf"
+else
+ S="${WORKDIR}/hackrf-${PV}/host/libhackrf"
+ SRC_URI="https://github.com/greatscottgadgets/hackrf/releases/download/v${PV}/hackrf-${PV}.tar.xz"
+ KEYWORDS="~amd64 ~arm ~ppc ~riscv ~x86"
+fi
+
+LICENSE="BSD"
+SLOT="0/${PV}"
+IUSE="+udev"
+
+DEPEND="virtual/libusb:1"
+RDEPEND="${DEPEND}"
+
+# https://github.com/greatscottgadgets/hackrf/issues/1193
+PATCHES=( "${FILESDIR}/hackrf-disable-static-${PV}.patch" )
+
+src_configure() {
+ local mycmakeargs=(
+ -DINSTALL_UDEV_RULES="$(usex udev)"
+ )
+ if use udev; then
+ mycmakeargs+=(
+ -DUDEV_RULES_GROUP=usb
+ -DUDEV_RULES_PATH="$(get_udevdir)/rules.d"
+ )
+ fi
+ cmake_src_configure
+}
+
+pkg_postinst() {
+ if use udev; then
+ einfo "Users in the usb group can use hackrf."
+ udev_reload
+ fi
+}
+
+pkg_postrm() {
+ udev_reload
+}
diff --git a/net-libs/libhackrf/libhackrf-9999.ebuild b/net-libs/libhackrf/libhackrf-9999.ebuild
index aacd79049ae5..586e9f4bd1ec 100644
--- a/net-libs/libhackrf/libhackrf-9999.ebuild
+++ b/net-libs/libhackrf/libhackrf-9999.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
inherit cmake udev
@@ -16,7 +16,7 @@ if [[ ${PV} == "9999" ]] ; then
else
S="${WORKDIR}/hackrf-${PV}/host/libhackrf"
SRC_URI="https://github.com/greatscottgadgets/hackrf/releases/download/v${PV}/hackrf-${PV}.tar.xz"
- KEYWORDS="~amd64 ~arm ~ppc ~x86"
+ KEYWORDS="~amd64 ~arm ~ppc ~riscv ~x86"
fi
LICENSE="BSD"
@@ -26,6 +26,9 @@ IUSE="+udev"
DEPEND="virtual/libusb:1"
RDEPEND="${DEPEND}"
+# https://github.com/greatscottgadgets/hackrf/issues/1193
+PATCHES=( "${FILESDIR}/hackrf-disable-static-${PV}.patch" )
+
src_configure() {
local mycmakeargs=(
-DINSTALL_UDEV_RULES="$(usex udev)"
@@ -40,5 +43,12 @@ src_configure() {
}
pkg_postinst() {
- use udev && einfo "Users in the usb group can use hackrf."
+ if use udev; then
+ einfo "Users in the usb group can use hackrf."
+ udev_reload
+ fi
+}
+
+pkg_postrm() {
+ udev_reload
}