Merge pull request #206354 from yihuang/rocksdb-tools

rocksdb: build ldb/sst_dump tools

Changed files
+15
pkgs
development
libraries
rocksdb
+15
pkgs/development/libraries/rocksdb/default.nix
···
buildInputs = lib.optional enableJemalloc jemalloc;
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move"
+ lib.optionalString stdenv.cc.isClang "-Wno-error=unused-private-field -faligned-allocation";
···
"-DWITH_BENCHMARK_TOOLS=0"
"-DWITH_TESTS=1"
"-DWITH_TOOLS=0"
"-DWITH_BZ2=1"
"-DWITH_LZ4=1"
"-DWITH_SNAPPY=1"
···
# otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]"
hardeningDisable = lib.optional stdenv.hostPlatform.isWindows "format";
# Old version doesn't ship the .pc file, new version puts wrong paths in there.
postFixup = ''
···
buildInputs = lib.optional enableJemalloc jemalloc;
+
outputs = [
+
"out"
+
"tools"
+
];
+
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move"
+ lib.optionalString stdenv.cc.isClang "-Wno-error=unused-private-field -faligned-allocation";
···
"-DWITH_BENCHMARK_TOOLS=0"
"-DWITH_TESTS=1"
"-DWITH_TOOLS=0"
+
"-DWITH_CORE_TOOLS=1"
"-DWITH_BZ2=1"
"-DWITH_LZ4=1"
"-DWITH_SNAPPY=1"
···
# otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]"
hardeningDisable = lib.optional stdenv.hostPlatform.isWindows "format";
+
+
preInstall = ''
+
mkdir -p $tools/bin
+
cp tools/{ldb,sst_dump} $tools/bin/
+
'' + lib.optionalString stdenv.isDarwin ''
+
ls -1 $tools/bin/* | xargs -I{} install_name_tool -change "@rpath/librocksdb.7.dylib" $out/lib/librocksdb.dylib {}
+
'' + lib.optionalString (stdenv.isLinux && enableShared) ''
+
ls -1 $tools/bin/* | xargs -I{} patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib {}
+
'';
# Old version doesn't ship the .pc file, new version puts wrong paths in there.
postFixup = ''