sparsehash: modernize

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
This commit is contained in:
Ethan Carter Edwards
2026-10-13 16:44:46 -04:00
parent cc2f289e00
commit dc6d0d69ff

View File

@@ -2,17 +2,21 @@
lib,
stdenv,
fetchFromGitHub,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "sparsehash";
version = "2.0.4";
strictDeps = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "sparsehash";
repo = "sparsehash";
rev = "sparsehash-${finalAttrs.version}";
sha256 = "1pf1cjvcjdmb9cd6gcazz64x0cd2ndpwh6ql2hqpypjv725xwxy7";
tag = "sparsehash-${finalAttrs.version}";
hash = "sha256-x3feizhbXn8xFBQbyG+zojHQiflfsWcaS6s2ybZkwd0=";
};
# C++20 (default with GCC 16) removed many members of std::allocator. This
@@ -20,11 +24,18 @@ stdenv.mkDerivation (finalAttrs: {
# https://github.com/sparsehash/sparsehash/pull/165
patches = [ ./c++-20-std-allocator.patch ];
passthru.tests = {
pkg-config = testers.hasPkgConfigModules {
package = finalAttrs.finalPackage;
};
};
meta = {
homepage = "https://github.com/sparsehash/sparsehash";
description = "Extremely memory-efficient hash_map implementation";
platforms = lib.platforms.all;
license = lib.licenses.bsd3;
pkgConfigModules = [ "libsparsehash" ];
maintainers = with lib.maintainers; [ pSub ];
};
})