Merge #205327: mesa-demos: fix build on Darwin

...into staging
This commit is contained in:
Vladimír Čunát 2022-12-31 10:55:22 +01:00
commit 4237877304
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA
5 changed files with 29 additions and 14 deletions

View file

@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
the Mesa drivers, the X drivers, libva and similar projects.
'';
license = licenses.mit;
platforms = platforms.unix;
platforms = lib.subtractLists platforms.darwin platforms.unix;
maintainers = with maintainers; [ primeos ];
};
}

View file

@ -44,6 +44,8 @@ let
version = "22.3.1";
branch = versions.major version;
withLibdrm = lib.meta.availableOn stdenv.hostPlatform libdrm;
rust-bindgen' = rust-bindgen.override {
rust-bindgen-unwrapped = rust-bindgen.unwrapped.override {
clang = llvmPackages.clang;
@ -164,7 +166,7 @@ self = stdenv.mkDerivation {
propagatedBuildInputs = with xorg; [
libXdamage libXxf86vm
] ++ optional stdenv.isLinux libdrm
] ++ optional withLibdrm libdrm
++ optionals stdenv.isDarwin [ OpenGL Xplugin ];
doCheck = false;
@ -256,10 +258,11 @@ self = stdenv.mkDerivation {
];
passthru = {
inherit libdrm;
inherit (libglvnd) driverLink;
inherit llvmPackages;
libdrm = if withLibdrm then libdrm else null;
tests = lib.optionalAttrs stdenv.isLinux {
devDoesNotDependOnLLVM = stdenv.mkDerivation {
name = "mesa-dev-does-not-depend-on-llvm";

View file

@ -48,8 +48,9 @@ stdenv.mkDerivation rec {
separateDebugInfo = true;
mesonFlags = [
"-Dlibraries=${lib.boolToString withLibraries}"
"-Ddocumentation=${lib.boolToString withDocumentation}"
"-Dlibraries=${lib.boolToString withLibraries}"
"-Dtests=${lib.boolToString withLibraries}"
];
depsBuildBuild = [
@ -95,6 +96,8 @@ stdenv.mkDerivation rec {
EOF
'';
passthru = { inherit withLibraries; };
meta = with lib; {
description = "Core Wayland window system code and protocol";
longDescription = ''
@ -109,8 +112,6 @@ stdenv.mkDerivation rec {
license = licenses.mit; # Expat version
platforms = if withLibraries then platforms.linux else platforms.unix;
maintainers = with maintainers; [ primeos codyopel qyliss ];
# big sur doesn't support gcc stdenv and wayland doesn't build with clang
broken = stdenv.isDarwin;
};
passthru.version = version;

View file

@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
pname = "wayland-protocols";
version = "1.31";
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
doCheck = stdenv.hostPlatform == stdenv.buildPlatform && wayland.withLibraries;
src = fetchurl {
url = "https://gitlab.freedesktop.org/wayland/${pname}/-/releases/${version}/downloads/${pname}-${version}.tar.xz";
@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
'';
homepage = "https://gitlab.freedesktop.org/wayland/wayland-protocols";
license = lib.licenses.mit; # Expat version
platforms = lib.platforms.linux;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ primeos ];
};

View file

@ -1,4 +1,5 @@
{ lib, stdenv, fetchurl, freeglut, glew, libGL, libGLU, libX11, libXext, mesa
{ lib, stdenv, fetchurl, fetchpatch
, freeglut, glew, libGL, libGLU, libX11, libXext, mesa
, meson, ninja, pkg-config, wayland, wayland-protocols }:
stdenv.mkDerivation rec {
@ -13,21 +14,31 @@ stdenv.mkDerivation rec {
patches = [
# https://gitlab.freedesktop.org/mesa/demos/-/merge_requests/83
./demos-data-dir.patch
(fetchpatch {
url = "https://gitlab.freedesktop.org/mesa/demos/-/commit/b6d183f9943a275990aef7f08773e54c597572e5.patch";
sha256 = "4UdV+cxvNRqoT+Pdy0gkCPXJbhFr6CSCw/UOOB+rvuw=";
})
];
buildInputs = [
freeglut glew libX11 libXext libGL libGLU mesa mesa.osmesa wayland
freeglut glew libX11 libXext libGL libGLU mesa wayland
wayland-protocols
];
] ++ lib.optional (mesa ? osmesa) mesa.osmesa ;
nativeBuildInputs = [ meson ninja pkg-config ];
mesonFlags = [ "-Dwith-system-data-files=true" ];
mesonFlags = [
"-Degl=${if stdenv.isDarwin then "disabled" else "auto"}"
"-Dlibdrm=${if mesa.libdrm == null then "disabled" else "enabled"}"
"-Dosmesa=${if mesa ? osmesa then "enabled" else "disabled"}"
"-Dwayland=${if wayland.withLibraries then "enabled" else "disabled"}"
"-Dwith-system-data-files=true"
];
meta = with lib; {
inherit (mesa.meta) homepage platforms;
description = "Collection of demos and test programs for OpenGL and Mesa";
homepage = "https://www.mesa3d.org/";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ andersk ];
};
}