From fe3b7c5e9dbb16d00b8542b264597436d9ab2707 Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sat, 15 Oct 2022 20:11:28 +0200 Subject: [PATCH] shaderc: fix glslc on aarch64-darwin --- pkgs/development/compilers/shaderc/default.nix | 9 ++++++--- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/shaderc/default.nix b/pkgs/development/compilers/shaderc/default.nix index 082c480d6e77..65938fcc2265 100644 --- a/pkgs/development/compilers/shaderc/default.nix +++ b/pkgs/development/compilers/shaderc/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, cmake, darwin, python3 }: +{ lib, stdenv, fetchFromGitHub, cmake, python3, autoSignDarwinBinariesHook, cctools }: # Like many google projects, shaderc doesn't gracefully support separately compiled dependencies, so we can't easily use # the versions of glslang and spirv-tools used by vulkan-loader. Exact revisions are taken from # https://github.com/google/shaderc/blob/known-good/known_good.json @@ -23,7 +23,8 @@ let rev = "0c28b6451d77774912e52949c1e57fa726edf113"; sha256 = "sha256-KpCMceTV/BRaoJe1qeXhKYQNQqdGaM6Q9nklpJKzHFY="; }; -in stdenv.mkDerivation rec { +in +stdenv.mkDerivation rec { pname = "shaderc"; version = "2021.0"; @@ -42,7 +43,9 @@ in stdenv.mkDerivation rec { ln -s ${spirv-headers} third_party/spirv-tools/external/spirv-headers ''; - nativeBuildInputs = [ cmake python3 ] ++ lib.optionals stdenv.isDarwin [ darwin.cctools ]; + nativeBuildInputs = [ cmake python3 ] + ++ lib.optionals stdenv.isDarwin [ cctools ] + ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]; postInstall = '' moveToOutput "lib/*.a" $static diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3c8775a8e0da..8b040029ceb8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26453,7 +26453,9 @@ with pkgs; session-desktop = callPackage ../applications/networking/instant-messengers/session-desktop { }; - shaderc = callPackage ../development/compilers/shaderc { }; + shaderc = callPackage ../development/compilers/shaderc { + inherit (darwin) autoSignDarwinBinariesHook cctools; + }; shades-of-gray-theme = callPackage ../data/themes/shades-of-gray { };