about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/tbb/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/tbb/default.nix')
-rw-r--r--nixpkgs/pkgs/development/libraries/tbb/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/tbb/default.nix b/nixpkgs/pkgs/development/libraries/tbb/default.nix
new file mode 100644
index 000000000000..2047b0d5bc2e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tbb/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, compiler ? if stdenv.cc.isClang then "clang" else null, stdver ? null }:
+
+with lib; stdenv.mkDerivation rec {
+  pname = "tbb";
+  version = "2019_U9";
+
+  src = fetchFromGitHub {
+    owner = "01org";
+    repo = "tbb";
+    rev = version;
+    sha256 = "1a39nflw7b2n51jfp3fdprnkpgzaspzww1dckfvaigflfli9s8rj";
+  };
+
+  nativeBuildInputs = optional stdenv.isDarwin fixDarwinDylibNames;
+
+  makeFlags = optional (compiler != null) "compiler=${compiler}"
+    ++ optional (stdver != null) "stdver=${stdver}";
+
+  patches = lib.optional stdenv.hostPlatform.isMusl ./glibc-struct-mallinfo.patch;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/lib
+    cp "build/"*release*"/"*${stdenv.hostPlatform.extensions.sharedLibrary}* $out/lib/
+    mv include $out/
+    rm $out/include/index.html
+
+    runHook postInstall
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Intel Thread Building Blocks C++ Library";
+    homepage = "http://threadingbuildingblocks.org/";
+    license = licenses.asl20;
+    longDescription = ''
+      Intel Threading Building Blocks offers a rich and complete approach to
+      expressing parallelism in a C++ program. It is a library that helps you
+      take advantage of multi-core processor performance without having to be a
+      threading expert. Intel TBB is not just a threads-replacement library. It
+      represents a higher-level, task-based parallelism that abstracts platform
+      details and threading mechanisms for scalability and performance.
+    '';
+    platforms = with platforms; linux ++ darwin;
+    maintainers = with maintainers; [ thoughtpolice dizfer ];
+  };
+}