From e4dc3f8ae3665f005b241edee76bfbcde7c1b1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 10 Jun 2014 12:42:48 +0200 Subject: [PATCH] mesa: fix libGL searching for libudev Close #2784, #2731. I don't have a clue if using our libudev is always correct on non-nixos, or if using /run/current-system/sw/lib/libudev would be better... --- pkgs/development/libraries/mesa/default.nix | 8 ++++++-- .../libraries/mesa/dlopen-absolute-paths.diff | 13 +++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/mesa/dlopen-absolute-paths.diff 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