Browse Source

leveldb: Add package

android-5
Fredrik Fornwall 7 years ago
parent
commit
c5e143962e
  1. 15
      packages/leveldb/build.sh
  2. 12
      packages/leveldb/port-port_posix.h.patch

15
packages/leveldb/build.sh

@ -0,0 +1,15 @@
TERMUX_PKG_HOMEPAGE=https://github.com/google/leveldb
TERMUX_PKG_DESCRIPTION="Fast key-value storage library"
TERMUX_PKG_VERSION=1.20
TERMUX_PKG_SHA256=f5abe8b5b209c2f36560b75f32ce61412f39a2922f7045ae764a2c23335b6664
TERMUX_PKG_SRCURL=https://github.com/google/leveldb/archive/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_BUILD_IN_SRC=yes
termux_step_make_install() {
rm -Rf $TERMUX_PREFIX/include/leveldb/
cp -Rf include/leveldb/ $TERMUX_PREFIX/include/
cp out-shared/libleveldb.so.$TERMUX_PKG_VERSION $TERMUX_PREFIX/lib/
( cd $TERMUX_PREFIX/lib/ && \
ln -s -f libleveldb.so.$TERMUX_PKG_VERSION libleveldb.so && \
ln -s -f libleveldb.so.$TERMUX_PKG_VERSION libleveldb.so.1 )
}

12
packages/leveldb/port-port_posix.h.patch

@ -0,0 +1,12 @@
diff -u -r ../leveldb-1.20/port/port_posix.h ./port/port_posix.h
--- ../leveldb-1.20/port/port_posix.h 2017-03-02 01:08:02.000000000 +0100
+++ ./port/port_posix.h 2017-09-22 22:18:21.814123643 +0200
@@ -52,7 +52,7 @@
#if defined(OS_MACOSX) || defined(OS_SOLARIS) || defined(OS_FREEBSD) ||\
defined(OS_NETBSD) || defined(OS_OPENBSD) || defined(OS_DRAGONFLYBSD) ||\
- defined(OS_ANDROID) || defined(OS_HPUX) || defined(CYGWIN)
+ defined(OS_ANDROID) || defined(OS_HPUX) || defined(CYGWIN) || defined(__ANDROID__)
// Use fread/fwrite/fflush on platforms without _unlocked variants
#define fread_unlocked fread
#define fwrite_unlocked fwrite
Loading…
Cancel
Save