leveldb: fix static building

1. The Makefile is long gone and the patch in not needed anymore.

2. For some reason LEVELDB_BUILD_BENCHMARKS=OFF is necessary
   when building statically. (Note: this has always been of
   for the shared build)
This commit is contained in:
rnhmjoj 2022-04-09 04:17:27 +02:00
parent bfa6f1553a
commit 76492d0c26
No known key found for this signature in database
GPG Key ID: BFBAF4C975F76450

View File

@ -38,13 +38,9 @@ stdenv.mkDerivation rec {
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
"-DLEVELDB_BUILD_TESTS=OFF"
"-DLEVELDB_BUILD_BENCHMARKS=OFF"
];
postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
# remove shared objects from "all" target
sed -i '/^all:/ s/$(SHARED_LIBS) $(SHARED_PROGRAMS)//' Makefile
'';
postInstall = ''
substituteInPlace "$out"/lib/cmake/leveldb/leveldbTargets.cmake \
--replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include"' 'INTERFACE_INCLUDE_DIRECTORIES "'$dev'"'