1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-30 01:20:40 +00:00

leveldb: fix static build and cleanup

- fix build of pkgsStatic.leveldb
- use runHook to start pre/post install phases
- run tests
- install the db_bench tool
This commit is contained in:
rnhmjoj 2021-03-24 19:05:44 +01:00
parent 7865db274b
commit 882dac865f
No known key found for this signature in database
GPG key ID: BFBAF4C975F76450

View file

@ -13,25 +13,28 @@ stdenv.mkDerivation rec {
buildInputs = [ snappy ]; buildInputs = [ snappy ];
nativeBuildInputs = [] nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildPhase = '' doCheck = true;
make all
buildFlags = [ "all" ];
postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
# remove shared objects from "all" target
sed -i '/^all:/ s/$(SHARED_LIBS) $(SHARED_PROGRAMS)//' Makefile
''; '';
installPhase = " installPhase = ''
mkdir -p $out/{bin,lib,include} runHook preInstall
cp -r include $out install -D -t $out/include/leveldb include/leveldb/*
mkdir -p $out/include/leveldb/helpers install -D helpers/memenv/memenv.h $out/include/leveldb/helpers
cp helpers/memenv/memenv.h $out/include/leveldb/helpers
cp out-shared/lib* $out/lib install -D -t $out/lib out-{static,shared}/lib*
cp out-static/lib* $out/lib install -D -t $out/bin out-static/{leveldbutil,db_bench}
cp out-static/leveldbutil $out/bin runHook postInstall
"; '';
meta = with lib; { meta = with lib; {
homepage = "https://github.com/google/leveldb"; homepage = "https://github.com/google/leveldb";