From fd4e4bd8bee303ac4756f806ec910f426fd5c447 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 22 Dec 2020 14:10:01 -0800 Subject: [PATCH 1/2] waffle: Use meson instead of cmake The cmake build system is deprecated upstream. --- pkgs/development/libraries/waffle/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/waffle/default.nix b/pkgs/development/libraries/waffle/default.nix index 66a1b7ab1450..aa59bf6fb9e8 100644 --- a/pkgs/development/libraries/waffle/default.nix +++ b/pkgs/development/libraries/waffle/default.nix @@ -1,7 +1,8 @@ { stdenv , fetchFromGitLab , lib -, cmake +, meson +, ninja , libGL , libglvnd , makeWrapper @@ -9,6 +10,7 @@ , wayland , libxcb , libX11 +, python3 }: stdenv.mkDerivation rec { @@ -32,12 +34,16 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ - cmake + meson + ninja makeWrapper pkg-config + python3 ]; - cmakeFlags = [ "-Dplatforms=x11,wayland" ]; + mesonFlags = [ + "-Dgbm=disabled" + ]; postInstall = '' wrapProgram $out/bin/wflinfo \ From 807c0b0df59b597ed3682a06be00eb058b03bdb2 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 22 Dec 2020 15:01:27 -0800 Subject: [PATCH 2/2] 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. --- pkgs/development/libraries/waffle/default.nix | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/waffle/default.nix b/pkgs/development/libraries/waffle/default.nix index aa59bf6fb9e8..0f1e36b35795 100644 --- a/pkgs/development/libraries/waffle/default.nix +++ b/pkgs/development/libraries/waffle/default.nix @@ -4,15 +4,20 @@ , meson , ninja , libGL -, libglvnd +, libglvnd ? null , makeWrapper , pkg-config -, wayland -, libxcb -, libX11 , python3 +, x11Support ? true, libxcb ? null, libX11 ? null +, waylandSupport ? true, wayland ? null +, useGbm ? true, mesa ? null, libudev ? null }: +assert x11Support -> (libxcb != null && libX11 != null); +assert waylandSupport -> wayland != null; +assert useGbm -> (mesa != null && libudev != null); +assert with stdenv.hostPlatform; isUnix && !isDarwin -> libglvnd != null; + stdenv.mkDerivation rec { pname = "waffle"; version = "1.6.1"; @@ -27,10 +32,16 @@ stdenv.mkDerivation rec { buildInputs = [ libGL + ] ++ stdenv.lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [ libglvnd + ] ++ stdenv.lib.optionals x11Support [ libX11 libxcb + ] ++ stdenv.lib.optionals waylandSupport [ wayland + ] ++ stdenv.lib.optionals useGbm [ + mesa + libudev ]; nativeBuildInputs = [ @@ -41,10 +52,6 @@ stdenv.mkDerivation rec { python3 ]; - mesonFlags = [ - "-Dgbm=disabled" - ]; - postInstall = '' wrapProgram $out/bin/wflinfo \ --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ libGL libglvnd ]}