Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/redis/files/, dev-db/redis/
Date: Tue, 04 May 2021 21:41:47
Message-Id: 1620164495.8427ef73ba9e6ad18fbf873e1f07f607edc88392.sam@gentoo
1 commit: 8427ef73ba9e6ad18fbf873e1f07f607edc88392
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 4 21:41:02 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue May 4 21:41:35 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8427ef73
7
8 dev-db/redis: add 6.2.3
9
10 Bug: https://bugs.gentoo.org/788211
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 dev-db/redis/Manifest | 1 +
14 dev-db/redis/files/redis-6.2.3-ppc-atomic.patch | 19 +++
15 dev-db/redis/redis-6.2.3.ebuild | 185 ++++++++++++++++++++++++
16 3 files changed, 205 insertions(+)
17
18 diff --git a/dev-db/redis/Manifest b/dev-db/redis/Manifest
19 index ce702a566d2..21d25556dc4 100644
20 --- a/dev-db/redis/Manifest
21 +++ b/dev-db/redis/Manifest
22 @@ -2,3 +2,4 @@ DIST redis-5.0.12.tar.gz 1995069 BLAKE2B 03bb5956fb1206ecfa7f621b22b3101d1ebad62
23 DIST redis-6.0.12.tar.gz 2276349 BLAKE2B ab49b0278420c65fc995a90e850130971ccaf3df34a08a5cc10a8c211239eba8449b87fe67684189c71816cf259a70a23a77935ec61e8baa787daa61cb994201 SHA512 9dd8e3bed51e1356470e1bf08892f771744c0c9418ff874c16ea932ad1f471a908ffd8479efe1f32531d7f63cd7af5224273ce50f2fe7aa26c47716e0e78330b
24 DIST redis-6.0.13.tar.gz 2276777 BLAKE2B 735ebc7068b26e7e424e5ce701bb80cfbdf09f65734cbdd5760b75d78141ff542d1a91f2f58f7ef97ea4a1e9e225e96189736384e1dd0c8195e4ca651da75492 SHA512 5053cd60df354c8a00e5864179c6354db6b0243d56717d5dc44954405908ad8b3b09ba9f069312825705dd8abc83d533dd7a5a60485a30e8f4adf166fa058549
25 DIST redis-6.2.1.tar.gz 2438367 BLAKE2B 8717630771eafaf8a15dd371d46475f81f15bbcdc9a4fabd8f270ab6e09fbfb3ee2a1cddddb6c7778922d3552bcf5ee475eec7ba0623147ec36a5c5422cb0de0 SHA512 7c339cc360fc3125bb67c5748bb4fe940977faa937e3a86294829bde472479a811df8ea0ce4961d8128ec8d4ffba5d5a943c2957589c8da0cfc3f109f82e4af6
26 +DIST redis-6.2.3.tar.gz 2456050 BLAKE2B f41096c790a373bdfbe2b9af0be867fdf4c9cdcf5b76e92c50786de917d9e52bd65e65bd43127fd5ad040bc3fed50fda9caa145cd261f79bcfa16ddf369315e9 SHA512 0a020aaa5664ed419a30e85d3b5c79fe69353067b755421c702f89ca923f1ba7794b4792f4a44049e38936f221363153c9ffcfb6fa232731b224d20c2982ac68
27
28 diff --git a/dev-db/redis/files/redis-6.2.3-ppc-atomic.patch b/dev-db/redis/files/redis-6.2.3-ppc-atomic.patch
29 new file mode 100644
30 index 00000000000..8990b00ccdc
31 --- /dev/null
32 +++ b/dev-db/redis/files/redis-6.2.3-ppc-atomic.patch
33 @@ -0,0 +1,19 @@
34 +diff --git a/src/Makefile b/src/Makefile
35 +index 5b2cf1c..9e1239d 100644
36 +--- a/src/Makefile
37 ++++ b/src/Makefile
38 +@@ -87,6 +87,14 @@ FINAL_LIBS=-lm
39 + FINAL_LIBS+=@LUA_LIBS@
40 + DEBUG=-g -ggdb
41 +
42 ++ifneq (,$(filter powerpc ppc,$(uname_M)))
43 ++ FINAL_LIBS+=-latomic
44 ++else
45 ++ifneq (,$(findstring ppc,$(uname_M)))
46 ++ FINAL_LIBS+=-latomic
47 ++endif
48 ++endif
49 ++
50 + # Linux ARM32 needs -latomic at linking time
51 + ifneq (,$(findstring armv,$(uname_M)))
52 + FINAL_LIBS+=-latomic
53
54 diff --git a/dev-db/redis/redis-6.2.3.ebuild b/dev-db/redis/redis-6.2.3.ebuild
55 new file mode 100644
56 index 00000000000..db5733af1dd
57 --- /dev/null
58 +++ b/dev-db/redis/redis-6.2.3.ebuild
59 @@ -0,0 +1,185 @@
60 +# Copyright 1999-2021 Gentoo Authors
61 +# Distributed under the terms of the GNU General Public License v2
62 +
63 +EAPI=7
64 +
65 +# Redis does NOT build with Lua 5.2 or newer at this time:
66 +# - 5.3 and 5.4 give:
67 +# lua_bit.c:83:2: error: #error "Unknown number type, check LUA_NUMBER_* in luaconf.h"
68 +# - 5.2 fails with:
69 +# scripting.c:(.text+0x1f9b): undefined reference to `lua_open'
70 +# because lua_open became lua_newstate in 5.2
71 +LUA_COMPAT=( lua5-1 luajit )
72 +
73 +inherit autotools flag-o-matic lua-single systemd toolchain-funcs tmpfiles
74 +
75 +DESCRIPTION="A persistent caching system, key-value and data structures database"
76 +HOMEPAGE="https://redis.io"
77 +SRC_URI="https://download.redis.io/releases/${P}.tar.gz"
78 +
79 +LICENSE="BSD"
80 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~x86-solaris"
81 +IUSE="+jemalloc ssl systemd tcmalloc test"
82 +RESTRICT="!test? ( test )"
83 +SLOT="0"
84 +
85 +COMMON_DEPEND="
86 + ${LUA_DEPS}
87 + jemalloc? ( >=dev-libs/jemalloc-5.1:= )
88 + ssl? ( dev-libs/openssl:0= )
89 + systemd? ( sys-apps/systemd:= )
90 + tcmalloc? ( dev-util/google-perftools )
91 +"
92 +
93 +RDEPEND="
94 + ${COMMON_DEPEND}
95 + acct-group/redis
96 + acct-user/redis
97 +"
98 +
99 +BDEPEND="
100 + ${COMMON_DEPEND}
101 + virtual/pkgconfig
102 +"
103 +
104 +# Tcl is only needed in the CHOST test env
105 +DEPEND="
106 + ${COMMON_DEPEND}
107 + test? (
108 + dev-lang/tcl:0=
109 + ssl? ( dev-tcltk/tls )
110 + )"
111 +
112 +REQUIRED_USE="?? ( jemalloc tcmalloc )
113 + ${LUA_REQUIRED_USE}"
114 +
115 +PATCHES=(
116 + "${FILESDIR}"/${PN}-6.2.1-config.patch
117 + "${FILESDIR}"/${PN}-5.0-shared.patch
118 + "${FILESDIR}"/${PN}-6.2.1-sharedlua.patch
119 + "${FILESDIR}"/${PN}-6.2.3-ppc-atomic.patch
120 + "${FILESDIR}"/${PN}-sentinel-5.0-config.patch
121 +)
122 +
123 +src_prepare() {
124 + default
125 +
126 + # unstable on jemalloc
127 + > tests/unit/memefficiency.tcl || die
128 +
129 + # Copy lua modules into build dir
130 + cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
131 + cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
132 + # Append cflag for lua_cjson
133 + # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
134 + append-cflags "-DENABLE_CJSON_GLOBAL"
135 +
136 + # now we will rewrite present Makefiles
137 + local makefiles="" MKF
138 + for MKF in $(find -name 'Makefile' | cut -b 3-); do
139 + mv "${MKF}" "${MKF}.in"
140 + sed -i -e 's:$(CC):@CC@:g' \
141 + -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
142 + -e 's: $(DEBUG)::g' \
143 + -e 's:$(OBJARCH)::g' \
144 + -e 's:ARCH:TARCH:g' \
145 + -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
146 + "${MKF}.in" \
147 + || die "Sed failed for ${MKF}"
148 + makefiles+=" ${MKF}"
149 + done
150 + # autodetection of compiler and settings; generates the modified Makefiles
151 + cp "${FILESDIR}"/configure.ac-3.2 configure.ac || die
152 +
153 + # Use the correct pkgconfig name for Lua.
154 + # The upstream configure script handles luajit specially, and is not
155 + # effected by these changes.
156 + sed -i \
157 + -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
158 + -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
159 + -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${ELUA},g" \
160 + configure.ac || die "Sed failed for configure.ac"
161 + eautoreconf
162 +}
163 +
164 +src_configure() {
165 + econf $(use_with lua_single_target_luajit luajit)
166 +
167 + # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
168 + # also, don't define ANSI/c99 for lua twice
169 + sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
170 +}
171 +
172 +src_compile() {
173 + local myconf=""
174 +
175 + if use jemalloc; then
176 + myconf+="MALLOC=jemalloc"
177 + elif use tcmalloc; then
178 + myconf+="MALLOC=tcmalloc"
179 + else
180 + myconf+="MALLOC=libc"
181 + fi
182 +
183 + if use ssl; then
184 + myconf+=" BUILD_TLS=yes"
185 + fi
186 +
187 + tc-export AR CC RANLIB
188 + emake V=1 ${myconf} AR="${AR}" CC="${CC}" RANLIB="${RANLIB}"
189 +}
190 +
191 +src_test() {
192 + # Known to fail with FEATURES=usersandbox
193 + if has usersandbox ${FEATURES}; then
194 + ewarn "You are emerging ${P} with 'usersandbox' enabled." \
195 + "Expect some test failures or emerge with 'FEATURES=-usersandbox'!"
196 + fi
197 +
198 + if use ssl; then
199 + ./utils/gen-test-certs.sh
200 + ./runtest --tls
201 + else
202 + ./runtest
203 + fi
204 +}
205 +
206 +src_install() {
207 + insinto /etc/redis
208 + doins redis.conf sentinel.conf
209 + use prefix || fowners -R redis:redis /etc/redis /etc/redis/{redis,sentinel}.conf
210 + fperms 0750 /etc/redis
211 + fperms 0644 /etc/redis/{redis,sentinel}.conf
212 +
213 + newconfd "${FILESDIR}/redis.confd-r2" redis
214 + newinitd "${FILESDIR}/redis.initd-6" redis
215 +
216 + systemd_newunit "${FILESDIR}/redis.service-4" redis.service
217 + newtmpfiles "${FILESDIR}/redis.tmpfiles-2" redis.conf
218 +
219 + newconfd "${FILESDIR}/redis-sentinel.confd-r1" redis-sentinel
220 + newinitd "${FILESDIR}/redis-sentinel.initd-r1" redis-sentinel
221 +
222 + insinto /etc/logrotate.d/
223 + newins "${FILESDIR}/${PN}.logrotate" ${PN}
224 +
225 + dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
226 +
227 + dobin src/redis-cli
228 + dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
229 + fperms 0750 /usr/sbin/redis-benchmark
230 + dosym redis-server /usr/sbin/redis-sentinel
231 +
232 + if use prefix; then
233 + diropts -m0750
234 + else
235 + diropts -m0750 -o redis -g redis
236 + fi
237 + keepdir /var/{log,lib}/redis
238 +}
239 +
240 +pkg_postinst() {
241 + ewarn "The default redis configuration file location changed to:"
242 + ewarn " /etc/redis/{redis,sentinel}.conf"
243 + ewarn "Please apply your changes to the new configuration files."
244 +}