2017-12-10 01:40:07 +00:00
|
|
|
{ stdenv, fetchFromGitHub }:
|
2013-05-11 06:52:32 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2014-11-15 05:54:12 +00:00
|
|
|
name = "leveldb-${version}";
|
2018-11-01 23:13:43 +00:00
|
|
|
version = "1.20";
|
2013-05-11 06:52:32 +00:00
|
|
|
|
2014-11-15 05:54:12 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "leveldb";
|
|
|
|
rev = "v${version}";
|
2018-11-01 23:13:43 +00:00
|
|
|
sha256 = "01kxga1hv4wp94agx5vl3ybxfw5klqrdsrb6p6ywvnjmjxm8322y";
|
2013-05-11 06:52:32 +00:00
|
|
|
};
|
|
|
|
|
2014-11-15 05:54:12 +00:00
|
|
|
buildPhase = ''
|
2018-11-01 23:13:43 +00:00
|
|
|
make all
|
2014-11-15 05:54:12 +00:00
|
|
|
'';
|
2013-05-11 06:52:32 +00:00
|
|
|
|
2018-04-05 17:58:07 +00:00
|
|
|
installPhase = (stdenv.lib.optionalString stdenv.isDarwin ''
|
2018-11-01 23:13:43 +00:00
|
|
|
for file in out-shared/*.dylib*; do
|
2018-04-05 17:58:07 +00:00
|
|
|
install_name_tool -id $out/lib/$file $file
|
|
|
|
done
|
|
|
|
'') + # XXX consider removing above after transition to cmake in the next release
|
|
|
|
"
|
2014-11-15 05:54:12 +00:00
|
|
|
mkdir -p $out/{bin,lib,include}
|
2017-12-10 01:40:07 +00:00
|
|
|
|
2014-11-15 05:54:12 +00:00
|
|
|
cp -r include $out
|
2015-07-03 20:58:33 +00:00
|
|
|
mkdir -p $out/include/leveldb/helpers
|
|
|
|
cp helpers/memenv/memenv.h $out/include/leveldb/helpers
|
2017-12-10 01:40:07 +00:00
|
|
|
|
2018-11-01 23:13:43 +00:00
|
|
|
cp out-shared/lib* $out/lib
|
|
|
|
cp out-static/lib* $out/lib
|
2017-12-10 01:40:07 +00:00
|
|
|
|
2018-11-01 23:13:43 +00:00
|
|
|
cp out-static/leveldbutil $out/bin
|
2013-05-11 06:52:32 +00:00
|
|
|
";
|
|
|
|
|
2014-11-15 05:54:12 +00:00
|
|
|
meta = with stdenv.lib; {
|
2017-10-26 23:44:19 +00:00
|
|
|
homepage = https://github.com/google/leveldb;
|
2013-10-06 09:49:53 +00:00
|
|
|
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 06:52:32 +00:00
|
|
|
};
|
|
|
|
}
|