2015-08-14 00:00:18 +02:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, utilmacros, python
|
2018-03-10 15:41:34 +01:00
|
|
|
, libGL, libX11
|
2014-07-27 12:14:38 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "epoxy-${version}";
|
2018-03-02 00:26:09 +01:00
|
|
|
version = "1.5.0";
|
2014-07-27 12:14:38 +02:00
|
|
|
|
2015-08-14 00:00:18 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "anholt";
|
|
|
|
repo = "libepoxy";
|
2018-03-02 00:26:09 +01:00
|
|
|
rev = "${version}";
|
|
|
|
sha256 = "1ixpqb10pmdy3n9nxd5inflig9dal5502ggadcns5b58j6jr0yv0";
|
2014-07-27 12:14:38 +02:00
|
|
|
};
|
|
|
|
|
2016-08-29 02:30:01 +02:00
|
|
|
outputs = [ "out" "dev" ];
|
2015-10-07 22:52:16 +02:00
|
|
|
|
2015-08-14 00:00:18 +02:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig utilmacros python ];
|
2018-03-10 15:41:34 +01:00
|
|
|
buildInputs = [ libGL libX11 ];
|
2014-07-27 12:14:38 +02:00
|
|
|
|
2015-10-27 08:38:00 +01:00
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2018-03-10 15:41:34 +01:00
|
|
|
# add libGL to rpath because libepoxy dlopen()s libEGL
|
2018-02-22 09:52:28 +01:00
|
|
|
postFixup = ''
|
2018-03-10 15:41:34 +01:00
|
|
|
patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ libGL ]}:$(patchelf --print-rpath $out/lib/libepoxy.so.0.0.0)" $out/lib/libepoxy.so.0.0.0
|
2018-02-22 09:52:28 +01:00
|
|
|
'';
|
|
|
|
|
2014-07-27 12:14:38 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A library for handling OpenGL function pointer management";
|
|
|
|
homepage = https://github.com/anholt/libepoxy;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.goibhniu ];
|
2015-05-23 02:04:06 +02:00
|
|
|
platforms = platforms.unix;
|
2014-07-27 12:14:38 +02:00
|
|
|
};
|
|
|
|
}
|