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