-
Notifications
You must be signed in to change notification settings - Fork 17
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
Support for libSDL2 #52
Comments
@nfeske: Okay, will have a look. |
I'd also love to see libSDL2 support being added to Goa. Especially with the usability improvements of Goa in Genode 23.08. I can't wait to take it out for a spin for some hobby projects : ) @ssumpf thanks for working on this! |
I'm actually offering libSDL2 at my depot: https://depot.genode.org/nfeske/bin/x86_64/sdl2/ (x86) and https://depot.genode.org/nfeske/bin/arm_v8a/sdl2/ (64-bit ARM). In your Goa project you can refer to my archive in your pkg/archives file using the concrete version It might be worth reviewing the directory https://depot.genode.org/nfeske/bin/x86_64/ for other useful archives, e.g., sdl_image is also there, which is often used by libSDL-based applications. |
That's great! Thanks Norman : ) Hope you've had a lovely summer. Did you do a Hack n' Hike this year? happy hugs |
I spent my summer vacation completely analog, which was quite refreshing for the mind. Feeling nicely re-energized for the next Genode topics now. :) We haven't had a Hack'n'Hike this year, but in my opinion we should definitely consider it for spring 2024. Would love to know how the others, e.g., @m-stein or @chelmuth, think about it. |
Glad to hear! I too enjoyed some time in nature this summer. Went trekking in the Rocky Mountains in Canada, a long-lived dream of mine. It's so great to see what you've managed to do with Genode since the first time we met all these years back. An amazing journey to follow <3 |
Hi @nfeske! I've had a blast experimenting with Goa and Rust. Thanks for publishing your sdl2 package to the depot. I did run into some issues though with getting sdl2 running on the latest version of Genode. In particular, I currently get the following link time error when running programs linked against sdl2 (2023-04-27).
|
It seems you have to build the sdl2 archive by yourself as libsdl2 was adapted in genodelabs/genode-world@9d779a3 too. |
|
That's because Goa is officially tied to the most recent Sculpt version, which is not binary-compatible with the latest Genode version. So if you want to target the latest Genode, you'd have to create the package for libSDL2. That's not hard. You can find the pkg recipes for the src and api at the genode-world repository and use the following command to create it locally:
Just on case you haven't already encountered them, I recommend exploring |
Prevent people from using this variable too pull in '-ldl' that is not available on Genode ('dlopen' etc. is provided by libc.lib.so). Issue genodelabs#52.
Otherwise cmake appears to fall back to using the EXE linker flags, which results in non-working shared-objects as they are treated as binaries and are linked at the usual entry-point address. Issue genodelabs#52.
The modules simply return 'True', this is required by dhewm3 (Doom3 source port). Issue genodelabs#52.
Needed for yquake2 port. Issue genodelabs#52.
I spent some time to adapt the SDL2 support based on @ssumpf work and with the referenced commits I am able to build |
Otherwise cmake appears to fall back to using the EXE linker flags, which results in non-working shared-objects as they are treated as binaries and are linked at the usual entry-point address. Issue genodelabs#52.
Otherwise cmake appears to fall back to using the EXE linker flags, which results in non-working shared-objects as they are treated as binaries and are linked at the usual entry-point address. Issue genodelabs#52.
Otherwise cmake appears to fall back to using the EXE linker flags, which results in non-working shared-objects as they are treated as binaries and are linked at the usual entry-point address. Issue genodelabs#52.
Otherwise cmake appears to fall back to using the EXE linker flags, which results in non-working shared-objects as they are treated as binaries and are linked at the usual entry-point address. Issue #52.
While porting SDL-based software and libraries, I encountered a few limitations of Goa.
|
The libraries expect to find their "sibling" headers via e.g., 'include "SDL.h"'. In contrast to systems with a global include/SDL/ directory, we need to add the include/SDL/ sub dir of each companion library to the include-search path. Issue genodelabs#52
@jschlatow would you consider the the commits of my sdl2 branch (https://github.com/nfeske/goa/commits/sdl2) for staging? |
@jschlatow Alright, it works in general but I had to make some adaptions depending on the host system. In my fairly old Debian 10 VM featuring cmake 3.13.4 using On the other hand, my other system features cmake 3.27.6 but without commit 9872274 it always picks up definitions from Browsing cmake's documentation I was wondering if it makes sence for our use-case to ”explicitly” drive it in cross-compiling mode to prevent any cross-pollination. |
That is strange because commit b45cae7 should prevent this if I understood the implementation correctly. I had a similar effect though caused by cmake's caching. Only after removing the build directory, the aforementioned commit was effective for me. Have you tried removing the build directory? |
Yes, I removed |
Out of curiosity, does it help setting |
Also setting it to |
Then we should probably disable all the |
I'm on it. |
Well, the original commit 9872274 that mitigates my problem with one project breaks the linphone-sdk because now the required python interpreter cannot be found anymore for obvious reasons via After further consulting the documentation I see your point that ignoring the |
Looking at cmake's implementation, I noticed that the prefixes are compared before generating the search paths patterns. I.e. if your |
@cnuke I must correct myself, adding |
Alright, shame on me - I completely forgot that on voidlinux Sorry for somewhat wasting your time on that problem. For completeness sake I updated commit 940e01e but I am somewhat indifferent of including it. |
Thanks for clearing up this mystery. I merged both commits to staging. |
All fixes entered the master branch today. I also just pushed an example with commit 4fad395 on staging. It still references my modified api/sdl2 archive, though. |
The libSDL2 and friends (like Mesa) are readily available at genode-world. However, to use the library from a Goa project, using CMake in particular, a few pieces are missing in Goa. Fortunately, @ssumpf happens to have those puzzle pieces in a branch https://github.com/ssumpf/goa/commits/doom3.
@ssumpf I would very much appreciate you upstreaming the libSDL2 support! Maybe even along with a simple example of using it with CMake? I'm asking because the latest version of Hatari relies on SDL2 and uses CMake.
The text was updated successfully, but these errors were encountered: