2021-11-08 07:28:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, utilmacros
|
|
|
|
, python3
|
|
|
|
, libGL
|
|
|
|
, libX11
|
2014-07-27 11:14:38 +01:00
|
|
|
}:
|
|
|
|
|
2021-11-08 07:28:18 +00:00
|
|
|
let
|
|
|
|
inherit (lib) getLib optional optionalString;
|
2018-03-18 12:34:11 +00:00
|
|
|
|
2021-11-08 07:28:18 +00:00
|
|
|
in
|
2014-07-27 11:14:38 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-11-11 04:35:34 +00:00
|
|
|
pname = "libepoxy";
|
2021-11-08 07:28:18 +00:00
|
|
|
version = "1.5.9";
|
2014-07-27 11:14:38 +01:00
|
|
|
|
2015-08-13 23:00:18 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "anholt";
|
2021-11-11 04:35:34 +00:00
|
|
|
repo = pname;
|
2019-09-09 00:38:31 +01:00
|
|
|
rev = version;
|
2021-11-08 07:28:18 +00:00
|
|
|
sha256 = "sha256-8rdmC8FZUkKkEvWPJIdfrBQHiwa81vl5tmVqRdU4UIY=";
|
2014-07-27 11:14:38 +01:00
|
|
|
};
|
|
|
|
|
2021-11-08 07:28:18 +00:00
|
|
|
patches = [ ./libgl-path.patch ];
|
2014-07-27 11:14:38 +01:00
|
|
|
|
2021-11-08 07:28:18 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs src/*.py
|
|
|
|
''
|
|
|
|
+ optionalString stdenv.isDarwin ''
|
2015-10-27 07:38:00 +00:00
|
|
|
substituteInPlace src/dispatch_common.h --replace "PLATFORM_HAS_GLX 0" "PLATFORM_HAS_GLX 1"
|
|
|
|
'';
|
|
|
|
|
2021-11-08 07:28:18 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ meson ninja pkg-config utilmacros python3 ];
|
|
|
|
|
|
|
|
buildInputs = [ libGL libX11 ];
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Dtests=${if doCheck then "true" else "false"}"
|
|
|
|
]
|
|
|
|
++ optional stdenv.isDarwin "-Dglx=yes";
|
2018-03-29 13:47:07 +01:00
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = ''-DLIBGL_PATH="${getLib libGL}/lib"'';
|
2018-02-22 08:52:28 +00:00
|
|
|
|
2021-11-08 07:28:18 +00:00
|
|
|
# tests are running from version 1.5.9
|
|
|
|
doCheck = true;
|
2018-04-25 04:20:18 +01:00
|
|
|
|
2021-11-08 07:28:18 +00:00
|
|
|
meta = with lib; {
|
2014-07-27 11:14:38 +01:00
|
|
|
description = "A library for handling OpenGL function pointer management";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/anholt/libepoxy";
|
2014-07-27 11:14:38 +01:00
|
|
|
license = licenses.mit;
|
2021-11-11 04:43:50 +00:00
|
|
|
maintainers = with maintainers; [ goibhniu erictapen ];
|
2015-05-23 01:04:06 +01:00
|
|
|
platforms = platforms.unix;
|
2014-07-27 11:14:38 +01:00
|
|
|
};
|
|
|
|
}
|