mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-16 07:58:04 +00:00
databases/redis*: Refine ports
* Alway build with base system compiler. In 2018 Makefile was changed so GCC is used with i386. It seems to be workaround of build error, But now build succeeds without GCC on i386 and all supported FreeBSD versions. * Remove options for external lua library and related patches. On April 2022 upstream made incompatible change of bundled lua library to fix vulnerability. As a result build got failed when external lua library is enabled. Upstream said in commit message of their repository that they took codes from lua repository. So I kept the options with marking as broken hoping breakage will be solved in the future. But it is still broken after two years and doesn't seem to change. * Remove TRIB option. When it is enabled ruby script named redis-trib.rb is installed. But it just prints warning message that it is no longer available and redis-cli should be used instead, and exit. So it isn't usefull anymore. * Fix post-patch-JEMALLOC-on target so proper line is replaced. * Pet portclippy.
This commit is contained in:
parent
59889eeb5d
commit
81b6dcb645
@ -1,5 +1,6 @@
|
||||
PORTNAME= redis
|
||||
DISTVERSION= 7.2.4.20240229
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= databases
|
||||
PKGNAMESUFFIX= -devel
|
||||
|
||||
@ -14,76 +15,16 @@ USES+= compiler:c11 cpe gmake tcl:test
|
||||
CPE_VENDOR= redislabs
|
||||
USE_GITHUB= yes
|
||||
GH_TAGNAME= f17381a38
|
||||
USE_RC_SUBR= redis sentinel
|
||||
|
||||
MAKE_ENV= OPTIMIZATION= \
|
||||
V=yo
|
||||
|
||||
LDFLAGS+= -lpthread -lm -lexecinfo
|
||||
|
||||
CONFLICTS_INSTALL= redis redis6 redis62 redis70 # etc/rc.d/redis
|
||||
|
||||
PORTSCOUT= ignore:1
|
||||
|
||||
OPTIONS_DEFINE= JEMALLOC TLS TRIB
|
||||
OPTIONS_DEFAULT= TLS
|
||||
OPTIONS_RADIO= EXTLUA
|
||||
OPTIONS_RADIO_EXTLUA= LUA LUAJIT
|
||||
OPTIONS_SUB= yes
|
||||
|
||||
JEMALLOC_DESC= Use jemalloc
|
||||
LUAJIT_DESC= Use luajit instead of builtin lua
|
||||
LUA_DESC= Use lang/lua instead of builtin lua
|
||||
TLS_DESC= Use TLS (openssl req.)
|
||||
TRIB_DESC= Install redis-trib.rb (lang/ruby req.)
|
||||
|
||||
JEMALLOC_MAKE_ENV= USE_JEMALLOC=yes
|
||||
LUAJIT_BROKEN= Fails to link
|
||||
LUAJIT_USES= luajit
|
||||
LUAJIT_VARS= _ADDFLAGS=true
|
||||
LUA_BROKEN= Fails to link
|
||||
LUA_USES= lua:51
|
||||
LUA_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.lua
|
||||
LUA_VARS= _ADDFLAGS=true
|
||||
TLS_USES= ssl
|
||||
TLS_MAKE_ENV= BUILD_TLS=yes
|
||||
TRIB_CATEGORIES= ruby
|
||||
TRIB_RUN_DEPENDS= rubygem-redis>=2.2:databases/rubygem-redis
|
||||
TRIB_USES= ruby
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${ARCH} == i386 && !${CFLAGS:M-march=*}
|
||||
# Needed for __atomic_fetch_add_8
|
||||
USE_GCC= yes
|
||||
CFLAGS+= -march=i586
|
||||
.endif
|
||||
|
||||
.if defined(_ADDFLAGS)
|
||||
CFLAGS+= -fPIC
|
||||
LDFLAGS+= -Wl,-E
|
||||
.endif
|
||||
|
||||
.if ${PORT_OPTIONS:MLUAJIT}
|
||||
. if ${LUAJIT_VER} == luajit
|
||||
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.luajit
|
||||
. else
|
||||
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.luajit-or \
|
||||
${PATCHDIR}/extra-patch-src-function_lua.c \
|
||||
${PATCHDIR}/extra-patch-deps_lua_src_lua__cjson.c
|
||||
. endif
|
||||
.endif
|
||||
|
||||
LDFLAGS+= -lpthread -lm -lexecinfo
|
||||
|
||||
USE_RC_SUBR= redis sentinel
|
||||
BIN_FILES= redis-benchmark redis-check-aof redis-check-rdb redis-cli \
|
||||
redis-sentinel redis-server
|
||||
|
||||
USERS= redis
|
||||
GROUPS= redis
|
||||
|
||||
REDIS_DBDIR?= /var/db/redis
|
||||
REDIS_RUNDIR?= /var/run/redis
|
||||
REDIS_LOGDIR?= /var/log/redis
|
||||
|
||||
SUB_FILES= pkg-message
|
||||
SUB_LIST+= PORTNAME=${PORTNAME} \
|
||||
REDIS_DBDIR=${REDIS_DBDIR} \
|
||||
@ -91,22 +32,35 @@ SUB_LIST+= PORTNAME=${PORTNAME} \
|
||||
REDIS_RUNDIR=${REDIS_RUNDIR} \
|
||||
REDIS_USER=${USERS}
|
||||
|
||||
USERS= redis
|
||||
GROUPS= redis
|
||||
|
||||
PLIST_SUB+= REDIS_DBDIR=${REDIS_DBDIR} \
|
||||
REDIS_GROUP=${GROUPS} \
|
||||
REDIS_LOGDIR=${REDIS_LOGDIR} \
|
||||
REDIS_RUNDIR=${REDIS_RUNDIR} \
|
||||
REDIS_USER=${USERS}
|
||||
|
||||
post-patch:
|
||||
${REINPLACE_CMD} '77s!malloc.h!stdlib.h!' ${WRKSRC}/src/zmalloc.h
|
||||
OPTIONS_DEFINE= JEMALLOC TLS
|
||||
OPTIONS_DEFAULT= TLS
|
||||
OPTIONS_SUB= yes
|
||||
|
||||
JEMALLOC_DESC= Use jemalloc
|
||||
TLS_DESC= Use TLS (openssl req.)
|
||||
|
||||
JEMALLOC_MAKE_ENV= USE_JEMALLOC=yes
|
||||
TLS_USES= ssl
|
||||
TLS_MAKE_ENV= BUILD_TLS=yes
|
||||
|
||||
BIN_FILES= redis-benchmark redis-check-aof redis-check-rdb redis-cli \
|
||||
redis-sentinel redis-server
|
||||
|
||||
REDIS_DBDIR?= /var/db/redis
|
||||
REDIS_RUNDIR?= /var/run/redis
|
||||
REDIS_LOGDIR?= /var/log/redis
|
||||
|
||||
post-patch-JEMALLOC-on:
|
||||
@${REINPLACE_CMD} '35s!Linux!FreeBSD!g' ${WRKSRC}/src/Makefile
|
||||
|
||||
post-patch-LUA-on:
|
||||
@cd ${WRKSRC}/deps/lua/src && ${CP} fpconv.* lua_* strbuf.* ${WRKSRC}/src/
|
||||
post-patch-LUAJIT-on: post-patch-LUA-on
|
||||
post-patch-LUAJITOR-on: post-patch-LUA-on
|
||||
@${REINPLACE_CMD} '72s!Linux!FreeBSD!g' ${WRKSRC}/src/Makefile
|
||||
|
||||
post-build:
|
||||
${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@ -120,10 +74,7 @@ do-install:
|
||||
${STAGEDIR}${REDIS_DBDIR} \
|
||||
${STAGEDIR}${REDIS_RUNDIR}
|
||||
|
||||
do-install-TRIB-on:
|
||||
${INSTALL_SCRIPT} ${WRKSRC}/src/redis-trib.rb ${STAGEDIR}${PREFIX}/bin/
|
||||
|
||||
do-test:
|
||||
@cd ${WRKSRC} && ${TCLSH} tests/test_helper.tcl
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- deps/lua/src/lua_cjson.c.orig 2019-12-08 12:56:31 UTC
|
||||
+++ deps/lua/src/lua_cjson.c
|
||||
@@ -1299,7 +1299,7 @@
|
||||
*
|
||||
* luaL_setfuncs() is used to create a module table where the functions have
|
||||
* json_config_t as their first upvalue. Code borrowed from Lua 5.2 source. */
|
||||
-static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
|
||||
+void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
|
||||
{
|
||||
int i;
|
||||
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2024-02-29 22:26:29 UTC
|
||||
+++ src/Makefile
|
||||
@@ -28,7 +28,7 @@
|
||||
ifneq ($(OPTIMIZATION),-O0)
|
||||
REDIS_CFLAGS+=-fno-omit-frame-pointer
|
||||
endif
|
||||
-DEPENDENCY_TARGETS=hiredis linenoise lua hdr_histogram fpconv
|
||||
+DEPENDENCY_TARGETS=hiredis linenoise hdr_histogram fpconv
|
||||
NODEPS:=clean distclean
|
||||
|
||||
# Default settings
|
||||
@@ -119,8 +119,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
|
||||
# Linux ARM32 needs -latomic at linking time
|
||||
@@ -234,7 +234,7 @@
|
||||
endif
|
||||
|
||||
# Include paths to dependencies
|
||||
-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/fpconv
|
||||
+FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/hdr_histogram -I../deps/fpconv
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -325,6 +325,9 @@
|
||||
endef
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/lua51
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -llua-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -354,6 +357,7 @@
|
||||
REDIS_SERVER_NAME=redis-server$(PROG_SUFFIX)
|
||||
REDIS_SENTINEL_NAME=redis-sentinel$(PROG_SUFFIX)
|
||||
REDIS_SERVER_OBJ=threads_mngr.o adlist.o quicklist.o ae.o anet.o dict.o kvstore.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 cluster_legacy.o crc16.o endianconv.o slowlog.o eval.o bio.o rio.o rand.o memtest.o syscheck.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 tracking.o socket.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o strl.o connection.o unix.o logreqres.o
|
||||
+REDIS_SERVER_OBJ+=fpconv.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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 redisassert.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o strl.o cli_commands.o
|
||||
REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
|
||||
@@ -408,7 +412,7 @@
|
||||
|
||||
# redis-server
|
||||
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
|
||||
- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
+ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
|
||||
# redis-sentinel
|
||||
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2024-02-29 22:30:22 UTC
|
||||
+++ src/Makefile
|
||||
@@ -28,7 +28,7 @@
|
||||
ifneq ($(OPTIMIZATION),-O0)
|
||||
REDIS_CFLAGS+=-fno-omit-frame-pointer
|
||||
endif
|
||||
-DEPENDENCY_TARGETS=hiredis linenoise lua hdr_histogram fpconv
|
||||
+DEPENDENCY_TARGETS=hiredis linenoise hdr_histogram fpconv
|
||||
NODEPS:=clean distclean
|
||||
|
||||
# Default settings
|
||||
@@ -119,8 +119,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
|
||||
# Linux ARM32 needs -latomic at linking time
|
||||
@@ -234,7 +234,7 @@
|
||||
endif
|
||||
|
||||
# Include paths to dependencies
|
||||
-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/fpconv
|
||||
+FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/hdr_histogram -I../deps/fpconv
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -325,6 +325,9 @@
|
||||
endef
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/luajit-2.0
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -lluajit-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -354,6 +357,7 @@
|
||||
REDIS_SERVER_NAME=redis-server$(PROG_SUFFIX)
|
||||
REDIS_SENTINEL_NAME=redis-sentinel$(PROG_SUFFIX)
|
||||
REDIS_SERVER_OBJ=threads_mngr.o adlist.o quicklist.o ae.o anet.o dict.o kvstore.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 cluster_legacy.o crc16.o endianconv.o slowlog.o eval.o bio.o rio.o rand.o memtest.o syscheck.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 tracking.o socket.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o strl.o connection.o unix.o logreqres.o
|
||||
+REDIS_SERVER_OBJ+=fpconv.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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 redisassert.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o strl.o cli_commands.o
|
||||
REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
|
||||
@@ -408,7 +412,7 @@
|
||||
|
||||
# redis-server
|
||||
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
|
||||
- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
+ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
|
||||
# redis-sentinel
|
||||
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2024-02-29 22:32:43 UTC
|
||||
+++ src/Makefile
|
||||
@@ -28,7 +28,7 @@
|
||||
ifneq ($(OPTIMIZATION),-O0)
|
||||
REDIS_CFLAGS+=-fno-omit-frame-pointer
|
||||
endif
|
||||
-DEPENDENCY_TARGETS=hiredis linenoise lua hdr_histogram fpconv
|
||||
+DEPENDENCY_TARGETS=hiredis linenoise hdr_histogram fpconv
|
||||
NODEPS:=clean distclean
|
||||
|
||||
# Default settings
|
||||
@@ -119,8 +119,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
|
||||
# Linux ARM32 needs -latomic at linking time
|
||||
@@ -234,7 +234,7 @@
|
||||
endif
|
||||
|
||||
# Include paths to dependencies
|
||||
-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/fpconv
|
||||
+FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/hdr_histogram -I../deps/fpconv
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -325,6 +325,9 @@
|
||||
endef
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/luajit-2.1
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -lluajit-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -354,6 +357,7 @@
|
||||
REDIS_SERVER_NAME=redis-server$(PROG_SUFFIX)
|
||||
REDIS_SENTINEL_NAME=redis-sentinel$(PROG_SUFFIX)
|
||||
REDIS_SERVER_OBJ=threads_mngr.o adlist.o quicklist.o ae.o anet.o dict.o kvstore.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 cluster_legacy.o crc16.o endianconv.o slowlog.o eval.o bio.o rio.o rand.o memtest.o syscheck.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 tracking.o socket.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o strl.o connection.o unix.o logreqres.o
|
||||
+REDIS_SERVER_OBJ+=fpconv.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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 redisassert.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o strl.o cli_commands.o
|
||||
REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
|
||||
@@ -408,7 +412,7 @@
|
||||
|
||||
# redis-server
|
||||
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
|
||||
- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
+ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
|
||||
# redis-sentinel
|
||||
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
|
@ -1,13 +0,0 @@
|
||||
--- src/function_lua.c.orig 2022-01-31 10:49:57 UTC
|
||||
+++ src/function_lua.c
|
||||
@@ -52,6 +52,10 @@
|
||||
#define LIBRARY_API_NAME "__LIBRARY_API__"
|
||||
#define LOAD_TIMEOUT_MS 500
|
||||
|
||||
+#ifndef lua_unref
|
||||
+#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))
|
||||
+#endif
|
||||
+
|
||||
/* Lua engine ctx */
|
||||
typedef struct luaEngineCtx {
|
||||
lua_State *lua;
|
@ -4,7 +4,6 @@ bin/redis-check-rdb
|
||||
bin/redis-cli
|
||||
bin/redis-sentinel
|
||||
bin/redis-server
|
||||
%%TRIB%%bin/redis-trib.rb
|
||||
@sample etc/redis.conf.sample
|
||||
@sample(%%REDIS_USER%%,%%REDIS_GROUP%%,) etc/sentinel.conf.sample
|
||||
@dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_DBDIR%%
|
||||
|
@ -1,5 +1,6 @@
|
||||
PORTNAME= redis
|
||||
DISTVERSION= 7.2.4
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= databases
|
||||
MASTER_SITES= https://download.redis.io/releases/
|
||||
|
||||
@ -37,31 +38,16 @@ PLIST_SUB= REDIS_DBDIR=${REDIS_DBDIR} \
|
||||
REDIS_RUNDIR=${REDIS_RUNDIR} \
|
||||
REDIS_USER=${USERS}
|
||||
|
||||
OPTIONS_DEFINE= JEMALLOC TLS TRIB
|
||||
OPTIONS_DEFINE= JEMALLOC TLS
|
||||
OPTIONS_DEFAULT= TLS
|
||||
OPTIONS_RADIO= EXTLUA
|
||||
OPTIONS_RADIO_EXTLUA= LUA LUAJIT
|
||||
OPTIONS_SUB= yes
|
||||
|
||||
JEMALLOC_DESC= Use jemalloc
|
||||
LUAJIT_DESC= Use luajit instead of builtin lua
|
||||
LUA_DESC= Use lang/lua instead of builtin lua
|
||||
TLS_DESC= Use TLS (openssl req.)
|
||||
TRIB_DESC= Install redis-trib.rb (lang/ruby req.)
|
||||
|
||||
JEMALLOC_MAKE_ENV= USE_JEMALLOC=yes
|
||||
LUAJIT_BROKEN= Fails to link
|
||||
LUAJIT_USES= luajit
|
||||
LUAJIT_VARS= _ADDFLAGS=true
|
||||
LUA_BROKEN= Fails to link
|
||||
LUA_USES= lua:51
|
||||
LUA_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.lua
|
||||
LUA_VARS= _ADDFLAGS=true
|
||||
TLS_USES= ssl
|
||||
TLS_MAKE_ENV= BUILD_TLS=yes
|
||||
TRIB_CATEGORIES= ruby
|
||||
TRIB_RUN_DEPENDS= rubygem-redis>=2.2:databases/rubygem-redis
|
||||
TRIB_USES= ruby
|
||||
|
||||
BIN_FILES= redis-benchmark redis-check-aof redis-check-rdb redis-cli \
|
||||
redis-sentinel redis-server
|
||||
@ -70,36 +56,8 @@ REDIS_DBDIR?= /var/db/redis
|
||||
REDIS_RUNDIR?= /var/run/redis
|
||||
REDIS_LOGDIR?= /var/log/redis
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${ARCH} == i386 && !${CFLAGS:M-march=*}
|
||||
# Needed for __atomic_fetch_add_8
|
||||
USE_GCC= yes
|
||||
CFLAGS+= -march=i586
|
||||
.endif
|
||||
|
||||
.if defined(_ADDFLAGS)
|
||||
CFLAGS+= -fPIC
|
||||
LDFLAGS+= -Wl,-E
|
||||
.endif
|
||||
|
||||
.if ${PORT_OPTIONS:MLUAJIT}
|
||||
. if ${LUAJIT_VER} == luajit
|
||||
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.luajit
|
||||
. else
|
||||
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.luajit-or \
|
||||
${PATCHDIR}/extra-patch-src-function_lua.c \
|
||||
${PATCHDIR}/extra-patch-deps_lua_src_lua__cjson.c
|
||||
. endif
|
||||
.endif
|
||||
|
||||
post-patch-JEMALLOC-on:
|
||||
@${REINPLACE_CMD} '35s!Linux!FreeBSD!g' ${WRKSRC}/src/Makefile
|
||||
|
||||
post-patch-LUA-on:
|
||||
@cd ${WRKSRC}/deps/lua/src && ${CP} fpconv.* lua_* strbuf.* ${WRKSRC}/src/
|
||||
post-patch-LUAJIT-on: post-patch-LUA-on
|
||||
post-patch-LUAJITOR-on: post-patch-LUA-on
|
||||
@${REINPLACE_CMD} '69s!Linux!FreeBSD!g' ${WRKSRC}/src/Makefile
|
||||
|
||||
post-build:
|
||||
${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@ -113,10 +71,7 @@ do-install:
|
||||
${STAGEDIR}${REDIS_DBDIR} \
|
||||
${STAGEDIR}${REDIS_RUNDIR}
|
||||
|
||||
do-install-TRIB-on:
|
||||
${INSTALL_SCRIPT} ${WRKSRC}/src/redis-trib.rb ${STAGEDIR}${PREFIX}/bin/
|
||||
|
||||
do-test:
|
||||
@cd ${WRKSRC} && ${TCLSH} tests/test_helper.tcl
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- deps/lua/src/lua_cjson.c.orig 2019-12-08 12:56:31 UTC
|
||||
+++ deps/lua/src/lua_cjson.c
|
||||
@@ -1299,7 +1299,7 @@
|
||||
*
|
||||
* luaL_setfuncs() is used to create a module table where the functions have
|
||||
* json_config_t as their first upvalue. Code borrowed from Lua 5.2 source. */
|
||||
-static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
|
||||
+void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
|
||||
{
|
||||
int i;
|
||||
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2023-05-16 08:24:10 UTC
|
||||
+++ src/Makefile
|
||||
@@ -25,7 +25,7 @@
|
||||
endif
|
||||
REDIS_LDFLAGS+=-flto
|
||||
endif
|
||||
-DEPENDENCY_TARGETS=hiredis linenoise lua hdr_histogram fpconv
|
||||
+DEPENDENCY_TARGETS=hiredis linenoise hdr_histogram fpconv
|
||||
NODEPS:=clean distclean
|
||||
|
||||
# Default settings
|
||||
@@ -116,8 +116,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
|
||||
# Linux ARM32 needs -latomic at linking time
|
||||
@@ -231,7 +231,7 @@
|
||||
endif
|
||||
|
||||
# Include paths to dependencies
|
||||
-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/fpconv
|
||||
+FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/hdr_histogram -I../deps/fpconv
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -322,6 +322,9 @@
|
||||
endef
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/lua51
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -llua-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -351,6 +354,7 @@
|
||||
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 eval.o bio.o rio.o rand.o memtest.o syscheck.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 tracking.o socket.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o strl.o connection.o unix.o logreqres.o
|
||||
+REDIS_SERVER_OBJ+=fpconv.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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 redisassert.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o strl.o cli_commands.o
|
||||
REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
|
||||
@@ -405,7 +409,7 @@
|
||||
|
||||
# redis-server
|
||||
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
|
||||
- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
+ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
|
||||
# redis-sentinel
|
||||
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2023-05-16 08:28:42 UTC
|
||||
+++ src/Makefile
|
||||
@@ -25,7 +25,7 @@
|
||||
endif
|
||||
REDIS_LDFLAGS+=-flto
|
||||
endif
|
||||
-DEPENDENCY_TARGETS=hiredis linenoise lua hdr_histogram fpconv
|
||||
+DEPENDENCY_TARGETS=hiredis linenoise hdr_histogram fpconv
|
||||
NODEPS:=clean distclean
|
||||
|
||||
# Default settings
|
||||
@@ -116,8 +116,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
|
||||
# Linux ARM32 needs -latomic at linking time
|
||||
@@ -231,7 +231,7 @@
|
||||
endif
|
||||
|
||||
# Include paths to dependencies
|
||||
-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/fpconv
|
||||
+FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/hdr_histogram -I../deps/fpconv
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -322,6 +322,9 @@
|
||||
endef
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/luajit-2.0
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -lluajit-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -351,6 +354,7 @@
|
||||
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 eval.o bio.o rio.o rand.o memtest.o syscheck.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 tracking.o socket.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o strl.o connection.o unix.o logreqres.o
|
||||
+REDIS_SERVER_OBJ+=fpconv.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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 redisassert.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o strl.o cli_commands.o
|
||||
REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
|
||||
@@ -405,7 +409,7 @@
|
||||
|
||||
# redis-server
|
||||
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
|
||||
- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
+ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
|
||||
# redis-sentinel
|
||||
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2023-05-16 08:30:32 UTC
|
||||
+++ src/Makefile
|
||||
@@ -25,7 +25,7 @@
|
||||
endif
|
||||
REDIS_LDFLAGS+=-flto
|
||||
endif
|
||||
-DEPENDENCY_TARGETS=hiredis linenoise lua hdr_histogram fpconv
|
||||
+DEPENDENCY_TARGETS=hiredis linenoise hdr_histogram fpconv
|
||||
NODEPS:=clean distclean
|
||||
|
||||
# Default settings
|
||||
@@ -116,8 +116,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
|
||||
# Linux ARM32 needs -latomic at linking time
|
||||
@@ -231,7 +231,7 @@
|
||||
endif
|
||||
|
||||
# Include paths to dependencies
|
||||
-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src -I../deps/hdr_histogram -I../deps/fpconv
|
||||
+FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/hdr_histogram -I../deps/fpconv
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -322,6 +322,9 @@
|
||||
endef
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/luajit-2.1
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -lluajit-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -351,6 +354,7 @@
|
||||
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 eval.o bio.o rio.o rand.o memtest.o syscheck.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 tracking.o socket.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o strl.o connection.o unix.o logreqres.o
|
||||
+REDIS_SERVER_OBJ+=fpconv.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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 redisassert.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o strl.o cli_commands.o
|
||||
REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
|
||||
@@ -405,7 +409,7 @@
|
||||
|
||||
# redis-server
|
||||
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
|
||||
- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
+ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/hdr_histogram/libhdrhistogram.a ../deps/fpconv/libfpconv.a $(FINAL_LIBS)
|
||||
|
||||
# redis-sentinel
|
||||
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
|
@ -1,13 +0,0 @@
|
||||
--- src/function_lua.c.orig 2022-01-31 10:49:57 UTC
|
||||
+++ src/function_lua.c
|
||||
@@ -52,6 +52,10 @@
|
||||
#define LIBRARY_API_NAME "__LIBRARY_API__"
|
||||
#define LOAD_TIMEOUT_MS 500
|
||||
|
||||
+#ifndef lua_unref
|
||||
+#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))
|
||||
+#endif
|
||||
+
|
||||
/* Lua engine ctx */
|
||||
typedef struct luaEngineCtx {
|
||||
lua_State *lua;
|
@ -4,7 +4,6 @@ bin/redis-check-rdb
|
||||
bin/redis-cli
|
||||
bin/redis-sentinel
|
||||
bin/redis-server
|
||||
%%TRIB%%bin/redis-trib.rb
|
||||
@sample etc/redis.conf.sample
|
||||
@sample(%%REDIS_USER%%,%%REDIS_GROUP%%,) etc/sentinel.conf.sample
|
||||
@dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_DBDIR%%
|
||||
|
@ -1,5 +1,6 @@
|
||||
PORTNAME= redis
|
||||
DISTVERSION= 6.2.14
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= databases
|
||||
MASTER_SITES= https://download.redis.io/releases/
|
||||
PKGNAMESUFFIX= 62
|
||||
@ -14,75 +15,16 @@ LICENSE_FILE= ${WRKSRC}/COPYING
|
||||
USES+= compiler:c11 cpe gmake tcl:test
|
||||
CPE_VENDOR= redislabs
|
||||
CPE_PRODUCT= redis
|
||||
USE_RC_SUBR= redis sentinel
|
||||
|
||||
MAKE_ENV= OPTIMIZATION= \
|
||||
V=yo
|
||||
|
||||
LDFLAGS+= -lpthread -lm -lexecinfo
|
||||
|
||||
CONFLICTS_INSTALL= redis redis-devel redis6 redis70 # etc/rc.d/redis
|
||||
|
||||
PORTSCOUT= limit:^6\.2
|
||||
|
||||
OPTIONS_DEFINE= JEMALLOC TLS TRIB
|
||||
OPTIONS_DEFAULT= TLS
|
||||
OPTIONS_RADIO= EXTLUA
|
||||
OPTIONS_RADIO_EXTLUA= LUA LUAJIT
|
||||
OPTIONS_SUB= yes
|
||||
|
||||
JEMALLOC_DESC= Use jemalloc
|
||||
LUAJIT_DESC= Use luajit instead of builtin lua
|
||||
LUA_DESC= Use lang/lua instead of builtin lua
|
||||
TLS_DESC= Use TLS (openssl req.)
|
||||
TRIB_DESC= Install redis-trib.rb (lang/ruby req.)
|
||||
|
||||
JEMALLOC_MAKE_ENV= USE_JEMALLOC=yes
|
||||
LUAJIT_BROKEN= Fails to link
|
||||
LUAJIT_USES= luajit
|
||||
LUAJIT_VARS= _ADDFLAGS=true
|
||||
LUA_BROKEN= Fails to link
|
||||
LUA_USES= lua:51
|
||||
LUA_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.lua
|
||||
LUA_VARS= _ADDFLAGS=true
|
||||
TLS_USES= ssl
|
||||
TLS_MAKE_ENV= BUILD_TLS=yes
|
||||
TRIB_CATEGORIES= ruby
|
||||
TRIB_RUN_DEPENDS= rubygem-redis>=2.2:databases/rubygem-redis
|
||||
TRIB_USES= ruby
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${ARCH} == i386 && !${CFLAGS:M-march=*}
|
||||
# Needed for __atomic_fetch_add_8
|
||||
USE_GCC= yes
|
||||
CFLAGS+= -march=i586
|
||||
.endif
|
||||
|
||||
.if defined(_ADDFLAGS)
|
||||
CFLAGS+= -fPIC
|
||||
LDFLAGS+= -Wl,-E
|
||||
.endif
|
||||
|
||||
.if ${PORT_OPTIONS:MLUAJIT}
|
||||
. if ${LUAJIT_VER} == luajit
|
||||
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.luajit
|
||||
. else
|
||||
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.luajit-or \
|
||||
${PATCHDIR}/extra-patch-deps_lua_src_lua__cjson.c
|
||||
. endif
|
||||
.endif
|
||||
|
||||
LDFLAGS+= -lpthread -lm -lexecinfo
|
||||
|
||||
USE_RC_SUBR= redis sentinel
|
||||
BIN_FILES= redis-benchmark redis-check-aof redis-check-rdb redis-cli \
|
||||
redis-sentinel redis-server
|
||||
|
||||
USERS= redis
|
||||
GROUPS= redis
|
||||
|
||||
REDIS_DBDIR?= /var/db/redis
|
||||
REDIS_RUNDIR?= /var/run/redis
|
||||
REDIS_LOGDIR?= /var/log/redis
|
||||
|
||||
SUB_FILES= pkg-message
|
||||
SUB_LIST+= PORTNAME=${PORTNAME} \
|
||||
REDIS_DBDIR=${REDIS_DBDIR} \
|
||||
@ -90,19 +32,35 @@ SUB_LIST+= PORTNAME=${PORTNAME} \
|
||||
REDIS_RUNDIR=${REDIS_RUNDIR} \
|
||||
REDIS_USER=${USERS}
|
||||
|
||||
USERS= redis
|
||||
GROUPS= redis
|
||||
|
||||
PLIST_SUB+= REDIS_DBDIR=${REDIS_DBDIR} \
|
||||
REDIS_GROUP=${GROUPS} \
|
||||
REDIS_LOGDIR=${REDIS_LOGDIR} \
|
||||
REDIS_RUNDIR=${REDIS_RUNDIR} \
|
||||
REDIS_USER=${USERS}
|
||||
|
||||
post-patch-JEMALLOC-on:
|
||||
@${REINPLACE_CMD} '35s!Linux!FreeBSD!g' ${WRKSRC}/src/Makefile
|
||||
OPTIONS_DEFINE= JEMALLOC TLS
|
||||
OPTIONS_DEFAULT= TLS
|
||||
OPTIONS_SUB= yes
|
||||
|
||||
post-patch-LUA-on:
|
||||
@cd ${WRKSRC}/deps/lua/src && ${CP} fpconv.* lua_* strbuf.* ${WRKSRC}/src/
|
||||
post-patch-LUAJIT-on: post-patch-LUA-on
|
||||
post-patch-LUAJITOR-on: post-patch-LUA-on
|
||||
JEMALLOC_DESC= Use jemalloc
|
||||
TLS_DESC= Use TLS (openssl req.)
|
||||
|
||||
JEMALLOC_MAKE_ENV= USE_JEMALLOC=yes
|
||||
TLS_USES= ssl
|
||||
TLS_MAKE_ENV= BUILD_TLS=yes
|
||||
|
||||
BIN_FILES= redis-benchmark redis-check-aof redis-check-rdb redis-cli \
|
||||
redis-sentinel redis-server
|
||||
|
||||
REDIS_DBDIR?= /var/db/redis
|
||||
REDIS_RUNDIR?= /var/run/redis
|
||||
REDIS_LOGDIR?= /var/log/redis
|
||||
|
||||
post-patch-JEMALLOC-on:
|
||||
@${REINPLACE_CMD} '58s!Linux!FreeBSD!g' ${WRKSRC}/src/Makefile
|
||||
|
||||
post-build:
|
||||
${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@ -116,10 +74,7 @@ do-install:
|
||||
${STAGEDIR}${REDIS_DBDIR} \
|
||||
${STAGEDIR}${REDIS_RUNDIR}
|
||||
|
||||
do-install-TRIB-on:
|
||||
${INSTALL_SCRIPT} ${WRKSRC}/src/redis-trib.rb ${STAGEDIR}${PREFIX}/bin/
|
||||
|
||||
do-test:
|
||||
@cd ${WRKSRC} && ${TCLSH} tests/test_helper.tcl
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- deps/lua/src/lua_cjson.c.orig 2019-12-08 12:56:31 UTC
|
||||
+++ deps/lua/src/lua_cjson.c
|
||||
@@ -1299,7 +1299,7 @@
|
||||
*
|
||||
* luaL_setfuncs() is used to create a module table where the functions have
|
||||
* json_config_t as their first upvalue. Code borrowed from Lua 5.2 source. */
|
||||
-static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
|
||||
+void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
|
||||
{
|
||||
int i;
|
||||
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2021-01-12 14:21:03 UTC
|
||||
+++ src/Makefile
|
||||
@@ -16,7 +16,7 @@
|
||||
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
|
||||
@@ -83,8 +83,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
DEBUG=-g -ggdb
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
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 -I../deps/hdr_histogram
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -251,6 +251,9 @@
|
||||
FINAL_LIBS += ../deps/hiredis/libhiredis_ssl.a $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS)
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/lua51
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -llua-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -271,6 +274,7 @@
|
||||
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 lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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)
|
||||
@@ -324,7 +328,7 @@
|
||||
|
||||
# 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)
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2021-01-12 14:21:03 UTC
|
||||
+++ src/Makefile
|
||||
@@ -16,7 +16,7 @@
|
||||
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
|
||||
@@ -83,8 +83,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
DEBUG=-g -ggdb
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
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 -I../deps/hdr_histogram
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -251,6 +251,9 @@
|
||||
FINAL_LIBS += ../deps/hiredis/libhiredis_ssl.a $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS)
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/luajit-2.0
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -lluajit-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -271,6 +274,7 @@
|
||||
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 lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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)
|
||||
@@ -324,7 +328,7 @@
|
||||
|
||||
# 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)
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2021-01-12 14:21:03 UTC
|
||||
+++ src/Makefile
|
||||
@@ -16,7 +16,7 @@
|
||||
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
|
||||
@@ -83,8 +83,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
DEBUG=-g -ggdb
|
||||
|
||||
@@ -188,7 +188,7 @@
|
||||
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 -I../deps/hdr_histogram
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -251,6 +251,9 @@
|
||||
FINAL_LIBS += ../deps/hiredis/libhiredis_ssl.a $(LIBSSL_LIBS) $(LIBCRYPTO_LIBS)
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/luajit-2.1
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -lluajit-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -271,6 +274,7 @@
|
||||
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 lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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)
|
||||
@@ -324,7 +328,7 @@
|
||||
|
||||
# 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)
|
@ -4,7 +4,6 @@ bin/redis-check-rdb
|
||||
bin/redis-cli
|
||||
bin/redis-sentinel
|
||||
bin/redis-server
|
||||
%%TRIB%%bin/redis-trib.rb
|
||||
@sample etc/redis.conf.sample
|
||||
@sample(%%REDIS_USER%%,%%REDIS_GROUP%%,) etc/sentinel.conf.sample
|
||||
@dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_DBDIR%%
|
||||
|
@ -1,5 +1,6 @@
|
||||
PORTNAME= redis
|
||||
DISTVERSION= 7.0.15
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= databases
|
||||
MASTER_SITES= https://download.redis.io/releases/
|
||||
PKGNAMESUFFIX= 70
|
||||
@ -21,54 +22,16 @@ CONFLICTS_INSTALL= redis redis-devel redis6 redis62 # etc/rc.d/redis
|
||||
|
||||
PORTSCOUT= limit:^7\.0
|
||||
|
||||
OPTIONS_DEFINE= JEMALLOC TLS TRIB
|
||||
OPTIONS_DEFINE= JEMALLOC TLS
|
||||
OPTIONS_DEFAULT= TLS
|
||||
OPTIONS_RADIO= EXTLUA
|
||||
OPTIONS_RADIO_EXTLUA= LUA LUAJIT
|
||||
OPTIONS_SUB= yes
|
||||
|
||||
JEMALLOC_DESC= Use jemalloc
|
||||
LUAJIT_DESC= Use luajit instead of builtin lua
|
||||
LUA_DESC= Use lang/lua instead of builtin lua
|
||||
TLS_DESC= Use TLS (openssl req.)
|
||||
TRIB_DESC= Install redis-trib.rb (lang/ruby req.)
|
||||
|
||||
JEMALLOC_MAKE_ENV= USE_JEMALLOC=yes
|
||||
LUAJIT_BROKEN= Fails to link
|
||||
LUAJIT_USES= luajit
|
||||
LUAJIT_VARS= _ADDFLAGS=true
|
||||
LUA_BROKEN= Fails to link
|
||||
LUA_USES= lua:51
|
||||
LUA_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.lua
|
||||
LUA_VARS= _ADDFLAGS=true
|
||||
TLS_USES= ssl
|
||||
TLS_MAKE_ENV= BUILD_TLS=yes
|
||||
TRIB_CATEGORIES= ruby
|
||||
TRIB_RUN_DEPENDS= rubygem-redis>=2.2:databases/rubygem-redis
|
||||
TRIB_USES= ruby
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${ARCH} == i386 && !${CFLAGS:M-march=*}
|
||||
# Needed for __atomic_fetch_add_8
|
||||
USE_GCC= yes
|
||||
CFLAGS+= -march=i586
|
||||
.endif
|
||||
|
||||
.if defined(_ADDFLAGS)
|
||||
CFLAGS+= -fPIC
|
||||
LDFLAGS+= -Wl,-E
|
||||
.endif
|
||||
|
||||
.if ${PORT_OPTIONS:MLUAJIT}
|
||||
. if ${LUAJIT_VER} == luajit
|
||||
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.luajit
|
||||
. else
|
||||
EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src-Makefile.luajit-or \
|
||||
${PATCHDIR}/extra-patch-src-function_lua.c \
|
||||
${PATCHDIR}/extra-patch-deps_lua_src_lua__cjson.c
|
||||
. endif
|
||||
.endif
|
||||
|
||||
LDFLAGS+= -lpthread -lm -lexecinfo
|
||||
|
||||
@ -97,12 +60,7 @@ PLIST_SUB+= REDIS_DBDIR=${REDIS_DBDIR} \
|
||||
REDIS_USER=${USERS}
|
||||
|
||||
post-patch-JEMALLOC-on:
|
||||
@${REINPLACE_CMD} '35s!Linux!FreeBSD!g' ${WRKSRC}/src/Makefile
|
||||
|
||||
post-patch-LUA-on:
|
||||
@cd ${WRKSRC}/deps/lua/src && ${CP} fpconv.* lua_* strbuf.* ${WRKSRC}/src/
|
||||
post-patch-LUAJIT-on: post-patch-LUA-on
|
||||
post-patch-LUAJITOR-on: post-patch-LUA-on
|
||||
@${REINPLACE_CMD} '62s!Linux!FreeBSD!g' ${WRKSRC}/src/Makefile
|
||||
|
||||
post-build:
|
||||
${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
|
||||
@ -116,10 +74,7 @@ do-install:
|
||||
${STAGEDIR}${REDIS_DBDIR} \
|
||||
${STAGEDIR}${REDIS_RUNDIR}
|
||||
|
||||
do-install-TRIB-on:
|
||||
${INSTALL_SCRIPT} ${WRKSRC}/src/redis-trib.rb ${STAGEDIR}${PREFIX}/bin/
|
||||
|
||||
do-test:
|
||||
@cd ${WRKSRC} && ${TCLSH} tests/test_helper.tcl
|
||||
|
||||
.include <bsd.port.post.mk>
|
||||
.include <bsd.port.mk>
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- deps/lua/src/lua_cjson.c.orig 2019-12-08 12:56:31 UTC
|
||||
+++ deps/lua/src/lua_cjson.c
|
||||
@@ -1299,7 +1299,7 @@
|
||||
*
|
||||
* luaL_setfuncs() is used to create a module table where the functions have
|
||||
* json_config_t as their first upvalue. Code borrowed from Lua 5.2 source. */
|
||||
-static void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
|
||||
+void luaL_setfuncs (lua_State *l, const luaL_Reg *reg, int nup)
|
||||
{
|
||||
int i;
|
||||
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2022-06-08 09:56:24 UTC
|
||||
+++ src/Makefile
|
||||
@@ -16,7 +16,7 @@
|
||||
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
|
||||
@@ -115,8 +115,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
DEBUG=-g -ggdb
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
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 -I../deps/hdr_histogram
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -296,6 +296,9 @@
|
||||
endef
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/lua51
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -llua-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -317,6 +320,7 @@
|
||||
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 eval.o bio.o rio.o rand.o memtest.o syscheck.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 tracking.o connection.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o
|
||||
+REDIS_SERVER_OBJ+=fpconv.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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 redisassert.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o
|
||||
REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
|
||||
@@ -371,7 +375,7 @@
|
||||
|
||||
# redis-server
|
||||
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
|
||||
- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a $(FINAL_LIBS)
|
||||
+ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/hdr_histogram/libhdrhistogram.a $(FINAL_LIBS)
|
||||
|
||||
# redis-sentinel
|
||||
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2022-06-08 09:56:24 UTC
|
||||
+++ src/Makefile
|
||||
@@ -16,7 +16,7 @@
|
||||
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
|
||||
@@ -115,8 +115,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
DEBUG=-g -ggdb
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
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 -I../deps/hdr_histogram
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -296,6 +296,9 @@
|
||||
endef
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/luajit-2.0
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -lluajit-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -317,6 +320,7 @@
|
||||
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 eval.o bio.o rio.o rand.o memtest.o syscheck.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 tracking.o connection.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o
|
||||
+REDIS_SERVER_OBJ+=fpconv.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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 redisassert.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o
|
||||
REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
|
||||
@@ -371,7 +375,7 @@
|
||||
|
||||
# redis-server
|
||||
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
|
||||
- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a $(FINAL_LIBS)
|
||||
+ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/hdr_histogram/libhdrhistogram.a $(FINAL_LIBS)
|
||||
|
||||
# redis-sentinel
|
||||
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
|
@ -1,58 +0,0 @@
|
||||
--- src/Makefile.orig 2022-06-08 09:56:24 UTC
|
||||
+++ src/Makefile
|
||||
@@ -16,7 +16,7 @@
|
||||
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
|
||||
@@ -115,8 +115,8 @@
|
||||
# Override default settings if possible
|
||||
-include .make-settings
|
||||
|
||||
-FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS)
|
||||
-FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG)
|
||||
+FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS)
|
||||
+FINAL_LDFLAGS=$(LDFLAGS) $(DEBUG)
|
||||
FINAL_LIBS=-lm
|
||||
DEBUG=-g -ggdb
|
||||
|
||||
@@ -222,7 +222,7 @@
|
||||
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 -I../deps/hdr_histogram
|
||||
|
||||
# Determine systemd support and/or build preference (defaulting to auto-detection)
|
||||
BUILD_WITH_SYSTEMD=no
|
||||
@@ -296,6 +296,9 @@
|
||||
endef
|
||||
endif
|
||||
|
||||
+FINAL_CFLAGS+=-I${PREFIX}/include/luajit-2.1
|
||||
+FINAL_LIBS+= -L${PREFIX}/lib -lluajit-5.1
|
||||
+
|
||||
REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS)
|
||||
REDIS_LD=$(QUIET_LINK)$(CC) $(FINAL_LDFLAGS)
|
||||
REDIS_INSTALL=$(QUIET_INSTALL)$(INSTALL)
|
||||
@@ -317,6 +320,7 @@
|
||||
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 eval.o bio.o rio.o rand.o memtest.o syscheck.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 tracking.o connection.o tls.o sha256.o timeout.o setcpuaffinity.o monotonic.o mt19937-64.o resp_parser.o call_reply.o script_lua.o script.o functions.o function_lua.o commands.o
|
||||
+REDIS_SERVER_OBJ+=fpconv.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o strbuf.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 redisassert.o crcspeed.o crc64.o siphash.o crc16.o monotonic.o cli_common.o mt19937-64.o
|
||||
REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX)
|
||||
@@ -371,7 +375,7 @@
|
||||
|
||||
# redis-server
|
||||
$(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ)
|
||||
- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a ../deps/hdr_histogram/libhdrhistogram.a $(FINAL_LIBS)
|
||||
+ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/hdr_histogram/libhdrhistogram.a $(FINAL_LIBS)
|
||||
|
||||
# redis-sentinel
|
||||
$(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME)
|
@ -1,13 +0,0 @@
|
||||
--- src/function_lua.c.orig 2022-01-31 10:49:57 UTC
|
||||
+++ src/function_lua.c
|
||||
@@ -52,6 +52,10 @@
|
||||
#define LIBRARY_API_NAME "__LIBRARY_API__"
|
||||
#define LOAD_TIMEOUT_MS 500
|
||||
|
||||
+#ifndef lua_unref
|
||||
+#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref))
|
||||
+#endif
|
||||
+
|
||||
/* Lua engine ctx */
|
||||
typedef struct luaEngineCtx {
|
||||
lua_State *lua;
|
@ -4,7 +4,6 @@ bin/redis-check-rdb
|
||||
bin/redis-cli
|
||||
bin/redis-sentinel
|
||||
bin/redis-server
|
||||
%%TRIB%%bin/redis-trib.rb
|
||||
@sample etc/redis.conf.sample
|
||||
@sample(%%REDIS_USER%%,%%REDIS_GROUP%%,) etc/sentinel.conf.sample
|
||||
@dir(%%REDIS_USER%%,%%REDIS_GROUP%%,) %%REDIS_DBDIR%%
|
||||
|
Loading…
Reference in New Issue
Block a user