diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 1723940915c..fd226277a44 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -34,9 +34,8 @@ let # Release frequency: https://www.mesa3d.org/releasing.html#schedule version = "21.0.2"; branch = versions.major version; -in -stdenv.mkDerivation { +self = stdenv.mkDerivation { pname = "mesa"; inherit version; @@ -88,7 +87,9 @@ stdenv.mkDerivation { "find_program('${stdenv.cc.targetPrefix}nm')" ''; - outputs = [ "out" "dev" "drivers" ] ++ lib.optional enableOSMesa "osmesa"; + outputs = [ "out" "dev" "drivers" ] + ++ lib.optional enableOSMesa "osmesa" + ++ lib.optional stdenv.isLinux "driversdev"; # TODO: Figure out how to enable opencl without having a runtime dependency on clang mesonFlags = [ @@ -181,20 +182,22 @@ stdenv.mkDerivation { mv -t $osmesa/lib/ $out/lib/libOSMesa* ''; - # TODO: - # check $out doesn't depend on llvm: builder failures are ignored - # for some reason grep -qv '${llvmPackages.llvm}' -R "$out"; postFixup = optionalString stdenv.isLinux '' # set the default search path for DRI drivers; used e.g. by X server substituteInPlace "$dev/lib/pkgconfig/dri.pc" --replace "$drivers" "${libglvnd.driverLink}" + substituteInPlace "$dev/lib/pkgconfig/d3d.pc" --replace "$drivers" "${libglvnd.driverLink}" # remove pkgconfig files for GL/EGL; they are provided by libGL. rm -f $dev/lib/pkgconfig/{gl,egl}.pc - # Update search path used by pkg-config - for pc in $dev/lib/pkgconfig/{d3d,dri,xatracker}.pc; do - if [ -f "$pc" ]; then - substituteInPlace "$pc" --replace $out $drivers + # Move development files for libraries in $drivers to $driversdev + mkdir -p $driversdev/include + mv $dev/include/xa_* $dev/include/d3d* $driversdev/include + mkdir -p $driversdev/lib/pkgconfig + for pc in lib/pkgconfig/{xatracker,d3d}.pc; do + if [ -f "$dev/$pc" ]; then + substituteInPlace "$dev/$pc" --replace $out $drivers + mv $dev/$pc $driversdev/$pc fi done @@ -212,6 +215,14 @@ stdenv.mkDerivation { passthru = { inherit libdrm; inherit (libglvnd) driverLink; + + tests.devDoesNotDependOnLLVM = stdenv.mkDerivation { + name = "mesa-dev-does-not-depend-on-llvm"; + buildCommand = '' + echo ${self.dev} >>$out + ''; + disallowedRequisites = [ llvmPackages.llvm self.drivers ]; + }; }; meta = { @@ -231,4 +242,6 @@ stdenv.mkDerivation { platforms = platforms.mesaPlatforms; maintainers = with maintainers; [ primeos vcunat ]; # Help is welcome :) }; -} +}; + +in self diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index 4c832291595..3f88c0e0c99 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -433,7 +433,7 @@ self: super: }); xf86videovmware = super.xf86videovmware.overrideAttrs (attrs: { - buildInputs = attrs.buildInputs ++ [ mesa llvm ]; # for libxatracker + buildInputs = attrs.buildInputs ++ [ mesa mesa.driversdev llvm ]; # for libxatracker meta = attrs.meta // { platforms = ["i686-linux" "x86_64-linux"]; };