LevelDB: new recipe (#2555)

This commit is contained in:
miqlas
2018-05-20 16:54:16 +02:00
committed by waddlesplash
parent 3e0f6c1bd0
commit 6d9f144ebc
2 changed files with 125 additions and 0 deletions

View File

@@ -0,0 +1,81 @@
SUMMARY="A fast key-value storage library written at Google"
DESCRIPTION="LevelDB stores keys and values in arbitrary byte arrays, and \
data is sorted by key. It supports batching writes, forward and backward \
iteration, and compression of the data via Google's Snappy compression \
library.
LevelDB is not an SQL database. Like other NoSQL and Dbm stores, it does \
not have a relational data model and it does not support SQL queries. Also, \
it has no support for indexes. Applications use LevelDB as a library, as it \
does not provide a server or command-line interface."
HOMEPAGE="http://leveldb.org/"
COPYRIGHT="2017 The LevelDB Authors"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://github.com/google/leveldb/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="f5abe8b5b209c2f36560b75f32ce61412f39a2922f7045ae764a2c23335b6664"
SOURCE_FILENAME="leveldb-$portVersion.tar.gz"
PATCHES="leveldb-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 ?x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
libVersion="$portVersion"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
leveldb$secondaryArchSuffix = $portVersion
lib:libleveldb$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libsnappy$secondaryArchSuffix
"
PROVIDES_devel="
leveldb${secondaryArchSuffix}_devel = $portVersion
devel:libleveldb$secondaryArchSuffix = $libVersionCompat
devel:libmemenv$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
leveldb$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libsnappy$secondaryArchSuffix
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
"
defineDebugInfoPackage leveldb$secondaryArchSuffix \
"$libDir"/libleveldb.so.$libVersion
BUILD()
{
make $jobArgs
}
INSTALL()
{
install -d -m 755 "$libDir" "$includeDir" "$developDocDir"
cp -R include/* "$includeDir"
cp out-static/*.a "$libDir"
cp --no-dereference out-shared/libleveldb.so* "$libDir"
cp -R doc/* "$developDocDir"
prepareInstalledDevelLibs libleveldb libmemenv
packageEntries devel \
"$developDir"
}
TEST()
{
make check
}

View File

@@ -0,0 +1,44 @@
From 0adb7c07e094fad72120b8a86fcf386a95f9be06 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
Date: Sun, 13 May 2018 17:00:39 +0200
Subject: Haiku supporting patches
diff --git a/build_detect_platform b/build_detect_platform
index d2a20ce..e1fa25e 100755
--- a/build_detect_platform
+++ b/build_detect_platform
@@ -131,6 +131,13 @@ case "$TARGET_OS" in
PORT_FILE=port/port_posix.cc
PORT_SSE_FILE=port/port_posix_sse.cc
;;
+ Haiku)
+ PLATFORM=OS_HAIKU
+ COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_HAIKU"
+ PLATFORM_LIBS="-lpthread"
+ PORT_FILE=port/port_posix.cc
+ PORT_SSE_FILE=port/port_posix_sse.cc
+ ;;
OS_ANDROID_CROSSCOMPILE)
PLATFORM=OS_ANDROID
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_ANDROID -DLEVELDB_PLATFORM_POSIX"
diff --git a/util/env_posix.cc b/util/env_posix.cc
index 84aabb2..58b00ee 100644
--- a/util/env_posix.cc
+++ b/util/env_posix.cc
@@ -280,10 +280,12 @@ class PosixWritableFile : public WritableFile {
if (!s.ok()) {
return s;
}
+ #ifndef __HAIKU__
if (fflush_unlocked(file_) != 0 ||
fdatasync(fileno(file_)) != 0) {
s = Status::IOError(filename_, strerror(errno));
}
+ #endif
return s;
}
};
--
2.16.2