From a3ae81abbf67fe29a868563c74b9bd78980c0396 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20Mart=C3=ADnez?= Date: Tue, 7 Mar 2017 14:31:25 +0100 Subject: [PATCH] Add Redis package (#813) * redis: add package * redis: added default redis.conf --- packages/redis/bio.c.patch | 43 +++++++++++++++++++++++++++++++++++++++++++ packages/redis/build.sh | 18 ++++++++++++++++++ packages/redis/config.h.patch | 11 +++++++++++ 3 files changed, 72 insertions(+) create mode 100644 packages/redis/bio.c.patch create mode 100644 packages/redis/build.sh create mode 100644 packages/redis/config.h.patch diff --git a/packages/redis/bio.c.patch b/packages/redis/bio.c.patch new file mode 100644 index 00000000..feb5fb2d --- /dev/null +++ b/packages/redis/bio.c.patch @@ -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); ++ // } ++ //} + } + } diff --git a/packages/redis/build.sh b/packages/redis/build.sh new file mode 100644 index 00000000..fae68021 --- /dev/null +++ b/packages/redis/build.sh @@ -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 +} \ No newline at end of file diff --git a/packages/redis/config.h.patch b/packages/redis/config.h.patch new file mode 100644 index 00000000..aecec3e3 --- /dev/null +++ b/packages/redis/config.h.patch @@ -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 -- 2.11.0