Files
nixpkgs/pkgs/by-name/sp/sparsehash/package.nix
whispers ececfec451 sparsehash: fix build with c++20 / gcc 16
c++20 removed several members of std::allocator, causing sparsehash to
fail to build. a long-open (2021…) pr switches these to alternatives, so
we fetch that pr and include it. this is relevant for gcc 16, which
switches to c++20 as the default standard version.

fedora has done the same thing:
https://src.fedoraproject.org/rpms/sparsehash/blob/rawhide/f/165.patch
2026-08-07 16:19:22 -04:00

31 lines
847 B
Nix

{
lib,
stdenv,
fetchFromGitHub,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "sparsehash";
version = "2.0.4";
src = fetchFromGitHub {
owner = "sparsehash";
repo = "sparsehash";
rev = "sparsehash-${finalAttrs.version}";
sha256 = "1pf1cjvcjdmb9cd6gcazz64x0cd2ndpwh6ql2hqpypjv725xwxy7";
};
# C++20 (default with GCC 16) removed many members of std::allocator. This
# replaces use of these deprecated methods with alternatives where necessary.
# https://github.com/sparsehash/sparsehash/pull/165
patches = [ ./c++-20-std-allocator.patch ];
meta = {
homepage = "https://github.com/sparsehash/sparsehash";
description = "Extremely memory-efficient hash_map implementation";
platforms = lib.platforms.all;
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ pSub ];
};
})