From a893df3f9fd1bb39a4a9f084debd19d89db35e23 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Fri, 30 Apr 2021 21:56:18 +0200 Subject: [PATCH] wayland-protocols: Switch to Meson According to diffoscope this is fine (only the Nix store path changes). Cross-compilation with doCheck=true is broken (requires pkg-config in nativeBuildInputs but doesn't play nicely with checkInputs). --- .../libraries/wayland/protocols.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/wayland/protocols.nix b/pkgs/development/libraries/wayland/protocols.nix index 8a2b05aa4dff..7f3ec5f3d597 100644 --- a/pkgs/development/libraries/wayland/protocols.nix +++ b/pkgs/development/libraries/wayland/protocols.nix @@ -1,15 +1,29 @@ -{ lib, stdenv, fetchurl, wayland-scanner }: +{ lib, stdenv, fetchurl +, pkg-config +, meson, ninja, wayland-scanner +, python3, wayland +}: stdenv.mkDerivation rec { pname = "wayland-protocols"; version = "1.21"; + doCheck = stdenv.hostPlatform == stdenv.buildPlatform; + src = fetchurl { url = "https://wayland.freedesktop.org/releases/${pname}-${version}.tar.xz"; sha256 = "1rfdlkzz67qsb955zqb8jbw3m22pl6ppvrvfq8bqiqcb5n24b6dr"; }; - nativeBuildInputs = [ wayland-scanner ]; + postPatch = lib.optionalString doCheck '' + patchShebangs tests/ + ''; + + depsBuildBuild = [ pkg-config ]; + nativeBuildInputs = [ meson ninja wayland-scanner ]; + checkInputs = [ python3 wayland ]; + + mesonFlags = [ "-Dtests=${lib.boolToString doCheck}" ]; meta = { description = "Wayland protocol extensions";