2020-07-18 16:06:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, bzip2
|
|
|
|
, lz4
|
|
|
|
, snappy
|
|
|
|
, zlib
|
|
|
|
, zstd
|
2020-04-24 23:36:52 +00:00
|
|
|
, enableLite ? false
|
2020-10-19 23:25:03 +00:00
|
|
|
, enableShared ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rocksdb";
|
2020-07-18 16:06:22 +00:00
|
|
|
version = "6.10.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-07-18 16:06:22 +00:00
|
|
|
sha256 = "1f2wqb6px812ijcivq3rsknqgkv01wblc6sd8wavhrw8qljgr3s1";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ninja ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ bzip2 lz4 snappy zlib zstd ];
|
|
|
|
|
|
|
|
patches = [
|
2020-07-18 16:06:22 +00:00
|
|
|
# Without this change private dependencies are exported.
|
|
|
|
# Can be removed after the next release.
|
|
|
|
# https://github.com/facebook/rocksdb/pull/6790
|
2020-04-24 23:36:52 +00:00
|
|
|
(fetchpatch {
|
2020-07-18 16:06:22 +00:00
|
|
|
url = "https://github.com/facebook/rocksdb/commit/07204837ce8d66e1e6e4893178f3fd040f9c1044.patch";
|
|
|
|
sha256 = "17097ybkhy0i089zzkpvcj65c7g5skvjvdzi1k09x4i1d719wm39";
|
2020-04-24 23:36:52 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move";
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DPORTABLE=1"
|
|
|
|
"-DWITH_JEMALLOC=0"
|
|
|
|
"-DWITH_JNI=0"
|
2020-07-18 16:06:22 +00:00
|
|
|
"-DWITH_BENCHMARK_TOOLS=0"
|
|
|
|
"-DWITH_TESTS=1"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DWITH_TOOLS=0"
|
|
|
|
"-DWITH_BZ2=1"
|
|
|
|
"-DWITH_LZ4=1"
|
|
|
|
"-DWITH_SNAPPY=1"
|
|
|
|
"-DWITH_ZLIB=1"
|
|
|
|
"-DWITH_ZSTD=1"
|
|
|
|
"-DWITH_GFLAGS=0"
|
|
|
|
"-DUSE_RTTI=1"
|
|
|
|
"-DROCKSDB_INSTALL_ON_WINDOWS=YES" # harmless elsewhere
|
|
|
|
(stdenv.lib.optional
|
|
|
|
(stdenv.hostPlatform.isx86 && stdenv.hostPlatform.isLinux)
|
|
|
|
"-DFORCE_SSE42=1")
|
|
|
|
(stdenv.lib.optional enableLite "-DROCKSDB_LITE=1")
|
|
|
|
"-DFAIL_ON_WARNINGS=${if stdenv.hostPlatform.isMinGW then "NO" else "YES"}"
|
2020-10-19 23:25:03 +00:00
|
|
|
] ++ stdenv.lib.optional (!enableShared) "-DROCKSDB_BUILD_SHARED=0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]"
|
|
|
|
hardeningDisable = stdenv.lib.optional stdenv.hostPlatform.isWindows "format";
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = "https://rocksdb.org";
|
|
|
|
description = "A library that provides an embeddable, persistent key-value store for fast storage";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ adev magenbluten ];
|
|
|
|
};
|
|
|
|
}
|