diff --git a/pkgs/development/libraries/taskflow/default.nix b/pkgs/development/libraries/taskflow/default.nix new file mode 100644 index 000000000000..29760cdb94bd --- /dev/null +++ b/pkgs/development/libraries/taskflow/default.nix @@ -0,0 +1,50 @@ +{ lib +, stdenv +, fetchFromGitHub +, substituteAll +, doctest +, cmake +}: + +stdenv.mkDerivation rec { + pname = "taskflow"; + version = "3.3.0"; + + src = fetchFromGitHub { + owner = "taskflow"; + repo = "taskflow"; + rev = "v${version}"; + hash = "sha256-UfXGupxgtowIt3BnIVWwim3rTE57TT1C9TCx9LVyN34="; + }; + + patches = [ + (substituteAll { + src = ./unvendor-doctest.patch; + inherit doctest; + }) + ]; + + postPatch = '' + rm -r 3rd-party + + # tries to use x86 intrinsics on aarch64-darwin + sed -i '/^#if __has_include ()/,/^#endif/d' taskflow/utility/os.hpp + ''; + + nativeBuildInputs = [ + cmake + ]; + + doCheck = true; + + meta = { + description = "General-purpose Parallel and Heterogeneous Task Programming System"; + homepage = "https://taskflow.github.io/"; + changelog = let + release = lib.replaceStrings ["."] ["-"] version; + in "https://taskflow.github.io/taskflow/release-${release}.html"; + license = lib.licenses.mit; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/development/libraries/taskflow/unvendor-doctest.patch b/pkgs/development/libraries/taskflow/unvendor-doctest.patch new file mode 100644 index 000000000000..85f2e1fcff98 --- /dev/null +++ b/pkgs/development/libraries/taskflow/unvendor-doctest.patch @@ -0,0 +1,21 @@ +diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt +index 3397d798..8277191e 100644 +--- a/unittests/CMakeLists.txt ++++ b/unittests/CMakeLists.txt +@@ -1,6 +1,6 @@ + enable_testing() + +-include(${TF_3RD_PARTY_DIR}/doctest/doctest.cmake) ++include(@doctest@/lib/cmake/doctest/doctest.cmake) + + list(APPEND TF_UNITTESTS + utility +@@ -24,7 +24,7 @@ list(APPEND TF_UNITTESTS + foreach(unittest IN LISTS TF_UNITTESTS) + add_executable(${unittest} ${unittest}.cpp) + target_link_libraries(${unittest} ${PROJECT_NAME} tf::default_settings) +- target_include_directories(${unittest} PRIVATE ${TF_3RD_PARTY_DIR}/doctest) ++ target_include_directories(${unittest} PRIVATE @doctest@/include/doctest) + doctest_discover_tests(${unittest}) + endforeach() + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a2c376d55d25..ab6b2a15ca24 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20727,6 +20727,8 @@ with pkgs; tagparser = callPackage ../development/libraries/tagparser { }; + taskflow = callPackage ../development/libraries/taskflow { }; + tclap = callPackage ../development/libraries/tclap {}; tcllib = callPackage ../development/libraries/tcllib { };