2020-10-28 11:16:22 +01:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, lib
|
2021-03-23 13:15:15 +01:00
|
|
|
, cmake
|
2020-12-22 23:10:01 +01:00
|
|
|
, meson
|
|
|
|
, ninja
|
2021-03-23 13:15:15 +01:00
|
|
|
, bash-completion
|
2020-10-28 11:16:22 +01:00
|
|
|
, libGL
|
2021-03-23 13:15:15 +01:00
|
|
|
, libglvnd
|
2020-10-28 11:16:22 +01:00
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
2020-12-22 23:10:01 +01:00
|
|
|
, python3
|
2021-03-23 13:15:15 +01:00
|
|
|
, x11Support ? true, libxcb, libX11
|
|
|
|
, waylandSupport ? true, wayland, wayland-protocols
|
|
|
|
, useGbm ? true, mesa, udev
|
2020-10-28 11:16:22 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "waffle";
|
2021-03-23 13:15:15 +01:00
|
|
|
version = "1.7.0";
|
2020-10-28 11:16:22 +01:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "mesa";
|
|
|
|
repo = "waffle";
|
|
|
|
rev = "v${version}";
|
2021-03-23 13:15:15 +01:00
|
|
|
sha256 = "iY+dAgXutD/uDFocwd9QXjq502IOsk+3RQMA2S/CMV4=";
|
2020-10-28 11:16:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-03-23 13:15:15 +01:00
|
|
|
bash-completion
|
2020-10-28 11:16:22 +01:00
|
|
|
libGL
|
2021-01-21 18:00:13 +01:00
|
|
|
] ++ lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [
|
2020-10-28 11:16:22 +01:00
|
|
|
libglvnd
|
2021-01-21 18:00:13 +01:00
|
|
|
] ++ lib.optionals x11Support [
|
2020-10-28 11:16:22 +01:00
|
|
|
libX11
|
|
|
|
libxcb
|
2021-01-21 18:00:13 +01:00
|
|
|
] ++ lib.optionals waylandSupport [
|
2020-10-28 11:16:22 +01:00
|
|
|
wayland
|
2021-03-23 13:15:15 +01:00
|
|
|
wayland-protocols
|
2021-01-21 18:00:13 +01:00
|
|
|
] ++ lib.optionals useGbm [
|
2021-03-23 13:15:15 +01:00
|
|
|
udev
|
2020-12-23 00:01:27 +01:00
|
|
|
mesa
|
2020-10-28 11:16:22 +01:00
|
|
|
];
|
|
|
|
|
2021-03-23 13:15:15 +01:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2020-10-28 11:16:22 +01:00
|
|
|
nativeBuildInputs = [
|
2021-03-23 13:15:15 +01:00
|
|
|
cmake
|
|
|
|
makeWrapper
|
2020-12-22 23:10:01 +01:00
|
|
|
meson
|
|
|
|
ninja
|
2020-10-28 11:16:22 +01:00
|
|
|
pkg-config
|
2020-12-22 23:10:01 +01:00
|
|
|
python3
|
2020-10-28 11:16:22 +01:00
|
|
|
];
|
|
|
|
|
2021-03-23 13:15:15 +01:00
|
|
|
PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR= "${placeholder "out"}/share/bash-completion/completions";
|
|
|
|
|
2020-10-28 11:16:22 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/wflinfo \
|
2021-01-21 18:00:13 +01:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL libglvnd ]}
|
2020-10-28 11:16:22 +01: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 ];
|
|
|
|
};
|
|
|
|
}
|