From a986f72d2b0cbabe76a5f81bded5a78ddb9118b2 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Tue, 21 Apr 2015 11:01:44 -0700 Subject: [PATCH] rocksdb: Add derivation --- .../development/libraries/rocksdb/default.nix | 61 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 63 insertions(+) create mode 100644 pkgs/development/libraries/rocksdb/default.nix diff --git a/pkgs/development/libraries/rocksdb/default.nix b/pkgs/development/libraries/rocksdb/default.nix new file mode 100644 index 000000000000..88d94ec0f2cb --- /dev/null +++ b/pkgs/development/libraries/rocksdb/default.nix @@ -0,0 +1,61 @@ +{ 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}"; + version = "3.10"; + + src = fetchFromGitHub { + owner = "facebook"; + repo = "rocksdb"; + rev = "v${version}"; + sha256 = "1px345x9cyaxyjlzsf3bcxixvfaxn9x3ysq7biajyfhk8wq1n4p0"; + }; + + 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"; + 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; + platforms = platforms.all; + maintainers = with maintainers; [ wkennington ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 75494a1a589b..8fc84b30858f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7472,6 +7472,8 @@ let rlog = callPackage ../development/libraries/rlog { }; + rocksdb = callPackage ../development/libraries/rocksdb { }; + rubberband = callPackage ../development/libraries/rubberband { fftw = fftwSinglePrec; inherit (vamp) vampSDK;