Merge pull request #107429 from dcbaker/wip/2020-12/waffle-use-meson

Cleanups for waffle
This commit is contained in:
John Ericson 2020-12-22 18:56:19 -05:00 committed by GitHub
commit 2d2629f7d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,16 +1,23 @@
{ stdenv { stdenv
, fetchFromGitLab , fetchFromGitLab
, lib , lib
, cmake , meson
, ninja
, libGL , libGL
, libglvnd , libglvnd ? null
, makeWrapper , makeWrapper
, pkg-config , pkg-config
, wayland , python3
, libxcb , x11Support ? true, libxcb ? null, libX11 ? null
, libX11 , 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 { stdenv.mkDerivation rec {
pname = "waffle"; pname = "waffle";
version = "1.6.1"; version = "1.6.1";
@ -25,20 +32,26 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
libGL libGL
] ++ stdenv.lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [
libglvnd libglvnd
] ++ stdenv.lib.optionals x11Support [
libX11 libX11
libxcb libxcb
] ++ stdenv.lib.optionals waylandSupport [
wayland wayland
] ++ stdenv.lib.optionals useGbm [
mesa
libudev
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
cmake meson
ninja
makeWrapper makeWrapper
pkg-config pkg-config
python3
]; ];
cmakeFlags = [ "-Dplatforms=x11,wayland" ];
postInstall = '' postInstall = ''
wrapProgram $out/bin/wflinfo \ wrapProgram $out/bin/wflinfo \
--prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ libGL libglvnd ]} --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ libGL libglvnd ]}