summary refs log tree commit diff
path: root/pkgs/development/libraries/epoxy
diff options
context:
space:
mode:
authorxeji <xeji@cat3.de>2018-02-22 09:52:28 +0100
committerxeji <xeji@cat3.de>2018-02-23 10:38:34 +0100
commita7a0d78f1c6d1d24bc6aa9001f7622191914e649 (patch)
tree429e99fcc31279d3a2e4ee1fd37abda51cb56cb7 /pkgs/development/libraries/epoxy
parent8d490ca9934d0c01e1e9ade455657e54e2e843c0 (diff)
downloadnixpkgs-a7a0d78f1c6d1d24bc6aa9001f7622191914e649.tar
nixpkgs-a7a0d78f1c6d1d24bc6aa9001f7622191914e649.tar.gz
nixpkgs-a7a0d78f1c6d1d24bc6aa9001f7622191914e649.tar.bz2
nixpkgs-a7a0d78f1c6d1d24bc6aa9001f7622191914e649.tar.lz
nixpkgs-a7a0d78f1c6d1d24bc6aa9001f7622191914e649.tar.xz
nixpkgs-a7a0d78f1c6d1d24bc6aa9001f7622191914e649.tar.zst
nixpkgs-a7a0d78f1c6d1d24bc6aa9001f7622191914e649.zip
epoxy: add mesa to libepoxy runpath as fallback
- libepoxy dlopen()s libEGL / libGL but didn't have mesa in its runpath
  -> error unless lib is already open or in LD_LIBRARY_PATH
- change dependency from mesa (should be avoided) to mesa_nonglu
Diffstat (limited to 'pkgs/development/libraries/epoxy')
-rw-r--r--pkgs/development/libraries/epoxy/default.nix9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/development/libraries/epoxy/default.nix b/pkgs/development/libraries/epoxy/default.nix
index 18ce05af07a..c3cc5b2cd06 100644
--- a/pkgs/development/libraries/epoxy/default.nix
+++ b/pkgs/development/libraries/epoxy/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, utilmacros, python
-, mesa, libX11
+, mesa_noglu, libX11
 }:
 
 stdenv.mkDerivation rec {
@@ -16,13 +16,18 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   nativeBuildInputs = [ autoreconfHook pkgconfig utilmacros python ];
-  buildInputs = [ mesa libX11 ];
+  buildInputs = [ mesa_noglu libX11 ];
 
   preConfigure = stdenv.lib.optional stdenv.isDarwin ''
     substituteInPlace configure --replace build_glx=no build_glx=yes
     substituteInPlace src/dispatch_common.h --replace "PLATFORM_HAS_GLX 0" "PLATFORM_HAS_GLX 1"
   '';
 
+  # add mesa_nonglu to rpath because libepoxy dlopen()s libEGL
+  postFixup = ''
+    patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ mesa_noglu ]}:$(patchelf --print-rpath $out/lib/libepoxy.so.0.0.0)" $out/lib/libepoxy.so.0.0.0
+  '';
+
   meta = with stdenv.lib; {
     description = "A library for handling OpenGL function pointer management";
     homepage = https://github.com/anholt/libepoxy;