44 fetchFromGitHub ,
55 fetchpatch ,
66 cmake ,
7+ ninja ,
78} :
89
910stdenv . mkDerivation rec {
@@ -24,6 +25,7 @@ stdenv.mkDerivation rec {
2425
2526 nativeBuildInputs = [
2627 cmake
28+ ninja
2729 ] ;
2830
2931 patches = [
@@ -32,6 +34,21 @@ stdenv.mkDerivation rec {
3234 url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/899.patch" ;
3335 hash = "sha256-kU6RRX+sde0NrQMKlNtW3jXav6J4QiVIUmD50asmBPU=" ;
3436 } )
37+ ( fetchpatch {
38+ name = "fix-tbb-mingw-compile.patch" ;
39+ url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/1361.patch" ;
40+ hash = "sha256-jVa4HQetZv0vImdv549MyTy6/8t9dy8m6YAmjPGNQ18=" ;
41+ } )
42+ ( fetchpatch {
43+ name = "fix-tbb-mingw-link.patch" ;
44+ url = "https://patch-diff.githubusercontent.com/raw/oneapi-src/oneTBB/pull/1193.patch" ;
45+ hash = "sha256-ZQbwUmuIZoGVBof8QNR3V8vU385e2X7EvU3+Fbj4+M8=" ;
46+ } )
47+ ] ;
48+
49+ cmakeFlags = [
50+ # Skip tests to work around https://github.com/uxlfoundation/oneTBB/issues/1695
51+ ( lib . cmakeBool "TBB_TEST" ( ! stdenv . hostPlatform . isWindows ) )
3552 ] ;
3653
3754 # Fix build with modern gcc
@@ -61,6 +78,8 @@ stdenv.mkDerivation rec {
6178 --replace-fail 'tbb_add_test(SUBDIR conformance NAME conformance_resumable_tasks DEPENDENCIES TBB::tbb)' ""
6279 '' ;
6380
81+ enableParallelBuilding = true ;
82+
6483 meta = with lib ; {
6584 description = "Intel Thread Building Blocks C++ Library" ;
6685 homepage = "http://threadingbuildingblocks.org/" ;
@@ -73,7 +92,7 @@ stdenv.mkDerivation rec {
7392 represents a higher-level, task-based parallelism that abstracts platform
7493 details and threading mechanisms for scalability and performance.
7594 '' ;
76- platforms = platforms . unix ;
95+ platforms = platforms . unix ++ platforms . windows ;
7796 maintainers = with maintainers ; [
7897 thoughtpolice
7998 tmarkus
0 commit comments