about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/rocksdb
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/libraries/rocksdb
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/rocksdb')
-rw-r--r--nixpkgs/pkgs/development/libraries/rocksdb/default.nix86
1 files changed, 86 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/rocksdb/default.nix b/nixpkgs/pkgs/development/libraries/rocksdb/default.nix
new file mode 100644
index 000000000000..786fce0fb638
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rocksdb/default.nix
@@ -0,0 +1,86 @@
+{ stdenv
+, fetchFromGitHub
+, fixDarwinDylibNames
+, which, perl
+
+# Optional Arguments
+, snappy ? null, google-gflags ? null, zlib ? null, bzip2 ? null, lz4 ? null
+
+# Malloc implementation
+, jemalloc ? null, gperftools ? null
+
+, enableLite ? false
+}:
+
+let
+  malloc = if jemalloc != null then jemalloc else gperftools;
+  tools = [ "sst_dump" "ldb" "rocksdb_dump" "rocksdb_undump" "blob_dump" ];
+in
+stdenv.mkDerivation rec {
+  name = "rocksdb-${version}";
+  version = "5.11.3";
+
+  outputs = [ "dev" "out" "static" "bin" ];
+
+  src = fetchFromGitHub {
+    owner = "facebook";
+    repo = "rocksdb";
+    rev = "v${version}";
+    sha256 = "15x2r7aib1xinwcchl32wghs8g96k4q5xgv6z97mxgp35475x01p";
+  };
+
+  nativeBuildInputs = [ which perl ];
+  buildInputs = [ snappy google-gflags zlib bzip2 lz4 malloc fixDarwinDylibNames ];
+
+  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";
+  CMAKE_CXX_FLAGS = "-std=gnu++11";
+  JEMALLOC_LIB = stdenv.lib.optionalString (malloc == jemalloc) "-ljemalloc";
+
+  LIBNAME = "librocksdb${stdenv.lib.optionalString enableLite "_lite"}";
+  ${if enableLite then "CXXFLAGS" else null} = "-DROCKSDB_LITE=1";
+
+  buildAndInstallFlags = [
+    "USE_RTTI=1"
+    "DEBUG_LEVEL=0"
+    "DISABLE_WARNING_AS_ERROR=1"
+  ];
+
+  buildFlags = buildAndInstallFlags ++ [
+    "shared_lib"
+    "static_lib"
+  ] ++ tools ;
+
+  installFlags = buildAndInstallFlags ++ [
+    "INSTALL_PATH=\${out}"
+    "install-shared"
+    "install-static"
+  ];
+
+  postInstall = ''
+    # Might eventually remove this when we are confident in the build process
+    echo "BUILD CONFIGURATION FOR SANITY CHECKING"
+    cat make_config.mk
+    mkdir -pv $static/lib/
+    mv -vi $out/lib/${LIBNAME}.a $static/lib/
+
+    install -d ''${!outputBin}/bin
+    install -D ${stdenv.lib.concatStringsSep " " tools} ''${!outputBin}/bin
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = https://rocksdb.org;
+    description = "A library that provides an embeddable, persistent key-value store for fast storage";
+    license = licenses.bsd3;
+    platforms = platforms.x86_64;
+    maintainers = with maintainers; [ adev wkennington ];
+  };
+}