Skip to content

Commit

Permalink
revert rocksdb
Browse files Browse the repository at this point in the history
  • Loading branch information
angerman committed May 16, 2018
1 parent 3c032a1 commit 7f86470
Showing 1 changed file with 41 additions and 51 deletions.
92 changes: 41 additions & 51 deletions pkgs/development/libraries/rocksdb/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{ stdenv
, fetchFromGitHub
, fixDarwinDylibNames
, hostPlatform, lib
, which, perl, cmake
, which, perl

# Optional Arguments
, snappy ? null, google-gflags ? null, zlib ? null, bzip2 ? null, lz4 ? null
Expand All @@ -12,7 +11,6 @@
, jemalloc ? null, gperftools ? null

, enableLite ? false
, windows
}:

let
Expand All @@ -32,58 +30,50 @@ stdenv.mkDerivation rec {
sha256 = "15x2r7aib1xinwcchl32wghs8g96k4q5xgv6z97mxgp35475x01p";
};

nativeBuildInputs = [ which perl snappy google-gflags ];
buildInputs = [ zlib bzip2 malloc fixDarwinDylibNames ] # lz4 ];
++ lib.optional (hostPlatform.libc == "msvcrt") [ windows.mingw_w64_pthreads windows.mingw_w64_headers ];
crossAttrs = {
nativeBuildInputs = [ which perl snappy google-gflags cmake ];
};

# cmakeFlags = "-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ ";
cmakeFlags = "-DCMAKE_SYSTEM_NAME=Windows -DCMAKE_CXX_FLAGS=-std=c++11 -DCMAKE_CXX_FLAGS=-pthread";
buildFlags = "rocksdb VERBOSE=1 -j1";
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
# '';
postPatch = ''
# Hack to fix typos
sed -i 's,#inlcude,#include,g' build_tools/build_detect_platform
'';

# # Environment vars used for building certain configurations
# Environment vars used for building certain configurations
PORTABLE = "1";
USE_SSE = "1";
#CMAKE_CXX_FLAGS = "-std=c++11 -pthread -pthreads";
# 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
# '';
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;

Expand Down

0 comments on commit 7f86470

Please sign in to comment.