[Nix-dev] dlopen and mesa-likes

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Fri Aug 8 23:18:45 CEST 2014


Hi,

I have some software here that I'm trying to package. At first it all
went smooth but then it didn't run. It was narrowed down to the use of
dlopen in the source files. So currently I have something like this.

  preConfigure = ''
    sed -i "s at libX11.so@${libX11}/lib/libX11.so at g" src/backend/x11.c
    sed -i "s at libX11-xcb.so@${libX11}/lib/libX11-xcb.so at g" src/backend/x11.c
    sed -i "s at libxcb.so@${libxcb}/lib/libxcb.so at g" src/backend/x11.c
    #sed -i "s at libEGL.so@${mesa}/lib/libEGL.so at g" src/context/egl.c
    #sed -i "s at libGLESv2.so@${mesa}/lib/libGLESv2.so at g" src/render/gles2.c
  '';

Now, the upstream should probably provide configure flags for these
things and I spoke with the developer already but my problem is
elsewhere: you'll notice I commented out the last 2 lines. The reason is
that I'm running nVidia binary blob and I have no idea how to handle it
from here. Even if there were flags for each of these things to specify
the path ourselves, what would I pass it? How do I get the path of
<whatever-user-is-running>/lib/libEGL.so to substitute in? What is the
correct solution? Even if I wanted a hacky-works-for-me solution for
now, what would I specify as a dependency if I'm running the blob? There
is something called nvidia_x11 but that's scoped under the kernel
modules in all-packages.nix and I can't refer to it and again, that
would only work for me and not someone running other driver.

There is one other thread about dlopen on NixOS but it does not talk
about this specific issue. The NixOS manual has a mention of dlopen in
OpenGL context but mesa is used there: it's only for sake of example there.

Thanks

-- 
Mateusz K.


More information about the nix-dev mailing list