leveldb: 1.20 -> 1.23
This commit is contained in:
parent
9cee4bccd1
commit
feb2dcf2c1
@ -1,39 +1,50 @@
|
||||
{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, snappy }:
|
||||
{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, snappy, cmake
|
||||
, static ? stdenv.hostPlatform.isStatic }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "leveldb";
|
||||
version = "1.20";
|
||||
version = "1.23";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "google";
|
||||
repo = "leveldb";
|
||||
rev = "v${version}";
|
||||
sha256 = "01kxga1hv4wp94agx5vl3ybxfw5klqrdsrb6p6ywvnjmjxm8322y";
|
||||
rev = "${version}";
|
||||
sha256 = "sha256-RL+dfSFZZzWvUobSqiPbuC4nDiGzjIIukbVJZRacHbI=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
buildInputs = [ snappy ];
|
||||
|
||||
nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames ++ [ cmake ];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
buildFlags = [ "all" ];
|
||||
|
||||
# NOTE: disabling tests due to gtest issue
|
||||
cmakeFlags = [
|
||||
"-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
|
||||
"-DCMAKE_SKIP_BUILD_RPATH=OFF"
|
||||
"-DLEVELDB_BUILD_TESTS=OFF"
|
||||
];
|
||||
|
||||
postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
|
||||
# remove shared objects from "all" target
|
||||
sed -i '/^all:/ s/$(SHARED_LIBS) $(SHARED_PROGRAMS)//' Makefile
|
||||
'';
|
||||
|
||||
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
|
||||
postInstall = ''
|
||||
substituteInPlace "$out"/lib/cmake/leveldb/leveldbTargets.cmake \
|
||||
--replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include"' 'INTERFACE_INCLUDE_DIRECTORIES "'$dev'"'
|
||||
mkdir -p $dev/lib/pkgconfig
|
||||
cat <<EOF > $dev/lib/pkgconfig/leveldb.pc
|
||||
Name: leveldb
|
||||
Description: Fast and lightweight key/value database library by Google.
|
||||
Version: ${version}
|
||||
Libs: -L$out/lib -lleveldb
|
||||
Cflags: -I$dev/include
|
||||
EOF
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
Loading…
Reference in New Issue
Block a user