support building on OpenBSD #3652
Replies: 28 comments 4 replies
-
i'm pretty sure you need the sdl2 development package to ensure the headers are available at build time (on debian that's |
Beta Was this translation helpful? Give feedback.
-
sorry for the late response, there doesnt seem to be a separate package for my system, and in
maybe im missing something but this seems right? also the proper .a/.so files
|
Beta Was this translation helpful? Give feedback.
-
I was in the middle of typing a response when you posted your last comment, where I was going to suggest you check those directories and yep, seems like everything is there. I'm noticing they are in It's not likely the cause of this particular issue, but you seem to have version 2.0.20 installed while our BUILDING.md indicates you need at least 2.0.22. It will probably be just fine, but if you do have any weird bugs that nobody can replicate later that could be the cause. |
Beta Was this translation helpful? Give feedback.
-
as far as the update, i just checked and theres a new sdl2 version in ports, but the package repo doesn't seem updated, i'll look at building and installing that if i need to. and yes i don't honestly know if cmake checks those directories for files, but i assume since other projects work, and the openbsd package installs the cmake files to that directory, so i assume it would |
Beta Was this translation helpful? Give feedback.
-
Ok, I have one thing I'd like you to try, I'm not quite sure if it will make any difference. In |
Beta Was this translation helpful? Give feedback.
-
You could also try adding the flag |
Beta Was this translation helpful? Give feedback.
-
Oh and I should clarify, changing just that one line I mentioned may not make it configure successfully, but it should get rid of one of those two errors if that's what the issue was. |
Beta Was this translation helpful? Give feedback.
-
doing all three gives the exact sane results unfortunately,
|
Beta Was this translation helpful? Give feedback.
-
didn't mean to close it oops, it for some reason enter closed it, anyway i meant to say as an example that is the results of one but i tried all three |
Beta Was this translation helpful? Give feedback.
-
oh and from what i understand isn't the SDL2::SDL2 call looking for specifically the SDL2 shared object? i noticed |
Beta Was this translation helpful? Give feedback.
-
No, it should be linking the library statically and thus should be looking for libSDL2.a I believe. And regardless I've got similarly weird names on Linux, although now that you bring it up I do see symlinks for names without those numbers on Linux. Hmmm, perhaps for BSD we need to be linking Thanks for your patience in testing thus far, I don't think anyone on the dev team has a BSD system ready to go, so you being willing to try my suggestions is a huge help. |
Beta Was this translation helpful? Give feedback.
-
SDL2-static gives this
no problem this is easy enough for me to test, honestly i attempted to get it working my self for awhile but i'm just not used to cmake like i am other build systems |
Beta Was this translation helpful? Give feedback.
-
It looks like you changed line 2063, that should stay at just find_package(SDL2)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(ADDITIONAL_LIBRARY_DEPENDENCIES
"libultraship;"
"ZAPDUtils;"
SDL2::SDL2-static #change this line
"$<$<BOOL:${BUILD_CROWD_CONTROL}>:SDL2_net::SDL2_net>"
${CMAKE_DL_LIBS}
Threads::Threads
) |
Beta Was this translation helpful? Give feedback.
-
oh sorry, my bad, will fix that, thank you yeah changing that around, it gives the original error just with that name now
|
Beta Was this translation helpful? Give feedback.
-
Hmmm. I'm running out of ideas then. I'd say your next best bet is to see if you can build and install SDL2 2.0.22 or above. I haven't dug deep enough yet to say for certain, but there were definitely cmake changes between those two versions that might have an impact. |
Beta Was this translation helpful? Give feedback.
-
okay, i'll probably have to wait til tomorrow then, is |
Beta Was this translation helpful? Give feedback.
-
Definitely worth a shot. If I have time I might try and make an OpenBSD VM and experiment, but I can't make any promises about when that will be. |
Beta Was this translation helpful? Give feedback.
-
okay will try it tomorrow, i'll also see if i can think of anything else, hopefully that works we will see, thanks for all the help |
Beta Was this translation helpful? Give feedback.
-
i tried it earlier today but do to unrelated issues with building any version of the SDL2 port i haven't been able to build the more up to date package, i'll experiment with this more but that might take awhile |
Beta Was this translation helpful? Give feedback.
-
I had used this on linux when it wasn't finding SDL2
EDIT:
and
|
Beta Was this translation helpful? Give feedback.
-
Only SDL2::SDL2 is not found. https://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/devel/sdl2/patches/Attic/patch-sdl2-config_cmake_in?rev=1.4&content-type=text/plain&hideattic=1 shows a patch to add it. With this configuration works. |
Beta Was this translation helpful? Give feedback.
-
In file included from /home/vagrant/Shipwright-cmake/libultraship/extern/ImGui/backends/imgui_impl_sdl.cpp:78: |
Beta Was this translation helpful? Give feedback.
-
modifying playing around with the extract assets phase now results in it not finding SDL.h no matter if i passed
i guess this is where i should mention that i've been using https://github.com/michaelforney/samurai on my system for ninja builds, but it shouldn't be negatively effecting anything, and if it seems like it could i'll try regular ninja. if that patch does something special id like to know but actually cant figure out where or why its applied sdl2-config.cmake is literally just
i assume this is prepatched when built for openbsd, honestly that might be the patch used on building the sdl2 package. |
Beta Was this translation helpful? Give feedback.
-
I also reviewed the patch @th-2021 mentioned prior to building. The last time I ran into the ftruncate errors was when we were beginning the port for switch. At the time I had used a modified FileStream.cpp for StormLib. StormPort.h has some of the defines listed. Edit: Fixes the |
Beta Was this translation helpful? Give feedback.
-
I'm having completely different issues. I was able to run
Edit: fixed with the following patch:
Save this patch in the |
Beta Was this translation helpful? Give feedback.
-
I believe OpenBSD uses clang by default now, so #3383 will be another step towards proper support. |
Beta Was this translation helpful? Give feedback.
-
Hi all, I recently set up a VM running OpenBSD 7.4. I didn't run into any issues with SDL2 but CMake is having issues with the GL header files despite having included them. I haven't resorted to linking X11R6/include to usr/include yet but I might do so. I'm not really knowledgeable enough in CMake to understand why using FindOpenGL and target_include_directory isn't working despite FindOpenGL correctly identifying the include folder. X seems to have issues running in HyperV, I really don't have the patience to debug it right now. This certainly limit my helpfulness. |
Beta Was this translation helpful? Give feedback.
-
I daily drive -CURRENT on a laptop. I am trying to build this on real hardware, i found that something like this can get the
###
# OpenBSD
###
if (CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
include_directories("/usr/local/include")
include_directories("/usr/X11R6/include")
link_directories("/usr/local/lib")
link_directories("/usr/X11R6/lib")
message(STATUS "OpenBSD Detected")
endif() thats all i did to get past the X11 stuff. i followed @swindlesmccoop's patch guide from this thread to get the i have a 4-core (with smt) i5-5500U-based machine, and its been a grueling process getting this thing built just to see another linkage error or something. just wanted to share what i did to fix some things, still have yet to get a successful build, but it's certainly not a dead discussion thread. EDIT: with the edits mentioned above, this is where i met a roadblock:
i had this occurs when running the i'm building with debug symbols, unsure about i am no c/++ dev, so i have no clue how to interpret this. any ideas? |
Beta Was this translation helpful? Give feedback.
-
following https://github.com/HarbourMasters/Shipwright/blob/develop/BUILDING.md#linux (linux is the most similar)
when you get to
cmake -H. -Bbuild-cmake -GNinja
it can't find the system sdl2 it seems.the pkg is installed
the cmake files for SDL2 seem to be in the proper
/usr/local/lib/cmake/SDL2/
location.i have no idea what could be causing this issue as it seems to be entirely dependency related, i might be missing something with how cmake handles dependencies but i'm not sure
Beta Was this translation helpful? Give feedback.
All reactions