nixpkgs/pkgs/development/libraries/leveldb/default.nix

46 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, snappy }:
2013-05-11 07:52:32 +01:00
stdenv.mkDerivation rec {
pname = "leveldb";
version = "1.20";
2013-05-11 07:52:32 +01:00
2014-11-15 05:54:12 +00:00
src = fetchFromGitHub {
owner = "google";
repo = "leveldb";
rev = "v${version}";
sha256 = "01kxga1hv4wp94agx5vl3ybxfw5klqrdsrb6p6ywvnjmjxm8322y";
2013-05-11 07:52:32 +01:00
};
buildInputs = [ snappy ];
nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
2020-02-26 12:44:13 +00:00
doCheck = true;
buildFlags = [ "all" ];
postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
# remove shared objects from "all" target
sed -i '/^all:/ s/$(SHARED_LIBS) $(SHARED_PROGRAMS)//' Makefile
2014-11-15 05:54:12 +00:00
'';
2013-05-11 07:52:32 +01:00
installPhase = ''
runHook preInstall
install -D -t $out/include/leveldb include/leveldb/*
install -D helpers/memenv/memenv.h $out/include/leveldb/helpers
install -D -t $out/lib out-{static,shared}/lib*
install -D -t $out/bin out-static/{leveldbutil,db_bench}
runHook postInstall
'';
2013-05-11 07:52:32 +01:00
meta = with lib; {
homepage = "https://github.com/google/leveldb";
description = "Fast and lightweight key/value database library by Google";
2014-11-15 05:54:12 +00:00
license = licenses.bsd3;
platforms = platforms.all;
2013-05-11 07:52:32 +01:00
};
}