It’s not about their own error codes, but about the places where they use errno.
For example this is found in some software and is problematic:
// This function return a positive value on success, and a negative one in case of errors
int someFunction() {
... // call some POSIX function that sets errno
if (error)
return -errno; // this doesn't work on Haiku because errno will be negative so -errno will be positive.
}
If the code you’re working with isn’t doing things like this with errno, you should be fine.
My recipe builds fine with autotools, but I ran into a weird outcome. Stopping rtl_sdr with Ctrl+C does not quit nicely but rather pops-up the “app crash” dialog, while still trying to access the USB stack. This fills the terminal w/timeout errors. Choosing “terminate” ultimately kills the thread.
I used autotools because of familiarity, but rtl_sdr can be built with cmake too. Looking at the Windows build filenames makes me believe they use cmake with -DCMAKE_BUILD_TYPE=RelWithDebInfo by default for all platforms.
Would building with -DCMAKE_BUILD_TYPE=Release (or MinRel) help fix such behavior in this case?
edit. BTW thank you @waddlesplash for the commit removing the old play command!
No, it will just remove debug info (which allow to identify the file, line and function where a thing crashed) and make things harder to investigate. But the software behavior will be the same.
Baby steps… The cmake scripts want to install everything to hardcoded /boot/system, this obviously doesn’t work.
In haikuporter we can pass these vars instead, but I don’t see one to abstract the system dir. It would’ve been nice to do something like make install DESTDIR=$sysDir and call it a day.
The way I see it, there are 3 options:
Find a way to build the recipe without modifying original scripts.
Ask mantainer(s) to modify rtl_sdr install scripts, to take Haiku into account and do a proper install - this I’m not sure they’ll see as worthy of their time, but I can try.
If all else fails, a manual INSTALL() by hand? ie. install -d $libDir some_libs and iterate for bin, includes etc – took a look at some recipes and it’s doable, if a bit ugly.
Unless there is a better way?
(BTW - why insist on cmake if rtl_sdr built fine with autotools? Because it’s a stable library, but development stagnated long time ago and it’s on maintenance mode now. There are newer, better mantained forks with more features, and the one I’m trying to build dropped autotools support.)
If the recipe properly uses CMake and in particular the GnuInstallDirs setup, this should work just fine. You indeed need to specify several directories. In your example error, it’s trying to create an “include” directory where in Haiku this should be “headers”
You also need to set CMAKE_INSTALL_PREFIX to point to the appropriate place ($prefix in haikuports, or /boot/system/non-packaged if you want to install locally for example).
In the case of haikuporter, the only thing you really need to do is to pass $cmakeDirArgs to cmake when invoking it in the recipe. If this doesn’t work, it means the CMakeLists were not written using the best practises and they should be improved to work in that case.
I asked the fork maintainer to look at this, he seems eager to support Haiku. In the meanwhile option 3 builds properly - but 1st I’ll wait for him to fix cmake build, before PRing a recipe.
I’m still learning how to git around (pun intended ), do upstreams and such. Next ports I hope to be able to patch things and do a bit of actual coding if needed.
My main goal is to completely port SDR++ to Haiku, so I have a lot to learn.
$includeDir, $libDir and $binDir don’t need $secondaryArchSuffix, this is done by haikuporter when doing a build for 32bit. Haven’t looked at the source (could you link it?), without meaningfull comments
I have both an RTL-SDR dongle, and an Airspy-Mini (a better performing SDR dongle) that I used to use for HAM radio band listening with a Spyverter (just an RF upconverter).
So… while I can’t be of much use developing right now, i’d be happy in the coming days/weeks to do any testing you would like? I’d personally LOVE to use haiku for radio stuff. Admittedly i’m somewhat out of the loop on radio these days, but i think using these things in haiku would certainly rekindle the interest.
The “patch” got upstreamed in the devel branch, if things are OK there for other OS’s it should be good to go to move into master branch, less patching involved then
Okay, cmake build from dev branch looks good now. Let’s wait for him pushing to main and I’ll finish the recipe. In the meantime here’s a draft for review & testing, please comment and correct any mistakes I made:
Weeell it builds fine and all but I wanted some pre-input, you know being my 1st recipe ever… I know PRs are exactly for that but ehh, I’m shy
@Begasus you ok if I take some bits from yours? Namely the _devel entries (re)ordering… the rest I actually want to be corrected the proper way when doing the PR, to learn the do and dont’s.