about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/wayland
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/wayland')
-rw-r--r--nixpkgs/pkgs/development/libraries/wayland/protocols.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/development/libraries/wayland/protocols.nix b/nixpkgs/pkgs/development/libraries/wayland/protocols.nix
index 8a2b05aa4dff..7f3ec5f3d597 100644
--- a/nixpkgs/pkgs/development/libraries/wayland/protocols.nix
+++ b/nixpkgs/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";