Skip to content

Commit

Permalink
redis: add redis 6.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
zegeek committed May 6, 2024
1 parent 8e95ace commit 7a1914d
Show file tree
Hide file tree
Showing 19 changed files with 702 additions and 0 deletions.
1 change: 1 addition & 0 deletions dev-db/redis/Manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DIST redis-6.2.5.tar.gz 2465302 BLAKE2B 51cc672ab432bb87560151521289d04e8fefb8e4df820f58a9b742131a0f1960c0019dec42a601bad827ec2a172375b88b6cf32a19aef42964e18f5a7a911c40 SHA512 8c54451032cbb627ec2827251556cba2010e56544baca7ea117b5afd2c2add484acbedd3baf21bdb8fd10672602cf52294a4e26b135c1406d7a723c048275e3a
66 changes: 66 additions & 0 deletions dev-db/redis/files/configure.ac-3.2
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.63)
AC_INIT(redis, 3.2.3, [email protected])
AM_CFLAGS="-std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6"
if test x"$CFLAGS" = x""; then
AM_CFLAGS="$AM_CFLAGS -O2"
else
AM_CFLAGS="$AM_CFLAGS $CFLAGS"
fi

# options
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug data generation (def=no)])],
[debugit="$enableval"],
[debugit=no])
AC_MSG_RESULT([$debugit])

if test x"$debugit" = x"yes"; then
AC_DEFINE([DEBUG],[],[Debug Mode])
AM_CFLAGS="$AM_CFLAGS -g -rdynamic -ggdb"
else
AC_DEFINE([NDEBUG],[],[No-debug Mode])
fi
AC_SUBST([AM_CFLAGS])

# Checks for programs.
AC_PROG_CC

# Checks for libraries.

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T

# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_STRCOLL
AC_FUNC_STRTOD
AC_CHECK_FUNCS([dup2 gethostbyname gettimeofday inet_ntoa memchr memmove memset select socket strcasecmp strchr strerror strstr strtol])

# Check for lua-5.1 or luajit
AC_ARG_WITH([luajit],
AS_HELP_STRING([--with-luajit], [Use luajit instead of lua]))

AS_IF([test "x$with_luajit" = "xyes"],
[PKG_CHECK_MODULES([LUA], [luajit >= 2], [], [AC_MSG_ERROR([luajit requested but not found])])],
[PKG_CHECK_MODULES([LUA], [lua5.1], [], [AC_MSG_ERROR([lua-5.1 required but not found])])])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT
58 changes: 58 additions & 0 deletions dev-db/redis/files/configure.ac-7.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.63)
AC_INIT(redis, __PV__, [email protected])
AM_CFLAGS="-std=c99 -pedantic -Wall -W -D__EXTENSIONS__ -D_XPG6"
if test x"$CFLAGS" = x""; then
AM_CFLAGS="$AM_CFLAGS -O2"
else
AM_CFLAGS="$AM_CFLAGS $CFLAGS"
fi

# options
AC_MSG_CHECKING([whether to build with debug information])
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debug data generation (def=no)])],
[debugit="$enableval"],
[debugit=no])
AC_MSG_RESULT([$debugit])

if test x"$debugit" = x"yes"; then
AC_DEFINE([DEBUG],[],[Debug Mode])
AM_CFLAGS="$AM_CFLAGS -g -rdynamic -ggdb"
else
AC_DEFINE([NDEBUG],[],[No-debug Mode])
fi
AC_SUBST([AM_CFLAGS])

# Checks for programs.
AC_PROG_CC

# Checks for libraries.

# Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h inttypes.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T

# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_STRCOLL
AC_FUNC_STRTOD
AC_CHECK_FUNCS([dup2 gethostbyname gettimeofday inet_ntoa memchr memmove memset select socket strcasecmp strchr strerror strstr strtol])

AC_CONFIG_FILES([Makefile])
AC_OUTPUT
40 changes: 40 additions & 0 deletions dev-db/redis/files/redis-6.2.1-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/redis.conf b/redis.conf
index 465d56f..ef56037 100644
--- a/redis.conf
+++ b/redis.conf
@@ -276,7 +276,7 @@ daemonize no
#
# Note that on modern Linux systems "/run/redis.pid" is more conforming
# and should be used instead.
-pidfile /var/run/redis_6379.pid
+pidfile /run/redis/redis.pid

# Specify the server verbosity level.
# This can be one of:
@@ -289,7 +289,7 @@ loglevel notice
# Specify the log file name. Also the empty string can be used to force
# Redis to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
-logfile ""
+logfile /var/log/redis/redis.log

# To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs.
@@ -441,7 +441,7 @@ rdb-del-sync-files no
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
-dir ./
+dir /var/lib/redis/

################################# REPLICATION #################################

@@ -967,7 +967,7 @@ acllog-max-len 128
# limit for maxmemory so that there is some free RAM on the system for replica
# output buffers (but this is not needed if the policy is 'noeviction').
#
-# maxmemory <bytes>
+maxmemory 64MB

