tbb: clean up

- Drop compiler and stdver arguments – if someone needs to provide them, they can just use overrideAttrs
- Update repo source
- Narrow scope of `with lib` declaration
- Change optional → optionals
- Use one input per line
- Build on all unix platforms
- Re-order attributes
This commit is contained in:
Jan Tojnar 2021-05-11 15:42:41 +02:00
parent 5ff66dca33
commit 99396a48a5
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
1 changed files with 24 additions and 15 deletions

View File

@ -1,22 +1,33 @@
{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, compiler ? if stdenv.cc.isClang then "clang" else null, stdver ? null }: { lib
, stdenv
, fetchFromGitHub
, fixDarwinDylibNames
}:
with lib; stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "tbb"; pname = "tbb";
version = "2020_U3"; version = "2020.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "01org"; owner = "oneapi-src";
repo = "tbb"; repo = "oneTBB";
rev = version; rev = "v${version}";
sha256 = "sha256-prO2O5hd+Wz5iA0vfrqmyHFr0Ptzk64so5KpSpvuKmU="; sha256 = "prO2O5hd+Wz5iA0vfrqmyHFr0Ptzk64so5KpSpvuKmU=";
}; };
nativeBuildInputs = optional stdenv.isDarwin fixDarwinDylibNames; patches = lib.optionals stdenv.hostPlatform.isMusl [
./glibc-struct-mallinfo.patch
];
makeFlags = optional (compiler != null) "compiler=${compiler}" nativeBuildInputs = lib.optionals stdenv.isDarwin [
++ optional (stdver != null) "stdver=${stdver}"; fixDarwinDylibNames
];
patches = lib.optional stdenv.hostPlatform.isMusl ./glibc-struct-mallinfo.patch; makeFlags = lib.optionals stdenv.cc.isClang [
"compiler=clang"
];
enableParallelBuilding = true;
installPhase = '' installPhase = ''
runHook preInstall runHook preInstall
@ -29,9 +40,7 @@ with lib; stdenv.mkDerivation rec {
runHook postInstall runHook postInstall
''; '';
enableParallelBuilding = true; meta = with lib; {
meta = {
description = "Intel Thread Building Blocks C++ Library"; description = "Intel Thread Building Blocks C++ Library";
homepage = "http://threadingbuildingblocks.org/"; homepage = "http://threadingbuildingblocks.org/";
license = licenses.asl20; license = licenses.asl20;
@ -43,7 +52,7 @@ with lib; stdenv.mkDerivation rec {
represents a higher-level, task-based parallelism that abstracts platform represents a higher-level, task-based parallelism that abstracts platform
details and threading mechanisms for scalability and performance. details and threading mechanisms for scalability and performance.
''; '';
platforms = with platforms; linux ++ darwin; platforms = platforms.unix;
maintainers = with maintainers; [ thoughtpolice dizfer ]; maintainers = with maintainers; [ thoughtpolice dizfer ];
}; };
} }