snappy: fix building with clang16

This commit is contained in:
Tobias Mayer 2023-08-10 09:38:31 +02:00
parent 025b892dad
commit 86500186c5
No known key found for this signature in database
GPG key ID: F8657E90819A1298

View file

@ -23,16 +23,17 @@ stdenv.mkDerivation rec {
url = "https://build.opensuse.org/public/source/openSUSE:Factory/snappy/reenable-rtti.patch?rev=a759aa6fba405cd40025e3f0ab89941d";
sha256 = "sha256-RMuM5yd6zP1eekN/+vfS54EyY4cFbGDVor1E1vj3134=";
})
# Fix -Wsign-compare warning on clang.
(fetchpatch {
url = "https://github.com/google/snappy/commit/27f34a580be4a3becf5f8c0cba13433f53c21337.patch";
sha256 = "sha256-eq6ueeMAkd2bYmPJcKAZZzd5QlXyeWOrsxFIwR8KOpQ=";
})
];
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake ];
# See https://github.com/NixOS/nixpkgs/pull/219778#issuecomment-1464884412
# and https://github.com/NixOS/nixpkgs/pull/221215#issuecomment-1482564003.
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-sign-compare";
cmakeFlags = [
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
"-DSNAPPY_BUILD_TESTS=OFF"