Skip to content
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

How to depend on SDL2 (libGL error) #41620

Closed
pmiddend opened this issue Jun 7, 2018 · 8 comments
Closed

How to depend on SDL2 (libGL error) #41620

pmiddend opened this issue Jun 7, 2018 · 8 comments

Comments

@pmiddend
Copy link
Contributor

pmiddend commented Jun 7, 2018

Issue description

I hope opening an issue for this is appropriate. I'm using pysdl2 (meaning I have pysdl2 in my propagatedBuildInputs), which depends on SDL2, of course. Initialization of SDL2 fails because it cannot find libGL.so.1.
Looking at SDL2's source code, I see that it tries to dlopen either "libGL.so.1" (hard-coded) or whatever is inside SDL_OPENGL_LIBRARY. To properly package my application, am I to create a wrapper script for my application that sets this environment variable? Or what's the recommended approach when depending on libGL? I'm aware of PR 37369 (glvnd), but I'm not sure how to react to it.

@orivej
Copy link
Contributor

orivej commented Jun 7, 2018

Are you on non-NixOS Linux?

@pmiddend
Copy link
Contributor Author

pmiddend commented Jun 7, 2018

Nope, I'm on NixOS.

@orivej
Copy link
Contributor

orivej commented Jun 7, 2018

Then your LD_LIBRARY_PATH environment variable should contain /run/opengl-driver/lib:/run/opengl-driver-32/lib with libGL.so.1 in both of them. Is that so?

@pmiddend
Copy link
Contributor Author

pmiddend commented Jun 8, 2018

No, and it shouldn't contain that, see here.

My LD_LIBRARY_PATH looks like that, but it doesn't contain libGL.so.1.

@orivej
Copy link
Contributor

orivej commented Jun 8, 2018

Oops, I was not up to date on #37369. @abbradar, could you help?

@gebner
Copy link
Member

gebner commented Jun 10, 2018

Since #37369, the libGL.so libraries are no longer in /run/opengl-driver/lib/libGL.so, they are now in ${libGL}/lib/libGL.so.

@orivej
Copy link
Contributor

orivej commented Jun 11, 2018

SDL2 was not properly adapted for #37369, I'll fix it.

orivej added a commit to orivej/nixpkgs that referenced this issue Jul 2, 2018
Fixes NixOS#41620 by adding libGL directory to libSDL2 runpath
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

No branches or pull requests

4 participants
@orivej @pmiddend @gebner and others