Open victroniko opened 1 year ago
I have never used this OS I will try to install haiku os soon and I'll try to fix it
Build fixed.
Can you check the build from devel branch (before I push this change to main)?
git clone https://github.com/Mr-Precise/rtl-sdr/ -b devel
ohh I have the same problem on Windows bind ip broken in rtl_tcp afrer add IPv6 support ...although it works fine on Linux & macOS
I created haiku branch based on main-win + CMake fix Or will have to use haiku branch or full remove IPv6 support from rtl_tcp and use old code https://github.com/Mr-Precise/rtl-sdr/commit/c1aed9f9ad5e49cd2f5a052c8aad4e1b3098f73b
I can confirm haiku branch builds and works ok on Haiku x86_64.
Note that it fails at make install
step: seems paths are hardcoded to install to /boot/system and this won't do, as Haiku sys-dirs are read only. (Packages are built in a simulated environment, and ideally scripts should use syscalls to find the various dirs like bin, lib etc.) However, this step isn't necessary because I'm using haikuporter to make a ready-to-use binary package. I can use the tool abstractions for the various install paths, like this:
re: IPv6, at least for Haiku target I think it can be safely ignored/disabled for now.
I think I completely fixed the problem with binding to IP/IPv6 in Windows & Haiku OS. All changes moved to main. Install path - In the process of testing. I will try to fix it
I still don't understand how to install without creating a package
google knows little about cmake on haiku
cmake .. -DCMAKE_INSTALL_PREFIX=/system/non-packaged
works... what
I asked Haiku devs, they say cmake scripts should follow GnuInstallDirs setup. This improves portability, and your fork will build not only on Haiku but also every OS that follows GNU standard install dirs.
edit. full dev answer here with tips on how to do a local install (which is more for testing, really not needed for packaging).
Is there a way to disable the build/install for the static library? (couldn't find an option with cmake -L
)
@Begasus
I probably implemented what you wanted.
Use -DINSTALL_STATIC_LIB=NO
To do this, it is better to use a feature request.
Thanks! That worked out ok :) didn't want to step in before @victroniko made a PR for this, already commented on the forum thread reported earlier here to fix the install paths. Can't check this in other OS's but I think it should be ok (if you got some time to look into that).
@Begasus I'll be a bit low on time next week, if you want/can do a PR then please go ahead, no worries :)
@Mr-Precise ATM dev branch builds ok (inside haikuporter) with this:
cmake -DCMAKE_BUILD_TYPE=Release -DINSTALL_STATIC_LIB=NO -Bbuild $cmakeDirArgs
$cmakeDirArgs is just something we use for building w/haikuporter, don't worry about it.
edit. If dev branch builds OK on other platforms too, then we're all set.
@victroniko main branch builds fine here, posted a reply in the forum with the recipe I tested just a few minutes ago :)
Can you check for compatibility after recent changes?
One last push: GNUInstallDirs setup needs to live before install options, otherwise CMake won't pick it up.
--- CMakeLists.txt 2023-02-14 14:56:24.043515904 -0300
+++ CMakeLists.txt.diff 2023-02-21 23:46:52.618397696 -0300
@@ -42,6 +42,12 @@
include(GenerateExportHeader)
include(CMakePackageConfigHelpers)
+# Set paths early according to GNUInstallDirs (fixes Haiku build)
+set(prefix "${CMAKE_INSTALL_PREFIX}")
+set(exec_prefix \${prefix})
+set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
+set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
+
# Set the version information here
set(VERSION_INFO_MAJOR_VERSION 2023) # increment major on api compatibility changes
set(VERSION_INFO_MINOR_VERSION 2) # increment minor on feature-level changes
@@ -198,11 +204,6 @@
UNSET(RTLSDR_PC_LIBS)
ENDIF(CMAKE_CROSSCOMPILING)
-set(prefix "${CMAKE_INSTALL_PREFIX}")
-set(exec_prefix \${prefix})
-set(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
-set(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
-
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/librtlsdr.pc.in
${CMAKE_CURRENT_BINARY_DIR}/librtlsdr.pc
With this, main branch builds perfect in Haiku :D
It seems to work well through Virtualbox...
Main branch now builds OK on Haiku x86_64, confirmed!
OTOH, on x86_32... it doesn't find libusb, but it is clearly installed:
Pointing pkg_search_modules()
to _libusbx86 doesn't seem to work. @Begasus can you lend us a hand? I'm a bit lost how to pass _x86 Haiku libs to Cmake...
You probably have to switch compiler (don't have Haiku running atm) for 32bit, in Terminal type: setarch x86
(this will switch compiler from gcc2. to gcc11.), then try again. :) (exit
will get you back to gcc2 (you can also check with gcc -v
in Terminal which one is being used))
Switched architecture, no luck... I'll ask on Haiku forums and report back here.
btw. Falkon browser is very unstable - use Web (ex Ephiphany) instead.
Just checked out the latest commit on main and it's still building OK with haikuports here: https://github.com/Begasus/haikuports/commit/59bba256de23eb5508f6801febf9a49d650623ba
EDIT building from Terminal works fine too:
On x86_64 it builds fine, both w/ haikuporter and from terminal.
Building on x86_gcc11 is what doesn't work for me. As it appears to be something on Haiku side, i'll better ask in the forum :)
I will install the 32 bit version of haiku soon and try to check and fix Just a little later, I'm sick
🙂
I released version 2023.8.25. Change log rtl-sdr/releases/v2023.8.25 I think this is enough to update in haikuports.
Did a quick check, still builds and package fine on 64bit, can't check it myself as I don't have any supported devices though. Will do an update tomorrow for this @victroniko if you can could you check it out and report back?
EDIT: pushed the changes, will check in the morning if both arches were build fine on our buildmasters. Updated PR's https://github.com/haikuports/haikuports/pull/9505
Hello there!
I'm on a quest for building and making
rtl-sdr
work on Haiku, AFAIK no one had tried it before. After fiddling a bit I've built and ran it (more or less) succesfully with autotool, from the original OSMOCOM repos. Sadly it doesn't build at all with cmake.This fork looks really interesting and I want to port this one to Haiku, instead of the original... but it also fails to build with cmake, with the exact same error:
With autotool, the script checks if function _clockgettime is available and fails gracefully when it's not, which allows the build to continue. OTOH, cmake forces the -lrt flag always, and bails out when it finds
librt
(which provides _clockgettime) isn't available.Thing is, in Haiku
librt
does not exist. _clockgettime equivalent functionality resides inlibroot
(/system/lib/libroot.so)Is it possible to add a provision for checking the target platform, and if it's Haiku then use
libroot
instead oflibrt
? Maybe it's trivial but I fear it's a bit out of my coding knowledge, as I looked and fiddled w/many files (ie. CMakeLists.txt) with no success.Here's a pic of rtl_test running on Haiku, to demonstrate a working build: