Add Redis package (#813)

* redis: add package

* redis: added default redis.conf
This commit is contained in:
David Martínez 2017-03-07 14:31:25 +01:00 committed by Fredrik Fornwall
parent 46fe48b356
commit a3ae81abbf
3 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,43 @@
--- ../../build/redis/cache/redis-3.2.8/src/bio.c 2017-02-12 16:14:57.000000000 +0100
+++ ./src/bio.c 2017-03-02 22:46:52.999274254 +0100
@@ -151,8 +151,8 @@
/* Make the thread killable at any time, so that bioKillThreads()
* can work reliably. */
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
- pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
+ //pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
+ //pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
pthread_mutex_lock(&bio_mutex[type]);
/* Block SIGALRM so we are sure that only the main thread will
@@ -213,15 +213,19 @@
int err, j;
for (j = 0; j < BIO_NUM_OPS; j++) {
- if (pthread_cancel(bio_threads[j]) == 0) {
- if ((err = pthread_join(bio_threads[j],NULL)) != 0) {
- serverLog(LL_WARNING,
- "Bio thread for job type #%d can be joined: %s",
- j, strerror(err));
- } else {
- serverLog(LL_WARNING,
- "Bio thread for job type #%d terminated",j);
- }
- }
+ pthread_kill(bio_threads[j], 0);
+ serverLog(LL_WARNING,
+ "Bio thread for job type #%d terminated",j);
+
+ //if (pthread_cancel(bio_threads[j]) == 0) {
+ // if ((err = pthread_join(bio_threads[j],NULL)) != 0) {
+ // serverLog(LL_WARNING,
+ // "Bio thread for job type #%d can be joined: %s",
+ // j, strerror(err));
+ // } else {
+ // serverLog(LL_WARNING,
+ // "Bio thread for job type #%d terminated",j);
+ // }
+ //}
}
}

18
packages/redis/build.sh Normal file
View File

@ -0,0 +1,18 @@
TERMUX_PKG_HOMEPAGE=https://redis.io/
TERMUX_PKG_DESCRIPTION="Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker"
TERMUX_PKG_VERSION=3.2.8
TERMUX_PKG_SRCURL=http://download.redis.io/releases/redis-$TERMUX_PKG_VERSION.tar.gz
TERMUX_PKG_SHA256=61b373c23d18e6cc752a69d5ab7f676c6216dc2853e46750a8c4ed791d68482c
TERMUX_PKG_BUILD_IN_SRC=yes
TERMUX_PKG_CONFFILES="etc/redis.conf"
termux_step_pre_configure() {
export PREFIX=$TERMUX_PREFIX
export USE_JEMALLOC=no
LDFLAGS+=" -llog"
}
termux_step_post_make_install() {
cp $TERMUX_PKG_SRCDIR/redis.conf $TERMUX_PREFIX/etc/redis.conf
}

View File

@ -0,0 +1,11 @@
--- ../../build/redis/cache/redis-3.2.8/src/config.h 2017-02-12 16:14:57.000000000 +0100
+++ ./src/config.h 2017-03-02 22:42:23.207883845 +0100
@@ -96,7 +96,7 @@
/* Define rdb_fsync_range to sync_file_range() on Linux, otherwise we use
* the plain fsync() call. */
-#ifdef __linux__
+#ifdef __android__
#if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
#if (LINUX_VERSION_CODE >= 0x020611 && __GLIBC_PREREQ(2, 6))
#define HAVE_SYNC_FILE_RANGE 1