From 94ad50688f134d7030e0ed751f3bb46e990f8627 Mon Sep 17 00:00:00 2001 From: K900 Date: Mon, 1 Jul 2024 19:49:10 +0300 Subject: [PATCH] mesa-radv-jupiter: untangle from main Mesa expression --- modules/steamos/mesa.nix | 4 +- pkgs/mesa-radv-jupiter/default.nix | 59 +++++++++++++++++------------- 2 files changed, 36 insertions(+), 27 deletions(-) diff --git a/modules/steamos/mesa.nix b/modules/steamos/mesa.nix index 7846739a..f8ad55ff 100644 --- a/modules/steamos/mesa.nix +++ b/modules/steamos/mesa.nix @@ -52,8 +52,8 @@ in # Jupiter RADV (lib.mkIf (cfg.enableVendorRadv) { hardware.graphics = { - extraPackages = [ (lib.hiPrio pkgs.mesa-radv-jupiter.drivers) ]; - extraPackages32 = [ (lib.hiPrio pkgs.pkgsi686Linux.mesa-radv-jupiter.drivers) ]; + extraPackages = [ (lib.hiPrio pkgs.mesa-radv-jupiter) ]; + extraPackages32 = [ (lib.hiPrio pkgs.pkgsi686Linux.mesa-radv-jupiter) ]; }; environment.etc."drirc".source = pkgs.mesa-radv-jupiter + "/share/drirc.d/00-radv-defaults.conf"; diff --git a/pkgs/mesa-radv-jupiter/default.nix b/pkgs/mesa-radv-jupiter/default.nix index 369cd3e0..65199d1f 100644 --- a/pkgs/mesa-radv-jupiter/default.nix +++ b/pkgs/mesa-radv-jupiter/default.nix @@ -1,15 +1,9 @@ -{ mesa, fetchFromGitHub }: +{ stdenv, mesa, fetchFromGitHub }: let version = "24.1.0"; jupiterVersion = "steamos-24.4.0"; -in (mesa.override { - galliumDrivers = []; - vulkanDrivers = ["amd"]; - vulkanLayers = []; - enableGalliumNine = false; - enableOSMesa = false; - enableOpenCL = false; -}).overrideAttrs(old: { +in stdenv.mkDerivation { + pname = "mesa"; version = "${version}.${jupiterVersion}"; src = fetchFromGitHub { @@ -19,23 +13,38 @@ in (mesa.override { hash = "sha256-fWtEH8Ln1QZKMa7Y8sLexWyQYhNIuMhIUQPy198Oopg="; }; - # Filter out nixpkgs disk cache key, we trust vendor here - mesonFlags = old.mesonFlags ++ [ - # Disable all the Gallium stuff that we don't need because no drivers - "-Degl=disabled" - "-Dglvnd=disabled" - "-Dgallium-vdpau=disabled" - "-Dgallium-va=disabled" - "-Dgallium-xa=disabled" + inherit (mesa) buildInputs nativeBuildInputs propagatedBuildInputs; - # Disable libgbm to save space - "-Dgbm=disabled" + separateDebugInfo = true; - # Disable intel-clc to avoid libclc dependency - "-Dintel-clc=system" - "-Dintel-rt=disabled" + mesonAutoFeatures = "auto"; - # Vendor sets this - "-Dradv-build-id=64474a6475eb8af2b44ef334793fd58ad89875f6" + # See https://github.com/Jovian-Experiments/PKGBUILDs-mirror/blob/jupiter-main/mesa-radv/PKGBUILD + mesonFlags = [ + "-D b_ndebug=true" + "-D b_lto=false" + "-D platforms=x11,wayland" + "-D gallium-drivers=" + "-D gallium-vdpau=disabled" + "-D gallium-va=disabled" + "-D gallium-xa=disabled" + "-D android-libbacktrace=disabled" + "-D vulkan-drivers=amd" + "-D vulkan-layers=" + "-D dri3=enabled" + "-D egl=disabled" + "-D gbm=disabled" + "-D gles1=disabled" + "-D gles2=disabled" + "-D glvnd=disabled" + "-D glx=disabled" + "-D libunwind=enabled" + "-D llvm=enabled" + "-D lmsensors=disabled" + "-D osmesa=false" + "-D microsoft-clc=disabled" + "-D valgrind=enabled" + "-D intel-rt=disabled" + "-D radv-build-id=64474a6475eb8af2b44ef334793fd58ad89875f6" ]; -}) +} \ No newline at end of file