# MAXMEMORY POLICY: how Redis will select what to remove when maxmemory
# is reached. You can select one from the following behaviors:
60 changes: 60 additions & 0 deletions dev-db/redis/files/redis-6.2.1-sharedlua.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
diff --git a/deps/lua/src/lua_cjson.c b/deps/lua/src/lua_cjson.c
index c26c0d7..fa50c41 100644
--- a/deps/lua/src/lua_cjson.c
+++ b/deps/lua/src/lua_cjson.c
@@ -46,7 +46,7 @@
#include "strbuf.h"
#include "fpconv.h"

-#include "../../../src/solarisfixes.h"
+#include "solarisfixes.h"

#ifndef CJSON_MODNAME
#define CJSON_MODNAME "cjson"
diff --git a/src/Makefile b/src/Makefile
index 6f0fd84..6546b5d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -16,7 +16,7 @@ release_hdr := $(shell sh -c './mkreleasehdr.sh')
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not')
OPTIMIZATION?=-O2
-DEPENDENCY_TARGETS=hiredis linenoise lua hdr_histogram
+DEPENDENCY_TARGETS=hiredis linenoise hdr_histogram
NODEPS:=clean distclean

# Default settings
@@ -84,6 +84,7 @@ endif
FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
FINAL_LIBS=-lm
+FINAL_LIBS+=@LUA_LIBS@
DEBUG=-g -ggdb

# Linux ARM needs -latomic at linking time
@@ -186,7 +187,7 @@ endif
endif
endif
# Include paths to dependencies
-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram
+FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise @LUA_CFLAGS@ -I../deps/hdr_histogram

# Determine systemd support and/or build preference (defaulting to auto-detection)
BUILD_WITH_SYSTEMD=no
@@ -268,6 +269,7 @@ endif
REDIS_SERVER_NAME=redis-server$(PROG_SUFFIX)
REDIS_SENTINEL_NAME=redis-sentinel$(PROG_SUFFIX)
REDIS_SERVER_OBJ=adlist.o quicklist.o ae.o anet.o dict.o server.o sds.o zmalloc.o lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o networking.o util.o object.o db.o replication.o rdb.o t_string.o t_list.o t_set.o t_zset.o t_hash.o config.o aof.o pubsub.o multi.o debug.o sort.o intset.o syncio.o cluster.o crc16.o endianconv.o slowlog.o scripting.o bio.o rio.o rand.o memtest.o crcspeed.o crc64.o bitops.o sentinel.o notify.o setproctitle.o blocked.o hyperloglog.o latency.o sparkline.o redis-check-rdb.o redis-check-aof.o geo.o lazyfree.o module.o evict.o expire.o geohash.o geohash_helper.o childinfo.o defrag.o siphash.o rax.o t_stream.o listpack.o localtime.o lolwut.o lolwut5.o lolwut6.o acl.o gopher.o tracking.o connection.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o
+REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o
REDIS_CLI_NAME=redis-cli$(PROG_SUFFIX)
REDIS_CLI_OBJ=anet.o adlist.o dict.o redis-cli.o zmalloc.o release.o ae.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o
REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
@@ -321,7 +323,7 @@ endif

# redis-server
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS)
+ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(FINAL_LIBS)

# redis-sentinel
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
19 changes: 19 additions & 0 deletions dev-db/redis/files/redis-6.2.3-ppc-atomic.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/src/Makefile b/src/Makefile
index 5b2cf1c..9e1239d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -87,6 +87,14 @@ FINAL_LIBS=-lm
FINAL_LIBS+=@LUA_LIBS@
DEBUG=-g -ggdb

+ifneq (,$(filter powerpc ppc,$(uname_M)))
+ FINAL_LIBS+=-latomic
+else
+ifneq (,$(findstring ppc,$(uname_M)))
+ FINAL_LIBS+=-latomic
+endif
+endif
+
# Linux ARM32 needs -latomic at linking time
ifneq (,$(findstring armv,$(uname_M)))
FINAL_LIBS+=-latomic
66 changes: 66 additions & 0 deletions dev-db/redis/files/redis-7.0.4-no-which.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
--- a/runtest
+++ b/runtest
@@ -3,7 +3,7 @@ TCL_VERSIONS="8.5 8.6 8.7"
TCLSH=""

for VERSION in $TCL_VERSIONS; do
- TCL=`which tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
+ TCL=`command -v tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
done

if [ -z $TCLSH ]
--- a/runtest-cluster
+++ b/runtest-cluster
@@ -3,7 +3,7 @@ TCL_VERSIONS="8.5 8.6 8.7"
TCLSH=""

for VERSION in $TCL_VERSIONS; do
- TCL=`which tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
+ TCL=`command -v tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
done

