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

43 lines
963 B
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, snappy }:
2013-05-11 08:52:32 +02:00
stdenv.mkDerivation rec {
pname = "leveldb";
version = "1.20";
2013-05-11 08:52:32 +02:00
2014-11-15 06:54:12 +01:00
src = fetchFromGitHub {
owner = "google";
repo = "leveldb";
rev = "v${version}";
sha256 = "01kxga1hv4wp94agx5vl3ybxfw5klqrdsrb6p6ywvnjmjxm8322y";
2013-05-11 08:52:32 +02:00
};
buildInputs = [ snappy ];
2020-02-26 13:44:13 +01:00
nativeBuildInputs = []
++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
2020-02-26 13:44:13 +01:00
2014-11-15 06:54:12 +01:00
buildPhase = ''
make all
2014-11-15 06:54:12 +01:00
'';
2013-05-11 08:52:32 +02:00
2020-02-26 13:44:13 +01:00
installPhase = "
2014-11-15 06:54:12 +01:00
mkdir -p $out/{bin,lib,include}
2014-11-15 06:54:12 +01:00
cp -r include $out
mkdir -p $out/include/leveldb/helpers
cp helpers/memenv/memenv.h $out/include/leveldb/helpers
cp out-shared/lib* $out/lib
cp out-static/lib* $out/lib
cp out-static/leveldbutil $out/bin
2013-05-11 08:52:32 +02:00
";
meta = with lib; {
homepage = "https://github.com/google/leveldb";
description = "Fast and lightweight key/value database library by Google";
2014-11-15 06:54:12 +01:00
license = licenses.bsd3;
platforms = platforms.all;
2013-05-11 08:52:32 +02:00
};
}