nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 pkg-config,
6 meson,
7 ninja,
8 wayland-scanner,
9 python3,
10 wayland,
11 gitUpdater,
12 testers,
13}:
14
15stdenv.mkDerivation (finalAttrs: {
16 pname = "wayland-protocols";
17 version = "1.47";
18
19 doCheck =
20 stdenv.hostPlatform == stdenv.buildPlatform
21 &&
22 # https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/48
23 stdenv.hostPlatform.linker == "bfd"
24 &&
25 # Even with bfd linker, the above issue occurs on platforms with stricter linker requirements
26 # https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/48#note_1453201
27 !(stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isBigEndian)
28 && lib.meta.availableOn stdenv.hostPlatform wayland;
29
30 src = fetchurl {
31 url = "https://gitlab.freedesktop.org/wayland/${finalAttrs.pname}/-/releases/${finalAttrs.version}/downloads/${finalAttrs.pname}-${finalAttrs.version}.tar.xz";
32 hash = "sha256-X9Q0m8vJurmkb4z3fR9DQpanoFLIdECglPY/z2KljiA=";
33 };
34
35 postPatch = lib.optionalString finalAttrs.finalPackage.doCheck ''
36 patchShebangs tests/
37 '';
38
39 depsBuildBuild = [ pkg-config ];
40 nativeBuildInputs = [
41 meson
42 ninja
43 wayland-scanner
44 ];
45 nativeCheckInputs = [
46 python3
47 wayland
48 ];
49 checkInputs = [ wayland ];
50 strictDeps = true;
51
52 mesonFlags = [ "-Dtests=${lib.boolToString finalAttrs.finalPackage.doCheck}" ];
53
54 meta = {
55 description = "Wayland protocol extensions";
56 longDescription = ''
57 wayland-protocols contains Wayland protocols that add functionality not
58 available in the Wayland core protocol. Such protocols either add
59 completely new functionality, or extend the functionality of some other
60 protocol either in Wayland core, or some other protocol in
61 wayland-protocols.
62 '';
63 homepage = "https://gitlab.freedesktop.org/wayland/wayland-protocols";
64 license = lib.licenses.mit; # Expat version
65 platforms = lib.platforms.all;
66 maintainers = with lib.maintainers; [ wineee ];
67 pkgConfigModules = [ "wayland-protocols" ];
68 };
69
70 passthru.updateScript = gitUpdater {
71 url = "https://gitlab.freedesktop.org/wayland/wayland-protocols.git";
72 };
73 passthru.version = finalAttrs.version;
74 passthru.tests.pkg-config = testers.hasPkgConfigModules {
75 package = finalAttrs.finalPackage;
76 };
77})