net-wireless/rtl-sdr-blog: new package, add 1.3.6

Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
This commit is contained in:
Conrad Kostecki
2025-03-09 23:41:36 +01:00
parent b4b104c868
commit f07de82a52
8 changed files with 174 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST rtl-sdr-blog-1.3.6.gh.tar.gz 138270 BLAKE2B a310eb44d1f65c882db35ecb694c4ce4f4e1b295558f61f15f3f7c6e11ca6f9860cd063f58062f2051b93d17af0d710928e95e3b806b17b317ab98143c12057d SHA512 3689fdafd111bae4b033e52b157ba800a6ec3ead8b045f2cf3572059ef49b76fa61aad384c0be6ff1a1c0a73cb46081c0ff9af67f05b0371e738c6dd2f21436c

View File

@@ -0,0 +1,55 @@
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -34,25 +34,6 @@
generate_export_header(rtlsdr)
########################################################################
-# Setup static library variant
-########################################################################
-add_library(rtlsdr_static STATIC librtlsdr.c
- tuner_e4k.c tuner_fc0012.c tuner_fc0013.c tuner_fc2580.c tuner_r82xx.c)
-target_link_libraries(rtlsdr ${LIBUSB_LIBRARIES} ${THREADS_PTHREADS_LIBRARY})
-target_include_directories(rtlsdr_static PUBLIC
- $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
- $<INSTALL_INTERFACE:include> # <prefix>/include
- ${LIBUSB_INCLUDE_DIRS}
- ${THREADS_PTHREADS_INCLUDE_DIR}
- )
-set_property(TARGET rtlsdr_static APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" )
-if(NOT WIN32)
-# Force same library filename for static and shared variants of the library
-set_target_properties(rtlsdr_static PROPERTIES OUTPUT_NAME rtlsdr)
-endif()
-generate_export_header(rtlsdr_static)
-
-########################################################################
# Set up Windows DLL resource files
########################################################################
IF(MSVC)
@@ -63,7 +44,6 @@
${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc
@ONLY)
target_sources(rtlsdr PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc)
- target_sources(rtlsdr_static PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc)
ENDIF(MSVC)
########################################################################
@@ -94,7 +74,7 @@
add_executable(rtl_adsb rtl_adsb.c)
add_executable(rtl_power rtl_power.c)
add_executable(rtl_biast rtl_biast.c)
-set(INSTALL_TARGETS rtlsdr rtlsdr_static rtl_sdr rtl_tcp rtl_test rtl_fm rtl_eeprom rtl_adsb rtl_power rtl_biast)
+set(INSTALL_TARGETS rtlsdr rtl_sdr rtl_tcp rtl_test rtl_fm rtl_eeprom rtl_adsb rtl_power rtl_biast)
target_link_libraries(rtl_sdr rtlsdr convenience_static
${LIBUSB_LIBRARIES}
@@ -163,9 +143,6 @@
install(TARGETS rtlsdr EXPORT RTLSDR-export
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} # .so/.dylib file
)
-install(TARGETS rtlsdr_static EXPORT RTLSDR-export
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} # .so/.dylib file
- )
install(TARGETS rtl_sdr rtl_tcp rtl_test rtl_fm rtl_eeprom rtl_adsb rtl_power rtl_biast
DESTINATION ${CMAKE_INSTALL_BINDIR}
)

View File

@@ -0,0 +1,11 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -174,7 +174,7 @@
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix \${prefix})
set(includedir \${prefix}/include)
-set(libdir \${exec_prefix}/lib)
+set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/librtlsdr.pc.in

View File

@@ -0,0 +1,11 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,7 +113,7 @@
if (INSTALL_UDEV_RULES)
install (
FILES rtl-sdr.rules
- DESTINATION "/etc/udev/rules.d"
+ DESTINATION "/lib/udev/rules.d"
COMPONENT "udev"
)
else (INSTALL_UDEV_RULES)

View File

@@ -0,0 +1,7 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Options which will be passed to rtl_tcp.
# Default is listen on localhost with default port 1234 on first device.
# See `rtl_tcp -h` for all available options.
RTL_TCP_OPTIONS="-a localhost -d0 -p 1234"

View File

@@ -0,0 +1,11 @@
#!/sbin/openrc-run
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
error_log="/var/log/rtl_tcp.log"
pidfile="/run/rtl_tcp.pid"
output_log="/var/log/rtl_tcp.log"
command="/usr/bin/rtl_tcp"
command_background="true"
command_args="${RTL_TCP_OPTIONS}"

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>conikost@gentoo.org</email>
<name>Conrad Kostecki</name>
</maintainer>
<longdescription>
This package aims to replace the <pkg>net-wireless/rtl-sdr</pkg> package,
as it contains various improvments for RTL-SDR Blog V3 and V4 units.
Since it's based on a modified <pkg>net-wireless/rtl-sdr</pkg> package,
it cannot co-exist with it.
</longdescription>
<use>
<flag name="zerocopy">may cause a bus error on some ARM systems</flag>
</use>
<upstream>
<remote-id type="github">osmocom/rtl-sdr</remote-id>
</upstream>
</pkgmetadata>

View File

@@ -0,0 +1,58 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit cmake udev
DESCRIPTION="Modified Osmocom drivers with enhancements for RTL-SDR Blog V3 and V4 units"
HOMEPAGE="https://github.com/rtlsdrblog/rtl-sdr-blog"
SRC_URI="https://github.com/rtlsdrblog/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz"
LICENSE="GPL-2+ GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86"
IUSE="+zerocopy"
RDEPEND="virtual/libusb:1"
DEPEND="${RDEPEND}"
PATCHES=(
"${FILESDIR}/${PN}-1.3.6-disable-static.patch"
"${FILESDIR}/${PN}-1.3.6-pkgconfig-libdir.patch"
"${FILESDIR}/${PN}-1.3.6-udev-rules-path.patch"
)
src_prepare() {
cmake_src_prepare
# Set proper so file version name
sed -e '/VERSION_INFO_PATCH_VERSION/ s/git/0/g' -i CMakeLists.txt || die
}
src_configure() {
local mycmakeargs=(
-DCVF_VERSION="${PV}"
-DDETACH_KERNEL_DRIVER="ON"
-DENABLE_ZEROCOPY="$(usex zerocopy)"
-DINSTALL_UDEV_RULES="ON"
)
cmake_src_configure
}
src_install() {
cmake_src_install
newinitd "${FILESDIR}"/rtl_tcp.initd rtl_tcp
newconfd "${FILESDIR}"/rtl_tcp.confd rtl_tcp
}
pkg_postinst() {
udev_reload
elog "Only users in the usb group can capture."
elog "Just run 'gpasswd -a <USER> usb', then have <USER> re-login."
}
pkg_postrm() {
udev_reload
}