Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 16 additions & 21 deletions pkgs/development/libraries/tbb/default.nix
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
{ stdenv, fetchFromGitHub, fixDarwinDylibNames, compiler ? if stdenv.cc.isClang then "clang" else null, stdver ? null }:

@Mic92 Mic92 Jan 12, 2021

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think specifying a compiler is needed anymore.
Otherwise using overrideAttrs to set cmakeFlags should be easy enough. same for setting the c++ standard.

{ stdenv
, fetchFromGitHub
, fixDarwinDylibNames
, cmake
}:

with stdenv.lib; stdenv.mkDerivation rec {
pname = "tbb";
version = "2019_U9";
version = "2021.1.1";

src = fetchFromGitHub {
owner = "01org";
repo = "tbb";
rev = version;
sha256 = "1a39nflw7b2n51jfp3fdprnkpgzaspzww1dckfvaigflfli9s8rj";
owner = "oneapi-src";
repo = "oneTBB";
rev = "v${version}";
sha256 = "sha256-uI6q+1okoJ7x88ay7XTNMhT+0uYDfu+1zf0RcGCyilc=";
};

nativeBuildInputs = optional stdenv.isDarwin fixDarwinDylibNames;
nativeBuildInputs = [ cmake ] ++ optional stdenv.isDarwin fixDarwinDylibNames;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if fixDarwinDylibNames is still required.


makeFlags = optional (compiler != null) "compiler=${compiler}"
++ optional (stdver != null) "stdver=${stdver}";
NIX_CFLAGS_COMPILE = [ "-Wno-error" ];

patches = stdenv.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
# tbb detects this compiler as Clang instead of AppleClang
prePatch = stdenv.lib.optional stdenv.hostPlatform.isDarwin ''
mv cmake/compilers/AppleClang.cmake cmake/compilers/Clang.cmake
'';

enableParallelBuilding = true;
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./glibc-struct-mallinfo.patch;

meta = {
description = "Intel Thread Building Blocks C++ Library";
Expand Down