2022-12-09 16:16:31 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch
|
|
|
|
, freeglut, glew, libGL, libGLU, libX11, libXext, mesa
|
2022-07-11 11:48:41 +00:00
|
|
|
, meson, ninja, pkg-config, wayland, wayland-protocols }:
|
2020-04-17 19:00:48 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mesa-demos";
|
2022-07-11 11:48:41 +00:00
|
|
|
version = "8.5.0";
|
2020-04-17 19:00:48 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-07-11 11:48:41 +00:00
|
|
|
url = "https://archive.mesa3d.org/demos/${version}/${pname}-${version}.tar.bz2";
|
|
|
|
sha256 = "sha256-zqLfCoDwmjD2NcTrGmcr+Qxd3uC4539NcAQWaO9xqsE=";
|
2020-04-17 19:00:48 +00:00
|
|
|
};
|
|
|
|
|
2022-07-11 11:48:41 +00:00
|
|
|
patches = [
|
|
|
|
# https://gitlab.freedesktop.org/mesa/demos/-/merge_requests/83
|
|
|
|
./demos-data-dir.patch
|
2022-12-09 16:16:31 +00:00
|
|
|
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://gitlab.freedesktop.org/mesa/demos/-/commit/b6d183f9943a275990aef7f08773e54c597572e5.patch";
|
|
|
|
sha256 = "4UdV+cxvNRqoT+Pdy0gkCPXJbhFr6CSCw/UOOB+rvuw=";
|
|
|
|
})
|
2022-07-11 11:48:41 +00:00
|
|
|
];
|
2020-04-17 19:00:48 +00:00
|
|
|
|
2022-07-11 11:48:41 +00:00
|
|
|
buildInputs = [
|
2022-12-09 16:16:31 +00:00
|
|
|
freeglut glew libX11 libXext libGL libGLU mesa wayland
|
2022-07-11 11:48:41 +00:00
|
|
|
wayland-protocols
|
2022-12-09 16:16:31 +00:00
|
|
|
] ++ lib.optional (mesa ? osmesa) mesa.osmesa ;
|
2022-07-11 11:48:41 +00:00
|
|
|
nativeBuildInputs = [ meson ninja pkg-config ];
|
|
|
|
|
2022-12-09 16:16:31 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Degl=${if stdenv.isDarwin then "disabled" else "auto"}"
|
|
|
|
"-Dlibdrm=${if mesa.libdrm == null then "disabled" else "enabled"}"
|
|
|
|
"-Dosmesa=${if mesa ? osmesa then "enabled" else "disabled"}"
|
|
|
|
"-Dwayland=${if wayland.withLibraries then "enabled" else "disabled"}"
|
|
|
|
"-Dwith-system-data-files=true"
|
|
|
|
];
|
2020-04-17 19:00:48 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-12-09 16:16:31 +00:00
|
|
|
inherit (mesa.meta) homepage platforms;
|
2020-04-17 19:00:48 +00:00
|
|
|
description = "Collection of demos and test programs for OpenGL and Mesa";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ andersk ];
|
|
|
|
};
|
|
|
|
}
|