Advertisement
Guest User

Untitled

a guest
Feb 12th, 2023
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.75 KB | Source Code | 0 0
  1. (save as haikuports/net-wireless/rtl-sdr/rtl_sdr-2023.2.0.recipe)
  2. ---
  3.  
  4. SUMMARY="Turns your RTL2832 based USB dongle into a SDR receiver"
  5. DESCRIPTION="(WARNING: this is built from an experimental fork of \
  6. the original rtl-sdr libs, check the Github repo below. YMMV.) \
  7. \
  8. rtl-sdr is a Software-Defined Radio (SDR) library intended for use \
  9. with low-cost DVB-T/DAB(+) USB dongles based on the Realtek RTL2832U \
  10. chip. This experimental package contains Haiku libraries (librtl_sdr) \
  11. for working with supported SDR software, development headers for apps \
  12. that require them, and a set of command line tools."
  13. HOMEPAGE="https://github.com/Mr-Precise/rtl-sdr"
  14. COPYRIGHT="2012,2013-2020 OSMOCOM Project"
  15. LICENSE="GNU GPL v2"
  16. REVISION="1"
  17. # -------- this will point to main eventually, when fork becomes Haiku-compatible...
  18. #SOURCE_URI="https://github.com/Mr-Precise/rtl-sdr/archive/refs/tags/v$portVersion.tar.gz"
  19. #CHECKSUM_SHA256="hey_ima_checksum_yo!"
  20. #SOURCE_DIR="rtl-sdr-$portVersion"
  21. # -------- but for now points to dev branch:
  22. SOURCE_URI="https://github.com/Mr-Precise/rtl-sdr/archive/refs/heads/devel.zip"
  23. CHECKSUM_SHA256="5b7534f54ebd0be4203de8a579465906eb68533a383a1a74824bae76f2845a25" # as of 13th Feb.
  24. SOURCE_DIR="rtl-sdr-devel"
  25.  
  26. ARCHITECTURES="all !x86_gcc2"
  27. SECONDARY_ARCHITECTURES="x86"
  28.  
  29. commandBinDir=$binDir
  30.  
  31. PROVIDES="
  32.     rtl_sdr$secondaryArchSuffix = $portVersion
  33.     cmd:rtl_adsb$secondaryArchSuffix = $portVersion
  34.     cmd:rtl_biast$secondaryArchSuffix = $portVersion
  35.     cmd:rtl_eeprom$secondaryArchSuffix = $portVersion
  36.     cmd:rtl_fm$secondaryArchSuffix = $portVersion
  37.     cmd:rtl_ir$secondaryArchSuffix = $portVersion
  38.     cmd:rtl_power$secondaryArchSuffix = $portVersion
  39.     cmd:rtl_sdr$secondaryArchSuffix = $portVersion
  40.     cmd:rtl_nfc$secondaryArchSuffix = $portVersion
  41.     cmd:rtl_tcp$secondaryArchSuffix = $portVersion
  42.     cmd:rtl_test$secondaryArchSuffix = $portVersion
  43.     lib:librtlsdr$secondaryArchSuffix = $portVersion
  44.     devel:librtlsdr$secondaryArchSuffix = $portVersion
  45.     "
  46.  
  47. REQUIRES="
  48.     haiku$secondaryArchSuffix
  49.     libusb$secondaryArchSuffix
  50.     lib:libusb$secondaryArchSuffix
  51.     "
  52.  
  53. BUILD_REQUIRES="
  54.     CMake
  55.     haiku${secondaryArchSuffix}_devel
  56.     libusb${secondaryArchSuffix}_devel
  57.     pkgconfig
  58.     "
  59.    
  60. BUILD_PREREQUIRES="
  61.     cmd:cmake
  62.     cmd:gcc$secondaryArchSuffix
  63.     cmd:ld
  64.     cmd:make
  65.     "
  66.  
  67. BUILD()
  68. {
  69.  
  70. #   -------- echo lines mostly to help me debug where the recipe fails
  71. #   -------- they'll be all gone eventually, same with these comments
  72.  
  73.     echo "\\\\\\\\ Build step"
  74.     export LDFLAGS="-lnetwork"
  75.     cmake -DCMAKE_BUILD_TYPE=Release -DINSTALL_STATIC_LIB=NO -Bbuild $cmakeDirArgs
  76. #   -------- TODO: check if/how -DENABLE_ZEROCOPY=ON and -DDETACH_KERNEL_DRIVER=ON improve stability
  77.  
  78.     echo "\\\\\\\\\ Make step"
  79.     cd build
  80.     make $jobArgs
  81. }
  82.  
  83. INSTALL()
  84. {
  85. #   -------- this doesn't work on main yet, only dev
  86.     echo "\\\\\\\\\ Install step"
  87.     cd build
  88.     make install
  89.  
  90. #   -------- not so pretty stuff
  91. #   -------- this allows package to build "by hand"
  92. #   -------- will go away when cmake builds clean on main
  93. #   echo "Install: includes..."
  94. #   install -d $includeDir/rtl_sdr
  95. #   install -t $includeDir/rtl_sdr build/src/*.h
  96. #   echo "Install: pkgconfig cfg..."
  97. #   install -d $libDir/pkgconfig
  98. #   install -t $libDir/pkgconfig build/librtlsdr$secondaryArchSuffix.pc
  99. #   echo "Install: libs..."
  100. #   install -d $libDir/cmake/rtl_sdr
  101. #   install -t $libDir/cmake/rtl_sdr build/src/*.cmake
  102. #   install -t $libDir build/src/librtlsdr$secondaryArchSuffix.*
  103. #   echo "Install: binaries..."
  104. #   install -d $binDir
  105. #   install -t $binDir build/src/rtl_*
  106. #   echo "Install: leave only shared lib..."
  107. #   rm $libDir/lib*$secondaryArchSuffix.a
  108. #   echo "Prepare devlibs:"
  109. #   prepareInstalledDevelLibs librtlsdr$secondaryArchSuffix
  110.    
  111.     echo "\\\\\\\\\ Fix pkgconf step"
  112.     fixPkgconfig
  113. }
  114.  
  115. TEST()
  116. {
  117.     make check
  118. }
  119.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement