
This time we revert interface changes to not break `arrow-cpp` and others. Changes: https://github.com/google/snappy/releases/tag/1.2.2
63 lines
1.3 KiB
Nix
63 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
cmake,
|
|
static ? stdenv.hostPlatform.isStatic,
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "snappy";
|
|
version = "1.2.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "google";
|
|
repo = "snappy";
|
|
rev = version;
|
|
hash = "sha256-bMZD8EI9dvDGupfos4hi/0ShBkrJlI5Np9FxE6FfrNE=";
|
|
};
|
|
|
|
patches = [
|
|
./revert-PUBLIC.patch
|
|
];
|
|
|
|
outputs = [
|
|
"out"
|
|
"dev"
|
|
];
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
cmakeFlags = [
|
|
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
|
|
"-DSNAPPY_BUILD_TESTS=OFF"
|
|
"-DSNAPPY_BUILD_BENCHMARKS=OFF"
|
|
];
|
|
|
|
postInstall = ''
|
|
substituteInPlace "$out"/lib/cmake/Snappy/SnappyTargets.cmake \
|
|
--replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include"' 'INTERFACE_INCLUDE_DIRECTORIES "'$dev'"'
|
|
|
|
mkdir -p $dev/lib/pkgconfig
|
|
cat <<EOF > $dev/lib/pkgconfig/snappy.pc
|
|
Name: snappy
|
|
Description: Fast compressor/decompressor library.
|
|
Version: ${version}
|
|
Libs: -L$out/lib -lsnappy
|
|
Cflags: -I$dev/include
|
|
EOF
|
|
'';
|
|
|
|
#checkTarget = "test";
|
|
|
|
# requires gbenchmark and gtest but it also installs them out $dev
|
|
doCheck = false;
|
|
|
|
meta = with lib; {
|
|
homepage = "https://google.github.io/snappy/";
|
|
license = licenses.bsd3;
|
|
description = "Compression/decompression library for very high speeds";
|
|
platforms = platforms.all;
|
|
};
|
|
}
|