-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimal Haiku implementation #1538
Conversation
@@ -1088,6 +1090,74 @@ elseif(SunOS) | |||
src/util/platform/FFPlatform_unix.c | |||
src/util/binary_linux.c | |||
) | |||
elseif(Haiku) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Haiku support OpenGL, pulseaudio or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OpenGL yes, we have our own audio framework (MediaKit)… I wanted to have something that compiles before expanding to these.
continue; | ||
#ifdef IFF_RUNNING | ||
if (!(ifa->ifa_flags & IFF_RUNNING)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we know if it's running then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK this is not really used in most drivers on Linux anyway, it's here for BSD compatibility.
I'll add our own extra flags that I missed (IFF_LINK,…CONFIGURING…).
I suppose I could fake it when UP & LINK…
Thanks for your interest. Can we set up a CI to ensure it won't be broken unexpectedly? |
I'm not sure we can get it into the GitHub CI stuff, since we build the cross-compiler from our own build system only to generate the image… |
So I asked around, we have:
|
28fc078
to
1a1a728
Compare
|
|
|
I think I picked all the low-hanging fruits, maybe we can get this in already? |
For the record, the JSON output: ff.json |
The |
Oh right, missed that! |
Thanks for your contribution. I wonder how the output is comparing to neofetch's |
Line 1137 in 01f400c
This file doesn't exist. Does your code really compile? |
That should be diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1a8b39d..9435569 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1607,6 +1607,7 @@ elseif(Haiku)
target_link_libraries(libfastfetch
PRIVATE "network"
PRIVATE "be"
+ PRIVATE "gnu"
)
endif()
diff --git a/src/common/processing_linux.c b/src/common/processing_linux.c
index 63d3951..02d3bf8 100644
--- a/src/common/processing_linux.c
+++ b/src/common/processing_linux.c
@@ -34,7 +34,7 @@ enum { FF_PIPE_BUFSIZ = 8192 };
static inline int ffPipe2(int *fds, int flags)
{
- #ifdef __APPLE__
+ #if defined(__APPLE__) || defined(__HAIKU__)
if(pipe(fds) == -1)
return -1;
fcntl(fds[0], F_SETFL, fcntl(fds[0], F_GETFL) | flags);
-- |
@Begasus Please test the newest commit Some issue I found from your screenshot
|
Thanks so far! Looks promising (mind you I'm no developer, @mmuman is the real one :) No patching with master checkout: |
Oops, thought I replaced it with the haiku one, that was a test. |
The code is there but the API returns an error, so either it's not implemented at all, or at least on VESA mode.
That can probably be fixed.
For most network interfaces yes, for historical reasons.
Yes, I didn't find an easy way to find that yet, we'd have to dig the resources in the kernel file or something. |
Alternatively, we may set Line 2011 in 8774fb3
FF_COLOR_FG_DEFAULT , so that fastfetch will use black color in light mode.
|
if (!(options->disabled & FF_PACKAGES_FLAG_PKG_BIT)) | ||
result->pkg = ffPackagesGetNumElements(FASTFETCH_TARGET_DIR_ROOT "/system/packages", false); | ||
if (!(options->disabled & FF_PACKAGES_FLAG_PKGSRC_BIT)) | ||
result->pkgsrc = ffPackagesGetNumElements(FASTFETCH_TARGET_DIR_ROOT "/boot/home/config/packages", false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usage of pkg
and pkgsrc
here doesn't really make sense. These are the same kind of packages (Haiku packages, "hpkg"), but rather system packages and user packages, respectively.
I see that there is such a distinction already for other packaging systems (e.g. for flatpak here). So I think it would make sense to add haikuSystem
and haikuUser
there as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I just used that because I wasn't sure how it was categorized, but that'd be better.
Ideally we'd query the Package Kit because some packages could be disabled.
Hmm the newest commits fail to build on 32bit… |
437006f still builds here on R1B5 32bit. |
This is a first try at supporting Haiku, with the minimum to compile.