about summary refs log tree commit diff
path: root/pkgs/by-name/pa
diff options
context:
space:
mode:
authornatsukium <tomoya.otabi@gmail.com>2023-08-31 17:26:38 +0900
committerNiklas Hambüchen <mail@nh2.me>2024-04-28 00:55:38 +0000
commit396177a40e2322ec5b0a5e697eab9eb193259f76 (patch)
tree12b612afc6c6a278a57a166f626fb05c5fa83fc9 /pkgs/by-name/pa
parentd8fe5e6c92d0d190646fb9f1056741a229980089 (diff)
parallel-hashmap: init at 1.3.12
Diffstat (limited to 'pkgs/by-name/pa')
-rw-r--r--pkgs/by-name/pa/parallel-hashmap/package.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/by-name/pa/parallel-hashmap/package.nix b/pkgs/by-name/pa/parallel-hashmap/package.nix
new file mode 100644
index 0000000000000..767b760c920a5
--- /dev/null
+++ b/pkgs/by-name/pa/parallel-hashmap/package.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, gtest
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "parallel-hashmap";
+  version = "1.3.12";
+
+  src = fetchFromGitHub {
+    owner = "greg7mdp";
+    repo = "parallel-hashmap";
+    rev = "refs/tags/v${finalAttrs.version}";
+    hash = "sha256-6KhzXUxa4WOsRrPmSSgguFxRGTOTIaxiJBFFSzOhch0=";
+  };
+
+  postPatch = ''
+    # don't download googletest, but build it from source
+    # https://github.com/greg7mdp/parallel-hashmap/blob/be6a2c79857c9ea76760ca6ce782e1609713428e/CMakeLists.txt#L98
+    substituteInPlace CMakeLists.txt \
+      --replace "include(cmake/DownloadGTest.cmake)" "add_subdirectory(${gtest.src} ./googletest-build EXCLUDE_FROM_ALL)"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  cmakeFlags = [
+    "-DPHMAP_BUILD_TESTS=${if finalAttrs.doCheck then "ON" else "OFF"}"
+    "-DPHMAP_BUILD_EXAMPLES=OFF"
+  ];
+
+  nativeCheckInputs = [
+    gtest
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A family of header-only, very fast and memory-friendly hashmap and btree containers";
+    homepage = "https://github.com/greg7mdp/parallel-hashmap";
+    changelog = "https://github.com/greg7mdp/parallel-hashmap/releases/tag/${finalAttrs.src.rev}";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ natsukium ];
+  };
+})