2020-11-06 00:33:48 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, lib
|
2021-05-03 20:48:10 +00:00
|
|
|
, cmake
|
2020-12-25 13:55:36 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
2021-05-03 20:48:10 +00:00
|
|
|
, bash-completion
|
2020-11-06 00:33:48 +00:00
|
|
|
, libGL
|
2021-05-03 20:48:10 +00:00
|
|
|
, libglvnd
|
2020-11-06 00:33:48 +00:00
|
|
|
, makeWrapper
|
|
|
|
, pkg-config
|
2020-12-25 13:55:36 +00:00
|
|
|
, python3
|
2021-05-03 20:48:10 +00:00
|
|
|
, x11Support ? true, libxcb, libX11
|
2024-09-19 14:19:46 +00:00
|
|
|
, waylandSupport ? true, wayland, wayland-protocols, wayland-scanner
|
2021-05-03 20:48:10 +00:00
|
|
|
, useGbm ? true, mesa, udev
|
2020-11-06 00:33:48 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "waffle";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.8.1";
|
2020-11-06 00:33:48 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "mesa";
|
|
|
|
repo = "waffle";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
sha256 = "sha256-Y7GRYLqSO572qA1eZ3jS8QlZ1X9xKpDtScaySTuPK/U=";
|
2020-11-06 00:33:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-05-03 20:48:10 +00:00
|
|
|
bash-completion
|
2020-11-06 00:33:48 +00:00
|
|
|
libGL
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [
|
2020-11-06 00:33:48 +00:00
|
|
|
libglvnd
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals x11Support [
|
2020-11-06 00:33:48 +00:00
|
|
|
libX11
|
|
|
|
libxcb
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals waylandSupport [
|
2020-11-06 00:33:48 +00:00
|
|
|
wayland
|
2021-05-03 20:48:10 +00:00
|
|
|
wayland-protocols
|
2021-02-05 17:12:51 +00:00
|
|
|
] ++ lib.optionals useGbm [
|
2021-05-03 20:48:10 +00:00
|
|
|
udev
|
2020-12-25 13:55:36 +00:00
|
|
|
mesa
|
2020-11-06 00:33:48 +00:00
|
|
|
];
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
depsBuildBuild = [ pkg-config ];
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
nativeBuildInputs = [
|
2021-05-03 20:48:10 +00:00
|
|
|
cmake
|
|
|
|
makeWrapper
|
2020-12-25 13:55:36 +00:00
|
|
|
meson
|
|
|
|
ninja
|
2020-11-06 00:33:48 +00:00
|
|
|
pkg-config
|
2020-12-25 13:55:36 +00:00
|
|
|
python3
|
2024-09-19 14:19:46 +00:00
|
|
|
] ++ lib.optionals waylandSupport [
|
|
|
|
wayland-scanner
|
2020-11-06 00:33:48 +00:00
|
|
|
];
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR= "${placeholder "out"}/share/bash-completion/completions";
|
|
|
|
|
2020-11-06 00:33:48 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/wflinfo \
|
2021-02-05 17:12:51 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL libglvnd ]}
|
2020-11-06 00:33:48 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Cross-platform C library that allows one to defer selection of an OpenGL API and window system until runtime";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "wflinfo";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://www.waffle-gl.org/";
|
2020-11-06 00:33:48 +00:00
|
|
|
license = licenses.bsd2;
|
2024-09-19 14:19:46 +00:00
|
|
|
inherit (mesa.meta) platforms;
|
2020-11-06 00:33:48 +00:00
|
|
|
maintainers = with maintainers; [ Flakebi ];
|
|
|
|
};
|
|
|
|
}
|