redis: bump version, remove old bep/patch file (#1398)

This commit is contained in:
Schrijvers Luc
2017-06-08 09:29:20 +02:00
committed by Jérôme Duval
parent 7e4663bbe5
commit 38c13afc37
5 changed files with 152 additions and 236 deletions

View File

@@ -1,105 +0,0 @@
diff --git redis-2.9.0-git/deps/hiredis/Makefile redis-2.9.0-git/deps/hiredis/Makefile
index 2a84b9b..1225539 100644
--- redis-2.9.0-git/deps/hiredis/Makefile
+++ redis-2.9.0-git/deps/hiredis/Makefile
@@ -26,6 +26,15 @@ ifeq ($(uname_S),Darwin)
STLIBNAME?=libhiredis.a
STLIB_MAKE_CMD?=libtool -static -o ${STLIBNAME} - ${OBJ}
else
+ifeq ($(uname_S),Haiku)
+ CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF)
+ CCLINK?=-lroot -lnetwork
+ LDFLAGS?=-L. -Wl,-rpath,.
+ DYLIBNAME?=libhiredis.so
+ DYLIB_MAKE_CMD?=gcc -shared -Wl,-soname,${DYLIBNAME} -o ${DYLIBNAME} ${OBJ}
+ STLIBNAME?=libhiredis.a
+ STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ}
+else
CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF)
CCLINK?=-lm -pthread
LDFLAGS?=-L. -Wl,-rpath,.
@@ -35,6 +44,7 @@ else
STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ}
endif
endif
+endif
CCOPT= $(CFLAGS) $(CCLINK)
DEBUG?= -g -ggdb
diff --git redis-2.9.0-git/src/Makefile redis-2.9.0-git/src/Makefile
index 292255c..e6a6d87 100644
--- redis-2.9.0-git/src/Makefile
+++ redis-2.9.0-git/src/Makefile
@@ -15,12 +15,18 @@ endif
ifeq ($(uname_S),SunOS)
CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W -D__EXTENSIONS__ -D_XPG6
CCLINK?=-ldl -lnsl -lsocket -lm -lpthread
- DEBUG?=-g -ggdb
+ DEBUG?=-g -ggdb
+else
+ifeq ($(uname_S),Haiku)
+ CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF)
+ CCLINK?=-lroot -lnetwork
+ DEBUG?=-g -ggdb
else
CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF)
CCLINK?=-lm -pthread
DEBUG?=-g -rdynamic -ggdb
endif
+endif
ifeq ($(USE_TCMALLOC),yes)
ALLOD_DEPS=
diff --git redis-2.9.0-git/src/aof.c redis-2.9.0-git/src/aof.c
index dbd0468..7a5d21f 100644
--- redis-2.9.0-git/src/aof.c
+++ redis-2.9.0-git/src/aof.c
@@ -25,7 +25,7 @@ void stopAppendOnly(void) {
int statloc;
if (kill(server.bgrewritechildpid,SIGKILL) != -1)
- wait3(&statloc,0,NULL);
+ waitpid(&statloc,0,NULL);
/* reset the buffer accumulating changes while the child saves */
sdsfree(server.bgrewritebuf);
server.bgrewritebuf = sdsempty();
diff --git redis-2.9.0-git/src/redis.c redis-2.9.0-git/src/redis.c
index 1a1f84f..4ecc873 100644
--- redis-2.9.0-git/src/redis.c
+++ redis-2.9.0-git/src/redis.c
@@ -646,7 +646,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
int statloc;
pid_t pid;
- if ((pid = wait3(&statloc,WNOHANG,NULL)) != 0) {
+ if ((pid = waitpid(&statloc,WNOHANG,NULL)) != 0) {
int exitcode = WEXITSTATUS(statloc);
int bysignal = 0;
diff --git redis-2.9.0-git/src/sha1.c redis-2.9.0-git/src/sha1.c
index 26a5565..e90812e 100644
--- redis-2.9.0-git/src/sha1.c
+++ redis-2.9.0-git/src/sha1.c
@@ -27,6 +27,9 @@ A million repetitions of "a"
#if defined(__sun)
#include "solarisfixes.h"
#endif
+#ifdef __HAIKU__
+#include <stdint.h>
+#endif
#include "sha1.h"
#include "config.h"
diff --git redis-2.9.0-git/src/util.c redis-2.9.0-git/src/util.c
index f5a23af..2a6d18d 100644
--- redis-2.9.0-git/src/util.c
+++ redis-2.9.0-git/src/util.c
@@ -317,7 +317,7 @@ int d2string(char *buf, size_t len, double value) {
* integer printing function that is much faster. */
double min = -4503599627370495; /* (2^52)-1 */
double max = 4503599627370496; /* -(2^52) */
- if (val > min && val < max && value == ((double)((long long)value)))
+ if (value > min && value < max && value == ((double)((long long)value)))
len = ll2string(buf,len,(long long)value);
else
#endif

View File

@@ -1,105 +0,0 @@
diff --git redis-2.9.0-git/deps/hiredis/Makefile redis-2.9.0-git/deps/hiredis/Makefile
index 2a84b9b..1225539 100644
--- redis-2.9.0-git/deps/hiredis/Makefile
+++ redis-2.9.0-git/deps/hiredis/Makefile
@@ -26,6 +26,15 @@ ifeq ($(uname_S),Darwin)
STLIBNAME?=libhiredis.a
STLIB_MAKE_CMD?=libtool -static -o ${STLIBNAME} - ${OBJ}
else
+ifeq ($(uname_S),Haiku)
+ CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF)
+ CCLINK?=-lroot -lnetwork
+ LDFLAGS?=-L. -Wl,-rpath,.
+ DYLIBNAME?=libhiredis.so
+ DYLIB_MAKE_CMD?=gcc -shared -Wl,-soname,${DYLIBNAME} -o ${DYLIBNAME} ${OBJ}
+ STLIBNAME?=libhiredis.a
+ STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ}
+else
CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF)
CCLINK?=-lm -pthread
LDFLAGS?=-L. -Wl,-rpath,.
@@ -35,6 +44,7 @@ else
STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ}
endif
endif
+endif
CCOPT= $(CFLAGS) $(CCLINK)
DEBUG?= -g -ggdb
diff --git redis-2.9.0-git/src/Makefile redis-2.9.0-git/src/Makefile
index 292255c..e6a6d87 100644
--- redis-2.9.0-git/src/Makefile
+++ redis-2.9.0-git/src/Makefile
@@ -15,12 +15,18 @@ endif
ifeq ($(uname_S),SunOS)
CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W -D__EXTENSIONS__ -D_XPG6
CCLINK?=-ldl -lnsl -lsocket -lm -lpthread
- DEBUG?=-g -ggdb
+ DEBUG?=-g -ggdb
+else
+ifeq ($(uname_S),Haiku)
+ CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF)
+ CCLINK?=-lroot -lnetwork
+ DEBUG?=-g -ggdb
else
CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF)
CCLINK?=-lm -pthread
DEBUG?=-g -rdynamic -ggdb
endif
+endif
ifeq ($(USE_TCMALLOC),yes)
ALLOD_DEPS=
diff --git redis-2.9.0-git/src/aof.c redis-2.9.0-git/src/aof.c
index dbd0468..7a5d21f 100644
--- redis-2.9.0-git/src/aof.c
+++ redis-2.9.0-git/src/aof.c
@@ -25,7 +25,7 @@ void stopAppendOnly(void) {
int statloc;
if (kill(server.bgrewritechildpid,SIGKILL) != -1)
- wait3(&statloc,0,NULL);
+ waitpid(&statloc,0,NULL);
/* reset the buffer accumulating changes while the child saves */
sdsfree(server.bgrewritebuf);
server.bgrewritebuf = sdsempty();
diff --git redis-2.9.0-git/src/redis.c redis-2.9.0-git/src/redis.c
index 1a1f84f..4ecc873 100644
--- redis-2.9.0-git/src/redis.c
+++ redis-2.9.0-git/src/redis.c
@@ -646,7 +646,7 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
int statloc;
pid_t pid;
- if ((pid = wait3(&statloc,WNOHANG,NULL)) != 0) {
+ if ((pid = waitpid(&statloc,WNOHANG,NULL)) != 0) {
int exitcode = WEXITSTATUS(statloc);
int bysignal = 0;
diff --git redis-2.9.0-git/src/sha1.c redis-2.9.0-git/src/sha1.c
index 26a5565..e90812e 100644
--- redis-2.9.0-git/src/sha1.c
+++ redis-2.9.0-git/src/sha1.c
@@ -27,6 +27,9 @@ A million repetitions of "a"
#if defined(__sun)
#include "solarisfixes.h"
#endif
+#ifdef __HAIKU__
+#include <stdint.h>
+#endif
#include "sha1.h"
#include "config.h"
diff --git redis-2.9.0-git/src/util.c redis-2.9.0-git/src/util.c
index f5a23af..2a6d18d 100644
--- redis-2.9.0-git/src/util.c
+++ redis-2.9.0-git/src/util.c
@@ -317,7 +317,7 @@ int d2string(char *buf, size_t len, double value) {
* integer printing function that is much faster. */
double min = -4503599627370495; /* (2^52)-1 */
double max = 4503599627370496; /* -(2^52) */
- if (val > min && val < max && value == ((double)((long long)value)))
+ if (value > min && value < max && value == ((double)((long long)value)))
len = ll2string(buf,len,(long long)value);
else
#endif

View File

@@ -0,0 +1,102 @@
From 4496da13ed6db5eb5e823902e6aac90cc753a0f1 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Thu, 8 Jun 2017 00:17:54 +0200
Subject: fix build
diff --git a/deps/hiredis/net.c b/deps/hiredis/net.c
index bdb84ce..8dc1586 100644
--- a/deps/hiredis/net.c
+++ b/deps/hiredis/net.c
@@ -138,7 +138,7 @@ int redisKeepAlive(redisContext *c, int interval) {
return REDIS_ERR;
}
#else
-#ifndef __sun
+#if !defined(__sun) && !defined(__HAIKU__)
val = interval;
if (setsockopt(fd, IPPROTO_TCP, TCP_KEEPIDLE, &val, sizeof(val)) < 0) {
__redisSetError(c,REDIS_ERR_OTHER,strerror(errno));
diff --git a/src/Makefile b/src/Makefile
index fdbe36a..a07a545 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -64,6 +64,11 @@ ifeq ($(uname_S),SunOS)
FINAL_CFLAGS+= -D__EXTENSIONS__ -D_XPG6
FINAL_LIBS+= -ldl -lnsl -lsocket -lresolv -lpthread -lrt
else
+ifeq ($(uname_S),Haiku)
+ CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -Wall -W $(ARCH) $(PROF)
+ CCLINK?=-lroot -lnetwork
+ DEBUG?=-g -ggdb
+else
ifeq ($(uname_S),Darwin)
# Darwin
FINAL_LIBS+= -ldl
@@ -89,6 +94,7 @@ endif
endif
endif
endif
+endif
# Include paths to dependencies
FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src
diff --git a/src/aof.c b/src/aof.c
index cbd906c..3d28b47 100644
--- a/src/aof.c
+++ b/src/aof.c
@@ -221,7 +221,7 @@ void stopAppendOnly(void) {
serverLog(LL_NOTICE,"Killing running AOF rewrite child: %ld",
(long) server.aof_child_pid);
if (kill(server.aof_child_pid,SIGUSR1) != -1) {
- while(wait3(&statloc,0,NULL) != server.aof_child_pid);
+ while(waitpid(&statloc,0,NULL) != server.aof_child_pid);
}
/* reset the buffer accumulating changes while the child saves */
aofRewriteBufferReset();
diff --git a/src/sentinel.c b/src/sentinel.c
index 0168aa6..717d7e9 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -796,7 +796,7 @@ void sentinelCollectTerminatedScripts(void) {
int statloc;
pid_t pid;
- while ((pid = wait3(&statloc,WNOHANG,NULL)) > 0) {
+ while ((pid = waitpid(&statloc,WNOHANG,NULL)) > 0) {
int exitcode = WEXITSTATUS(statloc);
int bysignal = 0;
listNode *ln;
@@ -808,7 +808,7 @@ void sentinelCollectTerminatedScripts(void) {
ln = sentinelGetScriptListNodeByPid(pid);
if (ln == NULL) {
- serverLog(LL_WARNING,"wait3() returned a pid (%ld) we can't find in our scripts execution queue!", (long)pid);
+ serverLog(LL_WARNING,"waitpid() returned a pid (%ld) we can't find in our scripts execution queue!", (long)pid);
continue;
}
sj = ln->value;
diff --git a/src/server.c b/src/server.c
index 609f396..09f246f 100644
--- a/src/server.c
+++ b/src/server.c
@@ -1185,14 +1185,14 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) {
int statloc;
pid_t pid;
- if ((pid = wait3(&statloc,WNOHANG,NULL)) != 0) {
+ if ((pid = waitpid(&statloc,WNOHANG,NULL)) != 0) {
int exitcode = WEXITSTATUS(statloc);
int bysignal = 0;
if (WIFSIGNALED(statloc)) bysignal = WTERMSIG(statloc);
if (pid == -1) {
- serverLog(LL_WARNING,"wait3() returned an error: %s. "
+ serverLog(LL_WARNING,"waitpid() returned an error: %s. "
"rdb_child_pid = %d, aof_child_pid = %d",
strerror(errno),
(int) server.rdb_child_pid,
--
2.7.0

View File

@@ -1,26 +0,0 @@
HOMEPAGE="http://redis.io/"
DESCRIPTION="
Redis is an open source, advanced key-value store. It is often referred to as \
a data structure server since keys can contain strings, hashes, lists, sets \
and sorted sets.
"
SOURCE_URI="git://github.com/antirez/redis.git"
REVISION="1"
DEPEND=""
STATUS_HAIKU="stable"
# CHECKSUM_MD5= "5501c90ca02ae7ea93c34f067b3e0619"
MESSAGE="This port only builds with gcc4. Use 'setgcc gcc4' before building."
BUILD()
{
cd redis-2.9.0-git
make PREFIX=`finddir B_COMMON_DIRECTORY`
}
INSTALL()
{
cd redis-2.9.0-git
make install PREFIX=`finddir B_COMMON_DIRECTORY`
}
LICENSE="BSD (3-clause)"
COPYRIGHT="2006-2010 Salvatore Sanfilippo"

View File

@@ -0,0 +1,50 @@
SUMMARY="Advanced key-value store"
DESCRIPTION="Redis is an open source, advanced key-value store. It is often \
referred to as a data structure server since keys can contain strings, hashes,\
lists, sets and sorted sets."
COPYRIGHT="2006-2010 Salvatore Sanfilippo"
LICENSE="BSD (3-clause)"
REVISION="1"
HOMEPAGE="http://redis.io/"
SOURCE_URI="http://download.redis.io/releases/redis-$portVersion.tar.gz"
CHECKSUM_SHA256="6eaacfa983b287e440d0839ead20c2231749d5d6b78bbe0e0ffa3a890c59ff26"
PATCHES="redis-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
redis$secondaryArchSuffix = $portVersion
cmd:redis_benchmark
cmd:redis_check_aof
cmd:redis_check_rdb
cmd:redis_cli
cmd:redis_sentinel
cmd:redis_server
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:awk
cmd:libtoolize$secondaryArchSuffix
cmd:gcc$secondaryArchSuffix
cmd:make
"
BUILD()
{
make PREFIX=$binDir LDFLAGS=-lnetwork
}
INSTALL()
{
make install
}