electronstudio / raylib-python-cffi

Python CFFI bindings for Raylib
http://electronstudio.github.io/raylib-python-cffi
Eclipse Public License 2.0
142 stars 29 forks source link

#77 use all link flags from pkg-config #78

Closed archie2x closed 1 year ago

archie2x commented 1 year ago

Uses output of pkg-config --libs instead of pkg-config --variable=libdir

Automatically adds dynamic library dependencies when linking with libraylib.so

electronstudio commented 1 year ago

I'm pretty sure that there must have been a reason I didn't use pkg-config --libs in the first place. Raylib doesn't have very good support for pkg-config so I suspect it was that on some platforms this gives wrong results.

archie2x commented 1 year ago

Yes that multiplatform is difficult. My concern would be that if there are spaces in the tokens then splitting it on spaces isn't the correct thing.

On Fri, Aug 5, 2022, 6:04 PM Richard Smith @.***> wrote:

I'm pretty sure that there must have been a reason I didn't use pkg-config --libs in the first place. Raylib doesn't have very good support for pkg-config so I suspect it was that on some platforms this gives wrong results.

— Reply to this email directly, view it on GitHub https://github.com/electronstudio/raylib-python-cffi/pull/78#issuecomment-1207113224, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACIV4FRI2KB5C7AFGBXOR2DVXW23HANCNFSM55XVEBKQ . You are receiving this because you authored the thread.Message ID: @.***>

electronstudio commented 1 year ago

I think the issue is that some distributions (homebrew on Mac maybe) install both static and dynamic versions of raylib. Then even if you do pkg-config --libs --static you still get the dynamic version. So you have to actually specify libraylib.a to ensure you get the static version.

archie2x commented 1 year ago

I think the issue is that some distributions (homebrew on Mac maybe) install both static and dynamic versions of raylib. Then even if you do pkg-config --libs --static you still get the dynamic version. So you have to actually specify libraylib.a to ensure you get the static version.

I just did it for Linux. I was afraid there were reasons it was done this way for other platforms.

electronstudio commented 1 year ago

I think Mac and Windows users will generally be using our binary wheels now. Linux users are probably the only ones compiling, so I’m inclined to accept PR. If we do get any bug reports from that only then try to come up with a more complex solution. (Best thing would be to fix Raylib’s pkg config but that doesn’t seem to be trivial)

electronstudio commented 1 year ago

Btw I’ve also considered doing a DRM binary wheel for PI but I’m not sure how to allow user to select if they want the DRM or the X11 one.