Gentoo Archives: gentoo-commits

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-db/redis/
Date: Thu, 26 Dec 2019 21:47:20
Message-Id: 1577286839.5794ff3b13a3c7e6ee4c88dccf0b734ac79556af.robbat2@gentoo
1 commit: 5794ff3b13a3c7e6ee4c88dccf0b734ac79556af
2 Author: Tomáš Mózes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Wed Nov 20 06:40:40 2019 +0000
4 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 25 15:13:59 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5794ff3b
7
8 dev-db/redis: bump to 5.0.7
9
10 Bug: https://bugs.gentoo.org/698436
11 Package-Manager: Portage-2.3.79, Repoman-2.3.17
12 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
13
14 dev-db/redis/redis-5.0.7.ebuild | 159 ++++++++++++++++++++++++++++++++++++++++
15 1 file changed, 159 insertions(+)
16
17 diff --git a/dev-db/redis/redis-5.0.7.ebuild b/dev-db/redis/redis-5.0.7.ebuild
18 new file mode 100644
19 index 00000000000..e30178e06fb
20 --- /dev/null
21 +++ b/dev-db/redis/redis-5.0.7.ebuild
22 @@ -0,0 +1,159 @@
23 +# Copyright 1999-2019 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +inherit autotools flag-o-matic systemd toolchain-funcs
29 +
30 +DESCRIPTION="A persistent caching system, key-value and data structures database"
31 +HOMEPAGE="https://redis.io"
32 +SRC_URI="http://download.redis.io/releases/${P}.tar.gz"
33 +
34 +LICENSE="BSD"
35 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux ~x86-macos ~x86-solaris"
36 +IUSE="+jemalloc tcmalloc luajit test"
37 +RESTRICT="!test? ( test )"
38 +SLOT="0"
39 +
40 +# Redis does NOT build with Lua 5.2 or newer at this time.
41 +# This should link correctly with both unslotted & slotted Lua, without
42 +# changes.
43 +COMMON_DEPEND="
44 + luajit? ( dev-lang/luajit:2 )
45 + !luajit? ( || ( dev-lang/lua:5.1 =dev-lang/lua-5.1*:0 ) )
46 + tcmalloc? ( dev-util/google-perftools )
47 + jemalloc? ( >=dev-libs/jemalloc-5.1:= )"
48 +
49 +RDEPEND="
50 + ${COMMON_DEPEND}
51 + acct-group/redis
52 + acct-user/redis"
53 +
54 +BDEPEND="
55 + ${COMMON_DEPEND}
56 + virtual/pkgconfig"
57 +
58 +# Tcl is only needed in the CHOST test env
59 +DEPEND="
60 + ${COMMON_DEPEND}
61 + test? ( dev-lang/tcl:0= )"
62 +
63 +REQUIRED_USE="?? ( tcmalloc jemalloc )"
64 +
65 +PATCHES=(
66 + "${FILESDIR}"/${PN}-3.2.3-config.patch
67 + "${FILESDIR}"/${PN}-5.0-shared.patch
68 + "${FILESDIR}"/${PN}-5.0-sharedlua.patch
69 + "${FILESDIR}"/${PN}-sentinel-5.0-config.patch
70 +)
71 +
72 +src_prepare() {
73 + default
74 +
75 + # Copy lua modules into build dir
76 + cp "${S}"/deps/lua/src/{fpconv,lua_bit,lua_cjson,lua_cmsgpack,lua_struct,strbuf}.c "${S}"/src || die
77 + cp "${S}"/deps/lua/src/{fpconv,strbuf}.h "${S}"/src || die
78 + # Append cflag for lua_cjson
79 + # https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
80 + append-cflags "-DENABLE_CJSON_GLOBAL"
81 +
82 + # now we will rewrite present Makefiles
83 + local makefiles="" MKF
84 + for MKF in $(find -name 'Makefile' | cut -b 3-); do
85 + mv "${MKF}" "${MKF}.in"
86 + sed -i -e 's:$(CC):@CC@:g' \
87 + -e 's:$(CFLAGS):@AM_CFLAGS@:g' \
88 + -e 's: $(DEBUG)::g' \
89 + -e 's:$(OBJARCH)::g' \
90 + -e 's:ARCH:TARCH:g' \
91 + -e '/^CCOPT=/s:$: $(LDFLAGS):g' \
92 + "${MKF}.in" \
93 + || die "Sed failed for ${MKF}"
94 + makefiles+=" ${MKF}"
95 + done
96 + # autodetection of compiler and settings; generates the modified Makefiles
97 + cp "${FILESDIR}"/configure.ac-3.2 configure.ac || die
98 +
99 + # Use the correct pkgconfig name for Lua
100 + if false && has_version 'dev-lang/lua:5.3'; then
101 + # Lua5.3 gives:
102 + #lua_bit.c:83:2: error: #error "Unknown number type, check LUA_NUMBER_* in luaconf.h"
103 + LUAPKGCONFIG=lua5.3
104 + elif false && has_version 'dev-lang/lua:5.2'; then
105 + # Lua5.2 fails with:
106 + # scripting.c:(.text+0x1f9b): undefined reference to `lua_open'
107 + # Because lua_open because lua_newstate in 5.2
108 + LUAPKGCONFIG=lua5.2
109 + elif has_version 'dev-lang/lua:5.1'; then
110 + LUAPKGCONFIG=lua5.1
111 + else
112 + LUAPKGCONFIG=lua
113 + fi
114 + # The upstream configure script handles luajit specially, and is not
115 + # effected by these changes.
116 + einfo "Selected LUAPKGCONFIG=${LUAPKGCONFIG}"
117 + sed -i \
118 + -e "/^AC_INIT/s|, [0-9].+, |, $PV, |" \
119 + -e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
120 + -e "/PKG_CHECK_MODULES.*\<LUA\>/s,lua5.1,${LUAPKGCONFIG},g" \
121 + configure.ac || die "Sed failed for configure.ac"
122 + eautoreconf
123 +}
124 +
125 +src_configure() {
126 + econf \
127 + $(use_with luajit)
128 +
129 + # Linenoise can't be built with -std=c99, see https://bugs.gentoo.org/451164
130 + # also, don't define ANSI/c99 for lua twice
131 + sed -i -e "s:-std=c99::g" deps/linenoise/Makefile deps/Makefile || die
132 +}
133 +
134 +src_compile() {
135 + tc-export CC AR RANLIB
136 +
137 + local myconf=""
138 +
139 + if use tcmalloc; then
140 + myconf="${myconf} USE_TCMALLOC=yes"
141 + elif use jemalloc; then
142 + myconf="${myconf} JEMALLOC_SHARED=yes"
143 + else
144 + myconf="${myconf} MALLOC=yes"
145 + fi
146 +
147 + emake ${myconf} V=1 CC="${CC}" AR="${AR} rcu" RANLIB="${RANLIB}"
148 +}
149 +
150 +src_install() {
151 + insinto /etc/
152 + doins redis.conf sentinel.conf
153 + use prefix || fowners redis:redis /etc/{redis,sentinel}.conf
154 + fperms 0644 /etc/{redis,sentinel}.conf
155 +
156 + newconfd "${FILESDIR}/redis.confd-r1" redis
157 + newinitd "${FILESDIR}/redis.initd-5" redis
158 +
159 + systemd_newunit "${FILESDIR}/redis.service-3" redis.service
160 + systemd_newtmpfilesd "${FILESDIR}/redis.tmpfiles-2" redis.conf
161 +
162 + newconfd "${FILESDIR}/redis-sentinel.confd" redis-sentinel
163 + newinitd "${FILESDIR}/redis-sentinel.initd" redis-sentinel
164 +
165 + insinto /etc/logrotate.d/
166 + newins "${FILESDIR}/${PN}.logrotate" ${PN}
167 +
168 + dodoc 00-RELEASENOTES BUGS CONTRIBUTING MANIFESTO README.md
169 +
170 + dobin src/redis-cli
171 + dosbin src/redis-benchmark src/redis-server src/redis-check-aof src/redis-check-rdb
172 + fperms 0750 /usr/sbin/redis-benchmark
173 + dosym redis-server /usr/sbin/redis-sentinel
174 +
175 + if use prefix; then
176 + diropts -m0750
177 + else
178 + diropts -m0750 -o redis -g redis
179 + fi
180 + keepdir /var/{log,lib}/redis
181 +}