2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2020-07-17 18:10:46 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, cmake
|
|
|
|
, ninja
|
|
|
|
, bzip2
|
|
|
|
, lz4
|
|
|
|
, snappy
|
|
|
|
, zlib
|
|
|
|
, zstd
|
2020-10-22 13:32:56 +00:00
|
|
|
, enableJemalloc ? false, jemalloc
|
2019-11-15 23:19:04 +00:00
|
|
|
, enableLite ? false
|
2020-12-20 06:11:26 +00:00
|
|
|
, enableShared ? !stdenv.hostPlatform.isStatic
|
2019-11-15 23:19:04 +00:00
|
|
|
}:
|
2015-04-21 18:01:44 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-04-29 06:18:02 +00:00
|
|
|
pname = "rocksdb";
|
2021-03-15 17:50:06 +00:00
|
|
|
version = "6.17.3";
|
2018-03-11 15:41:57 +00:00
|
|
|
|
2015-04-21 18:01:44 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
2019-04-29 06:18:02 +00:00
|
|
|
repo = pname;
|
2015-11-06 02:20:18 +00:00
|
|
|
rev = "v${version}";
|
2021-03-15 17:50:06 +00:00
|
|
|
sha256 = "sha256-mfONfYMxZ3CT7Bk3OYSwg0UChmk4mQ1+cHN94gEDZcM=";
|
2015-04-21 18:01:44 +00:00
|
|
|
};
|
2018-04-04 01:23:24 +00:00
|
|
|
|
2019-11-23 17:27:16 +00:00
|
|
|
nativeBuildInputs = [ cmake ninja ];
|
2020-07-17 18:10:46 +00:00
|
|
|
|
2020-10-24 15:15:22 +00:00
|
|
|
propagatedBuildInputs = [ bzip2 lz4 snappy zlib zstd ];
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
buildInputs = lib.optional enableJemalloc jemalloc;
|
2019-04-29 06:18:02 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move";
|
2019-11-04 23:59:23 +00:00
|
|
|
|
2019-04-29 06:18:02 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DPORTABLE=1"
|
2020-10-22 13:32:56 +00:00
|
|
|
"-DWITH_JEMALLOC=${if enableJemalloc then "1" else "0"}"
|
2019-04-29 06:18:02 +00:00
|
|
|
"-DWITH_JNI=0"
|
2020-07-17 18:10:46 +00:00
|
|
|
"-DWITH_BENCHMARK_TOOLS=0"
|
|
|
|
"-DWITH_TESTS=1"
|
2019-04-29 06:18:02 +00:00
|
|
|
"-DWITH_TOOLS=0"
|
|
|
|
"-DWITH_BZ2=1"
|
|
|
|
"-DWITH_LZ4=1"
|
|
|
|
"-DWITH_SNAPPY=1"
|
|
|
|
"-DWITH_ZLIB=1"
|
|
|
|
"-DWITH_ZSTD=1"
|
2019-07-17 13:04:31 +00: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
|
2021-01-21 17:00:13 +00:00
|
|
|
(lib.optional
|
2019-11-13 00:28:38 +00:00
|
|
|
(stdenv.hostPlatform.isx86 && stdenv.hostPlatform.isLinux)
|
2019-04-29 06:18:02 +00:00
|
|
|
"-DFORCE_SSE42=1")
|
2021-01-21 17:00:13 +00:00
|
|
|
(lib.optional enableLite "-DROCKSDB_LITE=1")
|
2019-11-15 23:19:04 +00:00
|
|
|
"-DFAIL_ON_WARNINGS=${if stdenv.hostPlatform.isMinGW then "NO" else "YES"}"
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optional (!enableShared) "-DROCKSDB_BUILD_SHARED=0";
|
2015-04-21 18:01:44 +00:00
|
|
|
|
2019-11-15 23:19:04 +00:00
|
|
|
# otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]"
|
2021-01-21 17:00:13 +00:00
|
|
|
hardeningDisable = lib.optional stdenv.hostPlatform.isWindows "format";
|
2019-11-15 23:19:04 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://rocksdb.org";
|
2015-04-21 18:01:44 +00:00
|
|
|
description = "A library that provides an embeddable, persistent key-value store for fast storage";
|
2019-04-29 06:18:02 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ adev magenbluten ];
|
2015-04-21 18:01:44 +00:00
|
|
|
};
|
|
|
|
}
|