diff --git a/pkgs/development/libraries/rocksdb/default.nix b/pkgs/development/libraries/rocksdb/default.nix index 71b3442409eb137..bb36d942a69b88f 100644 --- a/pkgs/development/libraries/rocksdb/default.nix +++ b/pkgs/development/libraries/rocksdb/default.nix @@ -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 @@ -12,7 +11,6 @@ , jemalloc ? null, gperftools ? null , enableLite ? false -, windows }: let @@ -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;