Skip to content

Commit 807c0b0

Browse files
committed
waffle: Add support for non-linux platforms
Waffle works perfectly well on macOS and Windows. Because the meson options do proper dependency checking already, we can just leave them out. This has the additional benefit of allowing gbm, surfaceless_egl and x11_egl supoort to be built on Linux, which are useful in conjunction with the piglit test suite.
1 parent fd4e4bd commit 807c0b0

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

pkgs/development/libraries/waffle/default.nix

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@
44
, meson
55
, ninja
66
, libGL
7-
, libglvnd
7+
, libglvnd ? null
88
, makeWrapper
99
, pkg-config
10-
, wayland
11-
, libxcb
12-
, libX11
1310
, python3
11+
, x11Support ? true, libxcb ? null, libX11 ? null
12+
, waylandSupport ? true, wayland ? null
13+
, useGbm ? true, mesa ? null, libudev ? null
1414
}:
1515

16+
assert x11Support -> (libxcb != null && libX11 != null);
17+
assert waylandSupport -> wayland != null;
18+
assert useGbm -> (mesa != null && libudev != null);
19+
assert with stdenv.hostPlatform; isUnix && !isDarwin -> libglvnd != null;
20+
1621
stdenv.mkDerivation rec {
1722
pname = "waffle";
1823
version = "1.6.1";
@@ -27,10 +32,16 @@ stdenv.mkDerivation rec {
2732

2833
buildInputs = [
2934
libGL
35+
] ++ stdenv.lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [
3036
libglvnd
37+
] ++ stdenv.lib.optionals x11Support [
3138
libX11
3239
libxcb
40+
] ++ stdenv.lib.optionals waylandSupport [
3341
wayland
42+
] ++ stdenv.lib.optionals useGbm [
43+
mesa
44+
libudev
3445
];
3546

3647
nativeBuildInputs = [
@@ -41,10 +52,6 @@ stdenv.mkDerivation rec {
4152
python3
4253
];
4354

44-
mesonFlags = [
45-
"-Dgbm=disabled"
46-
];
47-
4855
postInstall = ''
4956
wrapProgram $out/bin/wflinfo \
5057
--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ libGL libglvnd ]}

0 commit comments

Comments
 (0)