diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 63212903cab3..215ee46e47c7 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, intltool, flex, bison, autoreconfHook +{ stdenv, fetchurl, pkgconfig, intltool, flex, bison, autoreconfHook, substituteAll , python, libxml2Python, file, expat, makedepend , libdrm, xorg, wayland, udev, llvm, libffi , libvdpau, libelf @@ -45,7 +45,11 @@ stdenv.mkDerivation { ./glx_ro_text_segm.patch # fix for grsecurity/PaX # TODO: revive ./dricore-gallium.patch when it gets ported (from Ubuntu), # as it saved ~35 MB in $drivers; watch https://launchpad.net/ubuntu/+source/mesa/+changelog - ]; + ] ++ optional stdenv.isLinux + (substituteAll { + src = ./dlopen-absolute-paths.diff; + inherit udev; + }); # Change the search path for EGL drivers from $drivers/* to driverLink postPatch = '' diff --git a/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff b/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff new file mode 100644 index 000000000000..2b239e760ba3 --- /dev/null +++ b/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff @@ -0,0 +1,13 @@ +diff --git a/src/loader/loader.c b/src/loader/loader.c +index 666d015..4d7a9be 100644 +--- a/src/loader/loader.c ++++ b/src/loader/loader.c +@@ -101,7 +101,7 @@ static void * + udev_dlopen_handle(void) + { + if (!udev_handle) { +- udev_handle = dlopen("libudev.so.1", RTLD_LOCAL | RTLD_LAZY); ++ udev_handle = dlopen("@udev@/lib/libudev.so.1", RTLD_LOCAL | RTLD_LAZY); + + if (!udev_handle) { + /* libudev.so.1 changed the return types of the two unref functions