2019-11-15 23:19:04 +00:00
|
|
|
{ stdenv, fetchFromGitHub, fetchpatch
|
2019-11-23 17:27:16 +00:00
|
|
|
, cmake, ninja
|
2019-11-15 23:19:04 +00:00
|
|
|
, bzip2, lz4, snappy, zlib, zstd
|
|
|
|
, enableLite ? false
|
|
|
|
}:
|
2015-04-21 19:01:44 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-04-29 07:18:02 +01:00
|
|
|
pname = "rocksdb";
|
2019-11-03 06:32:00 +00:00
|
|
|
version = "6.4.6";
|
2018-03-11 15:41:57 +00:00
|
|
|
|
2015-04-21 19:01:44 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
2019-04-29 07:18:02 +01:00
|
|
|
repo = pname;
|
2015-11-06 02:20:18 +00:00
|
|
|
rev = "v${version}";
|
2019-11-03 06:32:00 +00:00
|
|
|
sha256 = "0s0n4p1b4jzmslz9d2xd4ajra0m6l9x26mjwlbgw0klxjggmy8qn";
|
2015-04-21 19:01:44 +01:00
|
|
|
};
|
2018-04-04 02:23:24 +01:00
|
|
|
|
2019-11-23 17:27:16 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja ];
|
2019-07-17 14:04:31 +01:00
|
|
|
buildInputs = [ bzip2 lz4 snappy zlib zstd ];
|
2019-04-29 07:18:02 +01:00
|
|
|
|
2019-11-15 23:19:04 +00:00
|
|
|
patches = [
|
2019-11-23 01:26:34 +00:00
|
|
|
# https://github.com/facebook/rocksdb/pull/6076
|
2019-11-15 23:19:04 +00:00
|
|
|
(fetchpatch {
|
2019-11-23 01:26:34 +00:00
|
|
|
url = "https://github.com/facebook/rocksdb/commit/c0be4b2ff1a5393419673fab961cb9b09ba38752.diff";
|
|
|
|
sha256 = "1f2wg9kqlmf2hiiihmbp8m5fr2wnn7896g6i9yg9hdgi40pw30w6";
|
2019-11-15 23:19:04 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-08-07 08:30:35 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt --replace "find_package(zlib " "find_package(ZLIB "
|
|
|
|
'';
|
2019-04-29 07:18:02 +01:00
|
|
|
|
2019-12-27 03:57:58 +00:00
|
|
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move";
|
2019-11-04 23:59:23 +00:00
|
|
|
|
2019-04-29 07:18:02 +01:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DPORTABLE=1"
|
|
|
|
"-DWITH_JEMALLOC=0"
|
|
|
|
"-DWITH_JNI=0"
|
|
|
|
"-DWITH_TESTS=0"
|
|
|
|
"-DWITH_TOOLS=0"
|
|
|
|
"-DWITH_BZ2=1"
|
|
|
|
"-DWITH_LZ4=1"
|
|
|
|
"-DWITH_SNAPPY=1"
|
|
|
|
"-DWITH_ZLIB=1"
|
|
|
|
"-DWITH_ZSTD=1"
|
2019-07-17 14:04:31 +01:00
|
|
|
"-DWITH_GFLAGS=0"
|
2019-11-09 22:32:56 +00:00
|
|
|
"-DUSE_RTTI=1"
|
2019-11-15 23:19:04 +00:00
|
|
|
"-DROCKSDB_INSTALL_ON_WINDOWS=YES" # harmless elsewhere
|
|
|
|
(stdenv.lib.optional
|
2019-11-13 00:28:38 +00:00
|
|
|
(stdenv.hostPlatform.isx86 && stdenv.hostPlatform.isLinux)
|
2019-04-29 07:18:02 +01:00
|
|
|
"-DFORCE_SSE42=1")
|
2019-11-15 23:19:04 +00:00
|
|
|
(stdenv.lib.optional enableLite "-DROCKSDB_LITE=1")
|
|
|
|
"-DFAIL_ON_WARNINGS=${if stdenv.hostPlatform.isMinGW then "NO" else "YES"}"
|
2015-04-21 19:01:44 +01:00
|
|
|
];
|
|
|
|
|
2019-11-15 23:19:04 +00:00
|
|
|
# otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]"
|
|
|
|
hardeningDisable = stdenv.lib.optional stdenv.hostPlatform.isWindows "format";
|
|
|
|
|
2015-04-21 19:01:44 +01:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://rocksdb.org";
|
2015-04-21 19:01:44 +01:00
|
|
|
description = "A library that provides an embeddable, persistent key-value store for fast storage";
|
2019-04-29 07:18:02 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ adev magenbluten ];
|
2015-04-21 19:01:44 +01:00
|
|
|
};
|
|
|
|
}
|