if [ -z $TCLSH ]
--- a/runtest-moduleapi
+++ b/runtest-moduleapi
@@ -4,7 +4,7 @@ TCLSH=""
[ -z "$MAKE" ] && MAKE=make

for VERSION in $TCL_VERSIONS; do
- TCL=`which tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
+ TCL=`command -v tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
done

if [ -z $TCLSH ]
--- a/runtest-sentinel
+++ b/runtest-sentinel
@@ -3,7 +3,7 @@ TCL_VERSIONS="8.5 8.6 8.7"
TCLSH=""

for VERSION in $TCL_VERSIONS; do
- TCL=`which tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
+ TCL=`command -v tclsh$VERSION 2>/dev/null` && TCLSH=$TCL
done

if [ -z $TCLSH ]
--- a/utils/generate-module-api-doc.rb
+++ b/utils/generate-module-api-doc.rb
@@ -164,7 +164,7 @@ end
# Populate the 'since' map (name => version) if we're in a git repo.
$since = {}
git_dir = File.dirname(__FILE__) ++ "/../.git"
-if File.directory?(git_dir) && `which git` != ""
+if File.directory?(git_dir) && `comamnd -v git` != ""
`git --git-dir="#{git_dir}" tag --sort=v:refname`.each_line do |version|
next if version !~ /^(\d+)\.\d+\.\d+?$/ || $1.to_i < 4
version.chomp!
--- a/src/Makefile
+++ b/src/Makefile
@@ -52,7 +52,7 @@ INSTALL=install
PKG_CONFIG?=pkg-config

ifndef PYTHON
-PYTHON := $(shell which python3 || which python)
+PYTHON := $(shell command -v python3 || command -v python)
endif

# Default allocator defaults to Jemalloc if it's not an ARM
33 changes: 33 additions & 0 deletions dev-db/redis/files/redis-7.2.0-system-jemalloc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Rebased from original redis-5.0-shared.patch

diff --git a/src/Makefile b/src/Makefile
index ecbd2753d..275446338 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -65,10 +65,7 @@ PYTHON := $(shell which python3 || which python)
endif

# Default allocator defaults to Jemalloc on Linux and libc otherwise
-MALLOC=libc
-ifeq ($(uname_S),Linux)
- MALLOC=jemalloc
-endif
+MALLOC?=jemalloc

# To get ARM stack traces if Redis crashes we need a special C flag.
ifneq (,$(filter aarch64 armv%,$(uname_M)))
@@ -266,9 +263,8 @@ ifeq ($(MALLOC),tcmalloc_minimal)
endif

ifeq ($(MALLOC),jemalloc)
- DEPENDENCY_TARGETS+= jemalloc
- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include
- FINAL_LIBS := ../deps/jemalloc/lib/libjemalloc.a $(FINAL_LIBS)
+ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE
+ FINAL_LIBS+= -ljemalloc -ldl
endif

# LIBSSL & LIBCRYPTO
--
2.41.0

19 changes: 19 additions & 0 deletions dev-db/redis/files/redis-sentinel-5.0-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/sentinel.conf b/sentinel.conf
index bc9a705..05e58d3 100644
--- a/sentinel.conf
+++ b/sentinel.conf
@@ -28,12 +28,12 @@ daemonize no
# When running daemonized, Redis Sentinel writes a pid file in
# /var/run/redis-sentinel.pid by default. You can specify a custom pid file
# location here.
-pidfile /var/run/redis-sentinel.pid
+pidfile /run/redis-sentinel.pid

# Specify the log file name. Also the empty string can be used to force
# Sentinel to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
-logfile ""
+logfile "/var/log/redis/sentinel.log"

# sentinel announce-ip <ip>
# sentinel announce-port <port>
27 changes: 27 additions & 0 deletions dev-db/redis/files/redis-sentinel-7.2.0-config.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Rebased from original redis-sentinel-5.0-config.patch

diff --git a/sentinel.conf b/sentinel.conf
index b7b3604f0..a1d7bfea9 100644
--- a/sentinel.conf
+++ b/sentinel.conf
@@ -17,7 +17,7 @@ daemonize no
# When running daemonized, Redis Sentinel writes a pid file in
# /var/run/redis-sentinel.pid by default. You can specify a custom pid file
# location here.
-pidfile /var/run/redis-sentinel.pid
+pidfile /run/redis-sentinel.pid

# Specify the server verbosity level.
# This can be one of:
@@ -31,7 +31,7 @@ loglevel notice
# Specify the log file name. Also the empty string can be used to force
# Sentinel to log on the standard output. Note that if you use standard
# output for logging but daemonize, logs will be sent to /dev/null
-logfile ""
+logfile "/var/log/redis/sentinel.log"

# To enable logging to the system logger, just set 'syslog-enabled' to yes,
# and optionally update the other syslog parameters to suit your needs.
--
2.41.0

Loading

0 comments on commit 7a1914d

Please sign in to comment.