Diff redis-7.0.13 with a redis-7.2.1

/usr/portage/dev-db/redis/redis-7.2.1.ebuild 2023-10-09 14:52:29.336368346 +0300
6 6
# N.B.: It is no clue in porting to Lua eclasses, as upstream have deviated
7 7
# too far from vanilla Lua, adding their own APIs like lua_enablereadonlytable
8 8

  
9
inherit autotools edo flag-o-matic multiprocessing systemd tmpfiles toolchain-funcs
9
inherit autotools edo multiprocessing systemd tmpfiles toolchain-funcs
10 10

  
11 11
DESCRIPTION="A persistent caching system, key-value, and data structures database"
12
HOMEPAGE="https://redis.io"
12
HOMEPAGE="
13
	https://redis.io
14
	https://github.com/redis/redis
15
"
13 16
SRC_URI="https://download.redis.io/releases/${P}.tar.gz"
14 17

  
15
LICENSE="BSD"
18
LICENSE="BSD Boost-1.0"
16 19
SLOT="0"
17
KEYWORDS="amd64 ~arm arm64 ~hppa ~loong ~ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux"
20
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
18 21
IUSE="+jemalloc selinux ssl systemd tcmalloc test"
19 22
RESTRICT="!test? ( test )"
20 23

  
......
49 52

  
50 53
PATCHES=(
51 54
	"${FILESDIR}"/${PN}-6.2.1-config.patch
52
	"${FILESDIR}"/${PN}-5.0-shared.patch
55
	"${FILESDIR}"/${PN}-7.2.0-system-jemalloc.patch
53 56
	"${FILESDIR}"/${PN}-6.2.3-ppc-atomic.patch
54
	"${FILESDIR}"/${PN}-sentinel-5.0-config.patch
57
	"${FILESDIR}"/${PN}-sentinel-7.2.0-config.patch
55 58
	"${FILESDIR}"/${PN}-7.0.4-no-which.patch
56 59
)
57 60

  
58 61
src_prepare() {
59 62
	default
60 63

  
61
	# Append cflag for lua_cjson
62
	# https://github.com/antirez/redis/commit/4fdcd213#diff-3ba529ae517f6b57803af0502f52a40bL61
63
	append-cflags "-DENABLE_CJSON_GLOBAL"
64
	# Respect user CFLAGS in bundled lua
65
	sed -i '/LUA_CFLAGS/s: -O2::g' deps/Makefile || die
64 66

  
65 67
	# now we will rewrite present Makefiles
66 68
	local makefiles="" MKF
69
	local mysedconf=(
70
		-e 's:$(CC):@CC@:g'
71
		-e 's:$(CFLAGS):@AM_CFLAGS@:g'
72
		-e 's: $(DEBUG)::g'
73

  
74
		-e 's:-Werror ::g'
75
		-e 's:-Werror=deprecated-declarations ::g'
76
	)
67 77
	for MKF in $(find -name 'Makefile' | cut -b 3-); do
68 78
		mv "${MKF}" "${MKF}.in"
69
		sed -i	-e 's:$(CC):@CC@:g' \
70
			-e 's:$(CFLAGS):@AM_CFLAGS@:g' \
71
			-e 's: $(DEBUG)::g' \
72
			-e 's:$(OBJARCH)::g' \
73
			-e 's:ARCH:TARCH:g' \
74
			-e '/^CCOPT=/s:$: $(LDFLAGS):g' \
75
			"${MKF}.in" \
76
		|| die "Sed failed for ${MKF}"
79
		sed -i "${mysedconf[@]}" "${MKF}.in" || die "Sed failed for ${MKF}"
77 80
		makefiles+=" ${MKF}"
78 81
	done
79 82
	# autodetection of compiler and settings; generates the modified Makefiles
80 83
	cp "${FILESDIR}"/configure.ac-7.0 configure.ac || die
81 84

  
82
	sed -i	\
85
	sed -i \
83 86
		-e "/^AC_INIT/s|, __PV__, |, $PV, |" \
84 87
		-e "s:AC_CONFIG_FILES(\[Makefile\]):AC_CONFIG_FILES([${makefiles}]):g" \
85 88
		configure.ac || die "Sed failed for configure.ac"
......
95 98
}
96 99

  
97 100
src_compile() {
98
	local myconf=""
101
	tc-export AR CC RANLIB
102

  
103
	local myconf=(
104
		AR="${AR}"
105
		CC="${CC}"
106
		RANLIB="${RANLIB}"
107

  
108
		V=1 # verbose
109

  
110
		# OPTIMIZATION defaults to -O3. Let's respect user CFLAGS by setting it
111
		# to empty value.
112
		OPTIMIZATION=''
113
		# Disable debug flags in bundled hiredis
114
		DEBUG_FLAGS=''
115

  
116
		BUILD_TLS=$(usex ssl)
117
		USE_SYSTEMD=$(usex systemd)
118
	)
99 119

  
100 120
	if use jemalloc; then
101
		myconf+="MALLOC=jemalloc"
121
		myconf+=( MALLOC=jemalloc )
102 122
	elif use tcmalloc; then
103
		myconf+="MALLOC=tcmalloc"
123
		myconf+=( MALLOC=tcmalloc )
104 124
	else
105
		myconf+="MALLOC=libc"
125
		myconf+=( MALLOC=libc )
106 126
	fi
107 127

  
108
	if use ssl; then
109
		myconf+=" BUILD_TLS=yes"
110
	fi
111

  
112
	export USE_SYSTEMD=$(usex systemd)
113

  
114
	tc-export AR CC RANLIB
115
	emake V=1 ${myconf} AR="${AR}" CC="${CC}" RANLIB="${RANLIB}"
128
	emake "${myconf[@]}"
116 129
}
117 130

  
118 131
src_test() {
Thank you!