2015-04-21 19:01:44 +01:00
|
|
|
{ stdenv, fetchFromGitHub
|
|
|
|
|
|
|
|
# Optional Arguments
|
|
|
|
, snappy ? null, google-gflags ? null, zlib ? null, bzip2 ? null, lz4 ? null
|
|
|
|
, numactl ? null
|
|
|
|
|
|
|
|
# Malloc implementation
|
|
|
|
, jemalloc ? null, gperftools ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
malloc = if jemalloc != null then jemalloc else gperftools;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "rocksdb-${version}";
|
2015-09-03 00:56:15 +01:00
|
|
|
version = "3.13.1";
|
2015-04-21 19:01:44 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "facebook";
|
|
|
|
repo = "rocksdb";
|
2015-06-17 01:32:34 +01:00
|
|
|
rev = "rocksdb-${version}";
|
2015-09-03 00:56:15 +01:00
|
|
|
sha256 = "1jw2sjvpixz565wvmgls4rly3wylcmyypka4pvd9mhxkq8d699h9";
|
2015-04-21 19:01:44 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ snappy google-gflags zlib bzip2 lz4 numactl malloc ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Hack to fix typos
|
|
|
|
sed -i 's,#inlcude,#include,g' build_tools/build_detect_platform
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Environment vars used for building certain configurations
|
|
|
|
PORTABLE = "1";
|
|
|
|
USE_SSE = "1";
|
2015-07-09 14:00:31 +01:00
|
|
|
CMAKE_CXX_FLAGS = "-std=gnu++11";
|
2015-04-21 19:01:44 +01:00
|
|
|
JEMALLOC_LIB = stdenv.lib.optionalString (malloc == jemalloc) "-ljemalloc";
|
|
|
|
|
|
|
|
buildFlags = [
|
|
|
|
"static_lib"
|
|
|
|
"shared_lib"
|
|
|
|
];
|
|
|
|
|
|
|
|
installFlags = [
|
|
|
|
"INSTALL_PATH=\${out}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# Might eventually remove this when we are confident in the build process
|
|
|
|
echo "BUILD CONFIGURATION FOR SANITY CHECKING"
|
|
|
|
cat make_config.mk
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://rocksdb.org;
|
|
|
|
description = "A library that provides an embeddable, persistent key-value store for fast storage";
|
|
|
|
license = licenses.bsd3;
|
2015-08-26 17:48:51 +01:00
|
|
|
platforms = platforms.allBut [ "i686-linux" ];
|
2015-04-21 19:01:44 +01:00
|
|
|
maintainers = with maintainers; [ wkennington ];
|
|
|
|
};
|
|
|
|
}
|