sdl-2linuxbrew

SDL_Init fails on linuxbrew while system wide version works


I am using linuxbrew to install dynamic libraries without sudo. Those libraries are needed to compile run the project.

For some reason I need to brew uninstall sdl2 --ignore-dependencies in order to init SDL2 successfuly using system-wide version (I'd like to not depend on it though).

There are minor version differences 2.0.5 vs 2.0.2+dfsg1-6 but I think it's unlikely the root cause (the older one works).

How can I enable SDL2 from linuxbrew?


Solution

  • Compile SDL2 with X11 support: brew edit sdl2 or apply this patch directly:

    diff --git a/Formula/sdl2.rb b/Formula/sdl2.rb
    index 7450e40..70d42ee 100644
    --- a/Formula/sdl2.rb
    +++ b/Formula/sdl2.rb
    @@ -45,7 +45,7 @@ class Sdl2 < Formula
         if ENV.compiler == :llvm || (ENV.compiler == :clang && DevelopmentTools.clang_build_version < 421)
           args << "--disable-assembly"
         end
    -    args << "--without-x"
    +    args << "--with-x11"
         args << "--disable-haptic" << "--disable-joystick" if MacOS.version <= :snow_leopard
    
         system "./configure", *args
    d