Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (save as haikuports/net-wireless/rtl-sdr/rtl_sdr-2023.2.0.recipe)
- ---
- SUMMARY="Turns your RTL2832 based USB dongle into a SDR receiver"
- DESCRIPTION="(WARNING: this is built from an experimental fork of \
- the original rtl-sdr libs, check the Github repo below. YMMV.) \
- \
- rtl-sdr is a Software-Defined Radio (SDR) library intended for use \
- with low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U \
- chip. This experimental package contains Haiku libraries (librtl_sdr) \
- for working with supported SDR software, development headers for apps \
- that require them, and a set of command line tools."
- HOMEPAGE="https://github.com/Mr-Precise/rtl-sdr"
- COPYRIGHT="2012,2013-2020 OSMOCOM Project"
- LICENSE="GNU GPL v2"
- REVISION="1"
- # -------- this will point to main eventually, when fork becomes Haiku-compatible...
- #SOURCE_URI="https://github.com/Mr-Precise/rtl-sdr/archive/refs/tags/v$portVersion.tar.gz"
- #CHECKSUM_SHA256="hey_ima_checksum_yo!"
- #SOURCE_DIR="rtl-sdr-$portVersion"
- # -------- but for now points to dev branch:
- SOURCE_URI="https://github.com/Mr-Precise/rtl-sdr/archive/refs/heads/devel.zip"
- CHECKSUM_SHA256="5b7534f54ebd0be4203de8a579465906eb68533a383a1a74824bae76f2845a25" # as of 13th Feb.
- SOURCE_DIR="rtl-sdr-devel"
- ARCHITECTURES="all !x86_gcc2"
- SECONDARY_ARCHITECTURES="x86"
- commandBinDir=$binDir
- PROVIDES="
- rtl_sdr$secondaryArchSuffix = $portVersion
- cmd:rtl_adsb$secondaryArchSuffix = $portVersion
- cmd:rtl_biast$secondaryArchSuffix = $portVersion
- cmd:rtl_eeprom$secondaryArchSuffix = $portVersion
- cmd:rtl_fm$secondaryArchSuffix = $portVersion
- cmd:rtl_ir$secondaryArchSuffix = $portVersion
- cmd:rtl_power$secondaryArchSuffix = $portVersion
- cmd:rtl_sdr$secondaryArchSuffix = $portVersion
- cmd:rtl_nfc$secondaryArchSuffix = $portVersion
- cmd:rtl_tcp$secondaryArchSuffix = $portVersion
- cmd:rtl_test$secondaryArchSuffix = $portVersion
- lib:librtlsdr$secondaryArchSuffix = $portVersion
- devel:librtlsdr$secondaryArchSuffix = $portVersion
- "
- REQUIRES="
- haiku$secondaryArchSuffix
- libusb$secondaryArchSuffix
- lib:libusb$secondaryArchSuffix
- "
- BUILD_REQUIRES="
- CMake
- haiku${secondaryArchSuffix}_devel
- libusb${secondaryArchSuffix}_devel
- pkgconfig
- "
- BUILD_PREREQUIRES="
- cmd:cmake
- cmd:gcc$secondaryArchSuffix
- cmd:ld
- cmd:make
- "
- BUILD()
- {
- # -------- echo lines mostly to help me debug where the recipe fails
- # -------- they'll be all gone eventually, same with these comments
- echo "\\\\\\\\ Build step"
- export LDFLAGS="-lnetwork"
- cmake -DCMAKE_BUILD_TYPE=Release -DINSTALL_STATIC_LIB=NO -Bbuild $cmakeDirArgs
- # -------- TODO: check if/how -DENABLE_ZEROCOPY=ON and -DDETACH_KERNEL_DRIVER=ON improve stability
- echo "\\\\\\\\\ Make step"
- cd build
- make $jobArgs
- }
- INSTALL()
- {
- # -------- this doesn't work on main yet, only dev
- echo "\\\\\\\\\ Install step"
- cd build
- make install
- # -------- not so pretty stuff
- # -------- this allows package to build "by hand"
- # -------- will go away when cmake builds clean on main
- # echo "Install: includes..."
- # install -d $includeDir/rtl_sdr
- # install -t $includeDir/rtl_sdr build/src/*.h
- # echo "Install: pkgconfig cfg..."
- # install -d $libDir/pkgconfig
- # install -t $libDir/pkgconfig build/librtlsdr$secondaryArchSuffix.pc
- # echo "Install: libs..."
- # install -d $libDir/cmake/rtl_sdr
- # install -t $libDir/cmake/rtl_sdr build/src/*.cmake
- # install -t $libDir build/src/librtlsdr$secondaryArchSuffix.*
- # echo "Install: binaries..."
- # install -d $binDir
- # install -t $binDir build/src/rtl_*
- # echo "Install: leave only shared lib..."
- # rm $libDir/lib*$secondaryArchSuffix.a
- # echo "Prepare devlibs:"
- # prepareInstalledDevelLibs librtlsdr$secondaryArchSuffix
- echo "\\\\\\\\\ Fix pkgconf step"
- fixPkgconfig
- }
- TEST()
- {
- make check
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement