nixpkgs/pkgs/development/libraries/waffle/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.5 KiB
Nix
Raw Normal View History

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