2020-10-28 10:16:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, lib
|
2020-12-22 22:10:01 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
2020-10-28 10:16:22 +00:00
|
|
|
, libGL
|
2020-12-22 23:01:27 +00:00
|
|
|
, libglvnd ? null
|
2020-10-28 10:16:22 +00:00
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
2020-12-22 22:10:01 +00:00
|
|
|
, python3
|
2020-12-22 23:01:27 +00:00
|
|
|
, x11Support ? true, libxcb ? null, libX11 ? null
|
|
|
|
, waylandSupport ? true, wayland ? null
|
|
|
|
, useGbm ? true, mesa ? null, libudev ? null
|
2020-10-28 10:16:22 +00:00
|
|
|
}:
|
|
|
|
|
2020-12-22 23:01:27 +00:00
|
|
|
assert x11Support -> (libxcb != null && libX11 != null);
|
|
|
|
assert waylandSupport -> wayland != null;
|
|
|
|
assert useGbm -> (mesa != null && libudev != null);
|
|
|
|
assert with stdenv.hostPlatform; isUnix && !isDarwin -> libglvnd != null;
|
|
|
|
|
2020-10-28 10:16:22 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "waffle";
|
|
|
|
version = "1.6.1";
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "mesa";
|
|
|
|
repo = "waffle";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0s8gislmhccfa04zsj1yqk97lscbbnmxirr2zm4q3p8ybmpfhpqr";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libGL
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [
|
2020-10-28 10:16:22 +00:00
|
|
|
libglvnd
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals x11Support [
|
2020-10-28 10:16:22 +00:00
|
|
|
libX11
|
|
|
|
libxcb
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals waylandSupport [
|
2020-10-28 10:16:22 +00:00
|
|
|
wayland
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals useGbm [
|
2020-12-22 23:01:27 +00:00
|
|
|
mesa
|
|
|
|
libudev
|
2020-10-28 10:16:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2020-12-22 22:10:01 +00:00
|
|
|
meson
|
|
|
|
ninja
|
2020-10-28 10:16:22 +00:00
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
2020-12-22 22:10:01 +00:00
|
|
|
python3
|
2020-10-28 10:16:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/wflinfo \
|
2021-01-21 17:00:13 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL libglvnd ]}
|
2020-10-28 10:16:22 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A cross-platform C library that allows one to defer selection of an OpenGL API and window system until runtime";
|
|
|
|
homepage = "http://www.waffle-gl.org/";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = platforms.mesaPlatforms;
|
|
|
|
maintainers = with maintainers; [ Flakebi ];
|
|
|
|
};
|
|
|
|
}
|