1 |
commit: 850894a9e88d1b711cfd3036878848f5e59690b5 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Apr 28 02:37:30 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Apr 28 02:37:30 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=850894a9 |
7 |
|
8 |
Revert "dev-db/redis: drop 5.0.14, 6.0.16" |
9 |
|
10 |
This reverts commit bb357ae44b7e9fbff0d9d9df54370c6796d706cb. |
11 |
|
12 |
dev-ruby/redis still needs 5* |
13 |
|
14 |
Bug: https://bugs.gentoo.org/841404 |
15 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
16 |
|
17 |
dev-db/redis/Manifest | 2 + |
18 |
dev-db/redis/files/redis-3.2.3-config.patch | 40 +++++ |
19 |
dev-db/redis/files/redis-5.0-sharedlua.patch | 60 ++++++++ |
20 |
dev-db/redis/files/redis-5.0.8-ppc-atomic.patch | 19 +++ |
21 |
dev-db/redis/files/redis-6.0.12-sharedlua.patch | 60 ++++++++ |
22 |
dev-db/redis/redis-5.0.14.ebuild | 164 ++++++++++++++++++++ |
23 |
dev-db/redis/redis-6.0.16.ebuild | 189 ++++++++++++++++++++++++ |
24 |
7 files changed, 534 insertions(+) |
25 |
|
26 |
diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest |
27 |
index 546bd8aa538f..4462f4e2632a 100644 |
28 |
--- a/dev-db/redis/Manifest |
29 |
+++ b/dev-db/redis/Manifest |
30 |
@@ -1,2 +1,4 @@ |
31 |
+DIST redis-5.0.14.tar.gz 2000179 BLAKE2B 77d3ed09a81450dbf806edd017785b82c50bb059aab44c82bc4ab784b7f03d5c58f9372b96c857831f84d278771dcf223f42ca05af790f0dc10ecdde211fd149 SHA512 513299ae8b967a659d54812fab4dfdfaf0081b20136a3d89b6a761e93548583c96436fedb84baa4d23385b42110ef615527efc3690b873f5bec7793403fe7eaf |
32 |
+DIST redis-6.0.16.tar.gz 2288647 BLAKE2B f3552cc0d27cbc5cf6556792da9a75d01ff70d372484c95d2af8b24ec902a8086b9c3f4e53513df982fe135963432bfb527334926dd494e50d2cc618ab813f39 SHA512 83bb72448f9943e3d015cb4d961eb2eae21602ef1f90ca52ca8ab7c6918b0ab979db9f61f3981df27b2286894f4864f4588c3a52fa988e30e9419b0967998845 |
33 |
DIST redis-6.2.6.tar.gz 2476542 BLAKE2B d139479432171294911d99e7e8c2327dbbc6682ea49de761c4bb4089a2efd814926f2f8823dca1826b4a61dd9ccf79abb22878c9463ac92870481b43d8a7fff7 SHA512 9b947d26fd9e208627ed22d318ab3d0775ab0be46d98db1c1d158feac671b984e75ce33e647d196face9643f80768af47e678be1b4e1ddd3eb56dff467c46022 |
34 |
DIST redis-6.2.7.tar.gz 2487287 BLAKE2B 06f1b1e16cdf06c38b67c1f1dcccc025da50cc3719688b8c2bf23077d77dd97ea546909043fb65e60478ac3661cc033fa6e8d7a38e361e69eb93ba3db07b7c66 SHA512 d113094b8e31754915db7f0317d9b7969e034af3a7bac2ae0cbfad6cc61ba3aae35e9709c435abc1024a96f914df7a760b3cd18d06c375b541cfa837d1c5b953 |
35 |
|
36 |
diff --git a/dev-db/redis/files/redis-3.2.3-config.patch b/dev-db/redis/files/redis-3.2.3-config.patch |
37 |
new file mode 100644 |
38 |
index 000000000000..bde0ef7cbaf1 |
39 |
--- /dev/null |
40 |
+++ b/dev-db/redis/files/redis-3.2.3-config.patch |
41 |
@@ -0,0 +1,40 @@ |
42 |
+diff --git a/redis.conf b/redis.conf |
43 |
+index 22e00bc..b09de57 100644 |
44 |
+--- a/redis.conf |
45 |
++++ b/redis.conf |
46 |
+@@ -147,7 +147,7 @@ supervised no |
47 |
+ # |
48 |
+ # Creating a pid file is best effort: if Redis is not able to create it |
49 |
+ # nothing bad happens, the server will start and run normally. |
50 |
+-pidfile /var/run/redis_6379.pid |
51 |
++pidfile /run/redis/redis.pid |
52 |
+ |
53 |
+ # Specify the server verbosity level. |
54 |
+ # This can be one of: |
55 |
+@@ -160,7 +160,7 @@ loglevel notice |
56 |
+ # Specify the log file name. Also the empty string can be used to force |
57 |
+ # Redis to log on the standard output. Note that if you use standard |
58 |
+ # output for logging but daemonize, logs will be sent to /dev/null |
59 |
+-logfile "" |
60 |
++logfile /var/log/redis/redis.log |
61 |
+ |
62 |
+ # To enable logging to the system logger, just set 'syslog-enabled' to yes, |
63 |
+ # and optionally update the other syslog parameters to suit your needs. |
64 |
+@@ -244,7 +244,7 @@ dbfilename dump.rdb |
65 |
+ # The Append Only File will also be created inside this directory. |
66 |
+ # |
67 |
+ # Note that you must specify a directory here, not a file name. |
68 |
+-dir ./ |
69 |
++dir /var/lib/redis/ |
70 |
+ |
71 |
+ ################################# REPLICATION ################################# |
72 |
+ |
73 |
+@@ -534,7 +534,7 @@ slave-priority 100 |
74 |
+ # limit for maxmemory so that there is some free RAM on the system for slave |
75 |
+ # output buffers (but this is not needed if the policy is 'noeviction'). |
76 |
+ # |
77 |
+-# maxmemory <bytes> |
78 |
++maxmemory 64MB |
79 |
+ |
80 |
+ # MAXMEMORY POLICY: how Redis will select what to remove when maxmemory |
81 |
+ # is reached. You can select among five behaviors: |
82 |
|
83 |
diff --git a/dev-db/redis/files/redis-5.0-sharedlua.patch b/dev-db/redis/files/redis-5.0-sharedlua.patch |
84 |
new file mode 100644 |
85 |
index 000000000000..3e14f41733b0 |
86 |
--- /dev/null |
87 |
+++ b/dev-db/redis/files/redis-5.0-sharedlua.patch |
88 |
@@ -0,0 +1,60 @@ |
89 |
+diff --git a/deps/lua/src/lua_cjson.c b/deps/lua/src/lua_cjson.c |
90 |
+index c26c0d7..fa50c41 100644 |
91 |
+--- a/deps/lua/src/lua_cjson.c |
92 |
++++ b/deps/lua/src/lua_cjson.c |
93 |
+@@ -46,7 +46,7 @@ |
94 |
+ #include "strbuf.h" |
95 |
+ #include "fpconv.h" |
96 |
+ |
97 |
+-#include "../../../src/solarisfixes.h" |
98 |
++#include "solarisfixes.h" |
99 |
+ |
100 |
+ #ifndef CJSON_MODNAME |
101 |
+ #define CJSON_MODNAME "cjson" |
102 |
+diff --git a/src/Makefile b/src/Makefile |
103 |
+index 773d3b2..2d120d4 100644 |
104 |
+--- a/src/Makefile |
105 |
++++ b/src/Makefile |
106 |
+@@ -16,7 +16,7 @@ release_hdr := $(shell sh -c './mkreleasehdr.sh') |
107 |
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
108 |
+ uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') |
109 |
+ OPTIMIZATION?=-O2 |
110 |
+-DEPENDENCY_TARGETS=hiredis linenoise lua |
111 |
++DEPENDENCY_TARGETS=hiredis linenoise |
112 |
+ NODEPS:=clean distclean |
113 |
+ |
114 |
+ # Default settings |
115 |
+@@ -66,6 +66,7 @@ endif |
116 |
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) |
117 |
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG) |
118 |
+ FINAL_LIBS=-lm |
119 |
++FINAL_LIBS+=@LUA_LIBS@ |
120 |
+ DEBUG=-g -ggdb |
121 |
+ |
122 |
+ ifeq ($(uname_S),SunOS) |
123 |
+@@ -107,7 +108,7 @@ endif |
124 |
+ endif |
125 |
+ endif |
126 |
+ # Include paths to dependencies |
127 |
+-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src |
128 |
++FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise @LUA_CFLAGS@ |
129 |
+ |
130 |
+ ifeq ($(MALLOC),tcmalloc) |
131 |
+ FINAL_CFLAGS+= -DUSE_TCMALLOC |
132 |
+@@ -145,6 +146,7 @@ endif |
133 |
+ REDIS_SERVER_NAME=redis-server |
134 |
+ REDIS_SENTINEL_NAME=redis-sentinel |
135 |
+ 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 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 |
136 |
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o |
137 |
+ REDIS_CLI_NAME=redis-cli |
138 |
+ REDIS_CLI_OBJ=anet.o adlist.o dict.o redis-cli.o zmalloc.o release.o anet.o ae.o crc64.o siphash.o crc16.o |
139 |
+ REDIS_BENCHMARK_NAME=redis-benchmark |
140 |
+@@ -196,7 +198,7 @@ endif |
141 |
+ |
142 |
+ # redis-server |
143 |
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ) |
144 |
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS) |
145 |
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(FINAL_LIBS) |
146 |
+ |
147 |
+ # redis-sentinel |
148 |
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME) |
149 |
|
150 |
diff --git a/dev-db/redis/files/redis-5.0.8-ppc-atomic.patch b/dev-db/redis/files/redis-5.0.8-ppc-atomic.patch |
151 |
new file mode 100644 |
152 |
index 000000000000..61a4cc721eb1 |
153 |
--- /dev/null |
154 |
+++ b/dev-db/redis/files/redis-5.0.8-ppc-atomic.patch |
155 |
@@ -0,0 +1,19 @@ |
156 |
+diff --git a/src/Makefile b/src/Makefile |
157 |
+index 4b2a31c..4ef853b 100644 |
158 |
+--- a/src/Makefile |
159 |
++++ b/src/Makefile |
160 |
+@@ -77,6 +77,14 @@ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG) |
161 |
+ FINAL_LIBS=-lm |
162 |
+ DEBUG=-g -ggdb |
163 |
+ |
164 |
++ifneq (,$(filter powerpc ppc,$(uname_M))) |
165 |
++ FINAL_LIBS+=-latomic |
166 |
++else |
167 |
++ifneq (,$(findstring ppc,$(uname_M))) |
168 |
++ FINAL_LIBS+=-latomic |
169 |
++endif |
170 |
++endif |
171 |
++ |
172 |
+ # Linux ARM needs -latomic at linking time |
173 |
+ ifneq (,$(filter aarch64 armv,$(uname_M))) |
174 |
+ FINAL_LIBS+=-latomic |
175 |
|
176 |
diff --git a/dev-db/redis/files/redis-6.0.12-sharedlua.patch b/dev-db/redis/files/redis-6.0.12-sharedlua.patch |
177 |
new file mode 100644 |
178 |
index 000000000000..3707bcf30788 |
179 |
--- /dev/null |
180 |
+++ b/dev-db/redis/files/redis-6.0.12-sharedlua.patch |
181 |
@@ -0,0 +1,60 @@ |
182 |
+diff --git a/deps/lua/src/lua_cjson.c b/deps/lua/src/lua_cjson.c |
183 |
+index c26c0d7..fa50c41 100644 |
184 |
+--- a/deps/lua/src/lua_cjson.c |
185 |
++++ b/deps/lua/src/lua_cjson.c |
186 |
+@@ -46,7 +46,7 @@ |
187 |
+ #include "strbuf.h" |
188 |
+ #include "fpconv.h" |
189 |
+ |
190 |
+-#include "../../../src/solarisfixes.h" |
191 |
++#include "solarisfixes.h" |
192 |
+ |
193 |
+ #ifndef CJSON_MODNAME |
194 |
+ #define CJSON_MODNAME "cjson" |
195 |
+diff --git a/src/Makefile b/src/Makefile |
196 |
+index cfecbb2..86c3127 100644 |
197 |
+--- a/src/Makefile |
198 |
++++ b/src/Makefile |
199 |
+@@ -16,7 +16,7 @@ release_hdr := $(shell sh -c './mkreleasehdr.sh') |
200 |
+ uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') |
201 |
+ uname_M := $(shell sh -c 'uname -m 2>/dev/null || echo not') |
202 |
+ OPTIMIZATION?=-O2 |
203 |
+-DEPENDENCY_TARGETS=hiredis linenoise lua |
204 |
++DEPENDENCY_TARGETS=hiredis linenoise |
205 |
+ NODEPS:=clean distclean |
206 |
+ |
207 |
+ # Default settings |
208 |
+@@ -69,6 +69,7 @@ endif |
209 |
+ FINAL_CFLAGS=$(STD) $(WARN) $(OPT) $(DEBUG) $(CFLAGS) $(REDIS_CFLAGS) |
210 |
+ FINAL_LDFLAGS=$(LDFLAGS) $(REDIS_LDFLAGS) $(DEBUG) |
211 |
+ FINAL_LIBS=-lm |
212 |
++FINAL_LIBS+=@LUA_LIBS@ |
213 |
+ DEBUG=-g -ggdb |
214 |
+ |
215 |
+ # Linux ARM needs -latomic at linking time |
216 |
+@@ -159,7 +160,7 @@ endif |
217 |
+ endif |
218 |
+ endif |
219 |
+ # Include paths to dependencies |
220 |
+-FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise -I../deps/lua/src |
221 |
++FINAL_CFLAGS+= -I../deps/hiredis -I../deps/linenoise @LUA_CFLAGS@ |
222 |
+ |
223 |
+ # Determine systemd support and/or build preference (defaulting to auto-detection) |
224 |
+ BUILD_WITH_SYSTEMD=no |
225 |
+@@ -238,6 +239,7 @@ endif |
226 |
+ REDIS_SERVER_NAME=redis-server$(PROG_SUFFIX) |
227 |
+ REDIS_SENTINEL_NAME=redis-sentinel$(PROG_SUFFIX) |
228 |
+ 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 mt19937-64.o |
229 |
++REDIS_SERVER_OBJ+=fpconv.o strbuf.o lua_bit.o lua_cjson.o lua_cmsgpack.o lua_struct.o |
230 |
+ REDIS_CLI_NAME=redis-cli$(PROG_SUFFIX) |
231 |
+ 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 mt19937-64.o |
232 |
+ REDIS_BENCHMARK_NAME=redis-benchmark$(PROG_SUFFIX) |
233 |
+@@ -291,7 +293,7 @@ endif |
234 |
+ |
235 |
+ # redis-server |
236 |
+ $(REDIS_SERVER_NAME): $(REDIS_SERVER_OBJ) |
237 |
+- $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a ../deps/lua/src/liblua.a $(FINAL_LIBS) |
238 |
++ $(REDIS_LD) -o $@ $^ ../deps/hiredis/libhiredis.a $(FINAL_LIBS) |
239 |
+ |
240 |
+ # redis-sentinel |
241 |
+ $(REDIS_SENTINEL_NAME): $(REDIS_SERVER_NAME) |
242 |
|
243 |
diff --git a/dev-db/redis/redis-5.0.14.ebuild b/dev-db/redis/redis-5.0.14.ebuild |
244 |
new file mode 100644 |
245 |
index 000000000000..a8ec106eeb4d |
246 |
--- /dev/null |
247 |
+++ b/dev-db/redis/redis-5.0.14.ebuild |
248 |
@@ -0,0 +1,164 @@ |
249 |
+# Copyright 1999-2021 Gentoo Authors |
250 |
+# Distributed under the terms of the GNU General Public License v2 |
251 |
+ |
252 |
+EAPI=7 |
253 |
+ |
254 |
+inherit autotools flag-o-matic systemd toolchain-funcs tmpfiles |
255 |
+ |
256 |
+DESCRIPTION="A persistent caching system, key-value and data structures database" |
257 |
+HOMEPAGE="https://redis.io" |
258 |
+SRC_URI="http://download.redis.io/releases/${P}.tar.gz" |
259 |
+ |
260 |
+LICENSE="BSD" |
261 |
+SLOT="0" |
262 |
+KEYWORDS="amd64 arm arm64 ~hppa ppc ppc64 x86 ~amd64-linux ~x86-linux ~x86-solaris" |
263 |
+IUSE="+jemalloc tcmalloc luajit test" |
264 |
+RESTRICT="!test? ( test )" |
265 |
+ |
266 |
+# Redis does NOT build with Lua 5.2 or newer at this time. |
267 |
+COMMON_DEPEND=" |
268 |
+ luajit? ( dev-lang/luajit:2 ) |
269 |
+ !luajit? ( dev-lang/lua:5.1 ) |
270 |
+ tcmalloc? ( dev-util/google-perftools ) |
271 |
+ jemalloc? ( >=dev-libs/jemalloc-5.1:= )" |
272 |
+ |
273 |
+RDEPEND=" |
274 |
+ ${COMMON_DEPEND} |
275 |
+ acct-group/redis |
276 |
+ acct-user/redis" |
277 |
+ |
278 |
+BDEPEND=" |
279 |
+ ${COMMON_DEPEND} |
280 |
+ virtual/pkgconfig" |
281 |
+ |
282 |
+# Tcl is only needed in the CHOST test env |
283 |
+DEPEND=" |
284 |
+ ${COMMON_DEPEND} |
285 |
+ test? ( dev-lang/tcl:0= )" |
286 |
+ |
287 |
+REQUIRED_USE="?? ( tcmalloc jemalloc )" |
288 |
+ |
289 |
+PATCHES=( |
290 |
+ "${FILESDIR}"/${PN}-3.2.3-config.patch |
291 |
+ "${FILESDIR}"/${PN}-5.0-shared.patch |
292 |
+ "${FILESDIR}"/${PN}-5.0-sharedlua.patch |
293 |
+ "${FILESDIR}"/${PN}-5.0.8-ppc-atomic.patch |
294 |
+ "${FILESDIR}"/${PN}-sentinel-5.0-config.patch |
295 |
+) |
296 |
+ |
297 |
+src_prepare() { |
298 |
+ default |
299 |
+ |
300 |
+ # don't call ar directly |
301 |
+ sed -e '/^STLIB_MAKE_CMD/s/ar/$(AR)/g' \ |
302 |
+ -i deps/hiredis/Makefile || die |
303 |
+ |
304 |
+ # Copy lua modules into build dir |
305 |
+ cp deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c src/ || die |
306 |
+ cp deps/lua/src/{fpconv,strbuf}.h src/ || die |
307 |
+ # Append cflag for lua_cjson |
308 |
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61 |
309 |
+ append-cflags "-DENABLE_CJSON_GLOBAL" |
310 |
+ |
311 |
+ # now we will rewrite present Makefiles |
312 |
+ local makefiles="" MKF |
313 |
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do |
314 |
+ mv "${MKF}" "${MKF}.in" |
315 |
+ sed -i -e 's:$(CC):@CC@:g' \ |
316 |
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \ |
317 |
+ -e 's: $(DEBUG)::g' \ |
318 |
+ -e 's:$(OBJARCH)::g' \ |
319 |
+ -e 's:ARCH:TARCH:g' \ |
320 |
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \ |
321 |
+ "${MKF}.in" \ |
322 |
+ || die "Sed failed for ${MKF}" |
323 |
+ makefiles+=" ${MKF}" |
324 |
+ done |
325 |
+ # autodetection of compiler and settings; generates the modified Makefiles |
326 |
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac || die |
327 |
+ |
328 |
+ # Use the correct pkgconfig name for Lua |
329 |
+ if false && has_version 'dev-lang/lua:5.3'; then |
330 |
+ # Lua5.3 gives: |
331 |
+ #lua_bit.c:83:2: error: #error "Unknown number type, check LUA_NUMBER_* in luaconf.h" |
332 |
+ LUAPKGCONFIG=lua5.3 |
333 |
+ elif false && has_version 'dev-lang/lua:5.2'; then |
334 |
+ # Lua5.2 fails with: |
335 |
+ # scripting.c:(.text+0x1f9b): undefined reference to `lua_open' |
336 |
+ # Because lua_open because lua_newstate in 5.2 |
337 |
+ LUAPKGCONFIG=lua5.2 |
338 |
+ elif has_version 'dev-lang/lua:5.1'; then |
339 |
+ LUAPKGCONFIG=lua5.1 |
340 |
+ else |
341 |
+ LUAPKGCONFIG=lua |
342 |
+ fi |
343 |
+ # The upstream configure script handles luajit specially, and is not |
344 |
+ # effected by these changes. |
345 |
+ einfo "Selected LUAPKGCONFIG=${LUAPKGCONFIG}" |
346 |
+ sed -i \ |
347 |
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \ |
348 |
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \ |
349 |
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \ |
350 |
+ configure.ac || die "Sed failed for configure.ac" |
351 |
+ eautoreconf |
352 |
+} |
353 |
+ |
354 |
+src_configure() { |
355 |
+ econf $(use_with luajit) |
356 |
+ |
357 |
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164 |
358 |
+ # also, don't define ANSI/c99 for lua twice |
359 |
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die |
360 |
+} |
361 |
+ |
362 |
+src_compile() { |
363 |
+ local myconf="" |
364 |
+ |
365 |
+ if use tcmalloc; then |
366 |
+ myconf="${myconf} USE_TCMALLOC=yes" |
367 |
+ elif use jemalloc; then |
368 |
+ myconf="${myconf} JEMALLOC_SHARED=yes" |
369 |
+ else |
370 |
+ myconf="${myconf} MALLOC=yes" |
371 |
+ fi |
372 |
+ |
373 |
+ tc-export AR CC RANLIB |
374 |
+ emake V=1 ${myconf} AR="${AR}" CC="${CC}" RANLIB="${RANLIB}" |
375 |
+} |
376 |
+ |
377 |
+src_install() { |
378 |
+ insinto /etc/ |
379 |
+ doins redis.conf sentinel.conf |
380 |
+ use prefix || fowners redis:redis /etc/{redis,sentinel}.conf |
381 |
+ fperms 0644 /etc/{redis,sentinel}.conf |
382 |
+ |
383 |
+ newconfd "${FILESDIR}/redis.confd-r1" redis |
384 |
+ newinitd "${FILESDIR}/redis.initd-5" redis |
385 |
+ |
386 |
+ systemd_newunit "${FILESDIR}/redis.service-3" redis.service |
387 |
+ newtmpfiles "${FILESDIR}/redis.tmpfiles-2" redis.conf |
388 |
+ |
389 |
+ newconfd "${FILESDIR}/redis-sentinel.confd" redis-sentinel |
390 |
+ newinitd "${FILESDIR}/redis-sentinel.initd" redis-sentinel |
391 |
+ |
392 |
+ insinto /etc/logrotate.d/ |
393 |
+ newins "${FILESDIR}/${PN}.logrotate" ${PN} |
394 |
+ |
395 |
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md |
396 |
+ |
397 |
+ dobin src/redis-cli |
398 |
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb |
399 |
+ fperms 0750 /usr/sbin/redis-benchmark |
400 |
+ dosym redis-server /usr/sbin/redis-sentinel |
401 |
+ |
402 |
+ if use prefix; then |
403 |
+ diropts -m0750 |
404 |
+ else |
405 |
+ diropts -m0750 -o redis -g redis |
406 |
+ fi |
407 |
+ keepdir /var/{log,lib}/redis |
408 |
+} |
409 |
+ |
410 |
+pkg_postinst() { |
411 |
+ tmpfiles_process redis.conf |
412 |
+} |
413 |
|
414 |
diff --git a/dev-db/redis/redis-6.0.16.ebuild b/dev-db/redis/redis-6.0.16.ebuild |
415 |
new file mode 100644 |
416 |
index 000000000000..347c229d7386 |
417 |
--- /dev/null |
418 |
+++ b/dev-db/redis/redis-6.0.16.ebuild |
419 |
@@ -0,0 +1,189 @@ |
420 |
+# Copyright 1999-2021 Gentoo Authors |
421 |
+# Distributed under the terms of the GNU General Public License v2 |
422 |
+ |
423 |
+EAPI=7 |
424 |
+ |
425 |
+# Redis does NOT build with Lua 5.2 or newer at this time: |
426 |
+# - 5.3 and 5.4 give: |
427 |
+# lua_bit.c:83:2: error: #error "Unknown number type, check LUA_NUMBER_* in luaconf.h" |
428 |
+# - 5.2 fails with: |
429 |
+# scripting.c:(.text+0x1f9b): undefined reference to `lua_open' |
430 |
+# because lua_open became lua_newstate in 5.2 |
431 |
+LUA_COMPAT=( lua5-1 luajit ) |
432 |
+ |
433 |
+inherit autotools flag-o-matic lua-single systemd toolchain-funcs tmpfiles |
434 |
+ |
435 |
+DESCRIPTION="A persistent caching system, key-value and data structures database" |
436 |
+HOMEPAGE="https://redis.io" |
437 |
+SRC_URI="https://download.redis.io/releases/${P}.tar.gz" |
438 |
+ |
439 |
+LICENSE="BSD" |
440 |
+SLOT="0" |
441 |
+KEYWORDS="amd64 arm arm64 ~hppa ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~x86-solaris" |
442 |
+IUSE="+jemalloc ssl systemd tcmalloc test" |
443 |
+RESTRICT="!test? ( test )" |
444 |
+ |
445 |
+COMMON_DEPEND=" |
446 |
+ ${LUA_DEPS} |
447 |
+ jemalloc? ( >=dev-libs/jemalloc-5.1:= ) |
448 |
+ ssl? ( dev-libs/openssl:0= ) |
449 |
+ systemd? ( sys-apps/systemd:= ) |
450 |
+ tcmalloc? ( dev-util/google-perftools ) |
451 |
+" |
452 |
+ |
453 |
+RDEPEND=" |
454 |
+ ${COMMON_DEPEND} |
455 |
+ acct-group/redis |
456 |
+ acct-user/redis |
457 |
+" |
458 |
+ |
459 |
+BDEPEND=" |
460 |
+ ${COMMON_DEPEND} |
461 |
+ virtual/pkgconfig |
462 |
+" |
463 |
+ |
464 |
+# Tcl is only needed in the CHOST test env |
465 |
+DEPEND=" |
466 |
+ ${COMMON_DEPEND} |
467 |
+ test? ( |
468 |
+ dev-lang/tcl:0= |
469 |
+ ssl? ( dev-tcltk/tls ) |
470 |
+ )" |
471 |
+ |
472 |
+REQUIRED_USE="?? ( jemalloc tcmalloc ) |
473 |
+ ${LUA_REQUIRED_USE}" |
474 |
+ |
475 |
+PATCHES=( |
476 |
+ "${FILESDIR}"/${PN}-3.2.3-config.patch |
477 |
+ "${FILESDIR}"/${PN}-5.0-shared.patch |
478 |
+ "${FILESDIR}"/${PN}-6.0.12-sharedlua.patch |
479 |
+ "${FILESDIR}"/${PN}-5.0.8-ppc-atomic.patch |
480 |
+ "${FILESDIR}"/${PN}-sentinel-5.0-config.patch |
481 |
+) |
482 |
+ |
483 |
+src_prepare() { |
484 |
+ default |
485 |
+ |
486 |
+ # unstable on jemalloc |
487 |
+ > tests/unit/memefficiency.tcl || die |
488 |
+ |
489 |
+ # Copy lua modules into build dir |
490 |
+ cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die |
491 |
+ cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die |
492 |
+ # Append cflag for lua_cjson |
493 |
+ # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61 |
494 |
+ append-cflags "-DENABLE_CJSON_GLOBAL" |
495 |
+ |
496 |
+ # now we will rewrite present Makefiles |
497 |
+ local makefiles="" MKF |
498 |
+ for MKF in $(find -name 'Makefile' | cut -b 3-); do |
499 |
+ mv "${MKF}" "${MKF}.in" |
500 |
+ sed -i -e 's:$(CC):@CC@:g' \ |
501 |
+ -e 's:$(CFLAGS):@AM_CFLAGS@:g' \ |
502 |
+ -e 's: $(DEBUG)::g' \ |
503 |
+ -e 's:$(OBJARCH)::g' \ |
504 |
+ -e 's:ARCH:TARCH:g' \ |
505 |
+ -e '/^CCOPT=/s:$: $(LDFLAGS):g' \ |
506 |
+ "${MKF}.in" \ |
507 |
+ || die "Sed failed for ${MKF}" |
508 |
+ makefiles+=" ${MKF}" |
509 |
+ done |
510 |
+ # autodetection of compiler and settings; generates the modified Makefiles |
511 |
+ cp "${FILESDIR}"/configure.ac-3.2 configure.ac || die |
512 |
+ |
513 |
+ # Use the correct pkgconfig name for Lua. |
514 |
+ # The upstream configure script handles luajit specially, and is not |
515 |
+ # effected by these changes. |
516 |
+ sed -i \ |
517 |
+ -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \ |
518 |
+ -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \ |
519 |
+ -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${ELUA},g" \ |
520 |
+ configure.ac || die "Sed failed for configure.ac" |
521 |
+ eautoreconf |
522 |
+} |
523 |
+ |
524 |
+src_configure() { |
525 |
+ econf $(use_with lua_single_target_luajit luajit) |
526 |
+ |
527 |
+ # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164 |
528 |
+ # also, don't define ANSI/c99 for lua twice |
529 |
+ sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die |
530 |
+} |
531 |
+ |
532 |
+src_compile() { |
533 |
+ local myconf="" |
534 |
+ |
535 |
+ if use jemalloc; then |
536 |
+ myconf+="MALLOC=jemalloc" |
537 |
+ elif use tcmalloc; then |
538 |
+ myconf+="MALLOC=tcmalloc" |
539 |
+ else |
540 |
+ myconf+="MALLOC=libc" |
541 |
+ fi |
542 |
+ |
543 |
+ if use ssl; then |
544 |
+ myconf+=" BUILD_TLS=yes" |
545 |
+ fi |
546 |
+ |
547 |
+ export USE_SYSTEMD=$(usex systemd) |
548 |
+ |
549 |
+ tc-export AR CC RANLIB |
550 |
+ emake V=1 ${myconf} AR="${AR}" CC="${CC}" RANLIB="${RANLIB}" |
551 |
+} |
552 |
+ |
553 |
+src_test() { |
554 |
+ # Known to fail with FEATURES=usersandbox |
555 |
+ if has usersandbox ${FEATURES}; then |
556 |
+ ewarn "You are emerging ${P} with 'usersandbox' enabled." \ |
557 |
+ "Expect some test failures or emerge with 'FEATURES=-usersandbox'!" |
558 |
+ fi |
559 |
+ |
560 |
+ if use ssl; then |
561 |
+ ./utils/gen-test-certs.sh |
562 |
+ ./runtest --tls |
563 |
+ else |
564 |
+ ./runtest |
565 |
+ fi |
566 |
+} |
567 |
+ |
568 |
+src_install() { |
569 |
+ insinto /etc/redis |
570 |
+ doins redis.conf sentinel.conf |
571 |
+ use prefix || fowners -R redis:redis /etc/redis /etc/redis/{redis,sentinel}.conf |
572 |
+ fperms 0750 /etc/redis |
573 |
+ fperms 0644 /etc/redis/{redis,sentinel}.conf |
574 |
+ |
575 |
+ newconfd "${FILESDIR}/redis.confd-r2" redis |
576 |
+ newinitd "${FILESDIR}/redis.initd-6" redis |
577 |
+ |
578 |
+ systemd_newunit "${FILESDIR}/redis.service-4" redis.service |
579 |
+ newtmpfiles "${FILESDIR}/redis.tmpfiles-2" redis.conf |
580 |
+ |
581 |
+ newconfd "${FILESDIR}/redis-sentinel.confd-r1" redis-sentinel |
582 |
+ newinitd "${FILESDIR}/redis-sentinel.initd-r1" redis-sentinel |
583 |
+ |
584 |
+ insinto /etc/logrotate.d/ |
585 |
+ newins "${FILESDIR}/${PN}.logrotate" ${PN} |
586 |
+ |
587 |
+ dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md |
588 |
+ |
589 |
+ dobin src/redis-cli |
590 |
+ dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb |
591 |
+ fperms 0750 /usr/sbin/redis-benchmark |
592 |
+ dosym redis-server /usr/sbin/redis-sentinel |
593 |
+ |
594 |
+ if use prefix; then |
595 |
+ diropts -m0750 |
596 |
+ else |
597 |
+ diropts -m0750 -o redis -g redis |
598 |
+ fi |
599 |
+ keepdir /var/{log,lib}/redis |
600 |
+} |
601 |
+ |
602 |
+pkg_postinst() { |
603 |
+ tmpfiles_process redis.conf |
604 |
+ |
605 |
+ ewarn "The default redis configuration file location changed to:" |
606 |
+ ewarn " /etc/redis/{redis,sentinel}.conf" |
607 |
+ ewarn "Please apply your changes to the new configuration files." |
608 |
+} |