Open jdeisenberg opened 6 years ago
Hey @jdeisenberg thanks for opening this issue. This looks very similar to https://github.com/Schmavery/reprocessing/issues/72
Could you show me cat node_modules/sdl2/sdl2.pc
and cat node_modules/sdl2/bsconfig.json
?
This is because we kinda generate the same linking flags for all versions of linux, disregarding what the ./configure
generated inside the sdl2.pc
(which contains exactly the right flags for your distro).
See https://github.com/bsansouci/SDL-mirror/blob/129e47282cc72b7d51246b18a4da48d919799092/postinstall.js#L135.
So eh... the real fix would be to regex parse the sdl2.pc
file and generate a more correct bsconfig than this ^.
> cat node_modules/sdl2/sdl2.pc
# sdl pkg-config source file
prefix=/home/david/reasonlab/reprocessing-example/node_modules/sdl2
exec_prefix=${prefix}
libdir=/home/david/reasonlab/reprocessing-example/node_modules/sdl2
includedir=${prefix}/include
Name: sdl2
Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
Version: 2.0.5
Requires:
Conflicts:
Libs: -L${libdir} -Wl,-rpath,${libdir} -Wl,--enable-new-dtags -lSDL2
Libs.private: -lSDL2 -Wl,--no-undefined -lm -ldl -lpthread -lrt
Cflags: -I${includedir}/SDL2 -D_REENTRANT
> cat node_modules/sdl2/bsconfig.json
{
"name": "sdl2",
"sources": "fake_src",
"c-linker-flags": ["-lasound", "-lm", "-ldl", "-lpthread", "-lrt"],
"static-libraries": ["libSDL2.a"],
"allowed-build-kinds": ["bytecode", "native"],
"refmt": 3,
}
@jdeisenberg I think this is similar to the fix here: https://github.com/bsansouci/SDL-mirror/pull/2 by @zploskey (which was the solution to the issue ben mentioned) , where we had some unnecessary dependencies specified. By looking at a couple of pkg-configs including yours, it seems like nothing actually requires -lasound to be statically linked anymore and we can remove this flag. Feel free to try removing -lasound from your sdl2 bsconfig.json and see if that helps it build.