Skip to content

add build and platform support for Haiku#425

Open
TheZeldakatze wants to merge 2 commits into
uowuo:masterfrom
TheZeldakatze:haiku
Open

add build and platform support for Haiku#425
TheZeldakatze wants to merge 2 commits into
uowuo:masterfrom
TheZeldakatze:haiku

Conversation

@TheZeldakatze

Copy link
Copy Markdown

Hello,
I wanted to upstream the patches that are needed to compile abaddon on Haiku for quite some time
and now finally found the time to do that. Until now, they were only on the haikuports/haikuports repository.

Comment thread src/platform.cpp

std::string Platform::FindResourceFolder() {
static std::string found_path;
static bool found = false;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you never set this to true

Comment thread src/platform.cpp Outdated
Comment on lines +237 to +238
char buffer[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
find_directory(B_SYSTEM_DATA_DIRECTORY, volume, false, buffer, sizeof(buffer));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can find_directory fail? at least zero-initialize with char buffer[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH] {};

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in theory it could (according to https://www.haiku-os.org/legacy-docs/bebook/BDirectory.html#find_directory ), however /system/data/ is a directory generated by the package kit and should never fail.

Comment thread src/platform.cpp Outdated

dev_t volume = dev_for_path("/boot");
char buffer[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH];
char cmdbuffer[B_PATH_NAME_LENGTH+B_FILE_NAME_LENGTH] = "mkdir -p ";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just use std::filesystem::create_directories

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now using the Haiku-native create_directory function. I used the system()-call previously as I did the same on another port when I was much less experienced.

Comment thread src/platform.cpp
return found_path;
}

std::string Platform::FindStateCacheFolder() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesnt create the directory

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also moved the cache to the user directory instead of the system directory (in practice, Haiku is a single-user system, so it should not matter, but the cache cotains user-specific data)

Comment thread cmake/Findgtkmm.cmake Outdated
Comment on lines 35 to 36
PATH_SUFFIXES ${GTKMM_LIBRARY_NAME}
PATH_SUFFIXES ${GTKMM_LIBRARY_NAME}/include)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PATH_SUFFIXES unnecessarily doubled up

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope I've fixed that up properly now. I'm not that experienced with cmake

Comment thread cmake/Findgtkmm.cmake Outdated
Comment on lines +42 to +43
HINTS ${GTKMM_INCLUDE_DIR}
PATH ${GTKMM_INCLUDE_DIR}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HINTS doubled up and PATH is not a keyword

Comment thread CMakeLists.txt Outdated
endif ()

if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9.1"))
if (NOT (CMAKE_SYSTEM_NAME STREQUAL "Haiku") AND

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if if (HAIKU) works above then why not here ?

@TheZeldakatze TheZeldakatze force-pushed the haiku branch 2 times, most recently from da42ff0 to 117781d Compare July 11, 2026 14:00
@TheZeldakatze

Copy link
Copy Markdown
Author

Haiku has a qrcodegen package, so I've also added some stuff to check for a system package and use that if it exists

@TheZeldakatze

Copy link
Copy Markdown
Author

Haiku has a qrcodegen package, so I've also added some stuff to check for a system package and use that if it exists

nevermind. I messed some cmake stuff up. I'll do another PR for that once I've fixed that up. Sorry about that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants