From 3e5422c2e7030dbeea5727094f66554a399fa76a Mon Sep 17 00:00:00 2001 From: silvanshade Date: Wed, 23 Apr 2025 16:03:16 -0600 Subject: [PATCH 1/2] tbb: fix tests on FreeBSD and Windows This adds @Ericson2314's upstream patch to the package. --- pkgs/development/libraries/tbb/2022_0.nix | 11 ++++++----- pkgs/development/libraries/tbb/default.nix | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/tbb/2022_0.nix b/pkgs/development/libraries/tbb/2022_0.nix index 14231faf6068..75348dfa3323 100644 --- a/pkgs/development/libraries/tbb/2022_0.nix +++ b/pkgs/development/libraries/tbb/2022_0.nix @@ -34,11 +34,12 @@ stdenv.mkDerivation rec { url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/899.patch"; hash = "sha256-kU6RRX+sde0NrQMKlNtW3jXav6J4QiVIUmD50asmBPU="; }) - ]; - - cmakeFlags = [ - # Skip tests to work around https://github.com/uxlfoundation/oneTBB/issues/1695 - (lib.cmakeBool "TBB_TEST" (!stdenv.hostPlatform.isWindows)) + # Fix tests on FreeBSD and Windows + (fetchpatch { + name = "fix-tbb-freebsd-and-windows-tests.patch"; + url = "https://patch-diff.githubusercontent.com/raw/uxlfoundation/oneTBB/pull/1696.patch"; + hash = "sha256-yjX2FkOK8bz29a/XSA7qXgQw9lxzx8VIgEBREW32NN4="; + }) ]; # Fix build with modern gcc diff --git a/pkgs/development/libraries/tbb/default.nix b/pkgs/development/libraries/tbb/default.nix index 05e18da04560..8b677cc4f77e 100644 --- a/pkgs/development/libraries/tbb/default.nix +++ b/pkgs/development/libraries/tbb/default.nix @@ -44,11 +44,12 @@ stdenv.mkDerivation rec { url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/1193.patch"; hash = "sha256-ZQbwUmuIZoGVBof8QNR3V8vU385e2X7EvU3+Fbj4+M8="; }) - ]; - - cmakeFlags = [ - # Skip tests to work around https://github.com/uxlfoundation/oneTBB/issues/1695 - (lib.cmakeBool "TBB_TEST" (!stdenv.hostPlatform.isWindows)) + # Fix tests on FreeBSD and Windows + (fetchpatch { + name = "fix-tbb-freebsd-and-windows-tests.patch"; + url = "https://patch-diff.githubusercontent.com/raw/uxlfoundation/oneTBB/pull/1696.patch"; + hash = "sha256-yjX2FkOK8bz29a/XSA7qXgQw9lxzx8VIgEBREW32NN4="; + }) ]; # Fix build with modern gcc From d15765c0e91d1a8c1eb61e82318ae2945d93f5b2 Mon Sep 17 00:00:00 2001 From: silvanshade Date: Wed, 23 Apr 2025 16:05:10 -0600 Subject: [PATCH 2/2] libblake3: fix FreeBSD cross-compile builds --- pkgs/by-name/li/libblake3/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/li/libblake3/package.nix b/pkgs/by-name/li/libblake3/package.nix index 81330f818f79..4ef8515a2bb4 100644 --- a/pkgs/by-name/li/libblake3/package.nix +++ b/pkgs/by-name/li/libblake3/package.nix @@ -3,6 +3,7 @@ stdenv, cmake, fetchFromGitHub, + fetchpatch, tbb_2021_11, useTBB ? true, @@ -28,6 +29,15 @@ stdenv.mkDerivation (finalAttrs: { tbb_2021_11 ]; + patches = [ + # build(cmake): Relax Clang frontend variant detection (BLAKE3-team/BLAKE3#477) + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/BLAKE3-team/BLAKE3/pull/477.patch"; + hash = "sha256-kidCMGd/i9D9HLLTt7l1DbiU71sFTEyr3Vew4XHUHls="; + relative = "c"; + }) + ]; + cmakeFlags = [ (lib.cmakeBool "BLAKE3_USE_TBB" useTBB) (lib.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))