diff --git a/srcpkgs/redis/patches/use-system-jemalloc.patch b/srcpkgs/redis/patches/use-system-jemalloc.patch index c32bcdd0925..e3b8e555b9f 100644 --- a/srcpkgs/redis/patches/use-system-jemalloc.patch +++ b/srcpkgs/redis/patches/use-system-jemalloc.patch @@ -8,7 +8,7 @@ - FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include - FINAL_LIBS := ../deps/jemalloc/lib/libjemalloc.a $(FINAL_LIBS) + FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE -+ FINAL_LIBS+= -ljemalloc -ldl ++ FINAL_LIBS+= -ljemalloc endif REDIS_CC=$(QUIET_CC)$(CC) $(FINAL_CFLAGS) diff --git a/srcpkgs/redis/template b/srcpkgs/redis/template index 110484cdb52..0cd5302a434 100644 --- a/srcpkgs/redis/template +++ b/srcpkgs/redis/template @@ -1,16 +1,18 @@ # Template file for 'redis' pkgname=redis -version=7.0.5 +version=7.0.8 revision=1 -makedepends="jemalloc-devel libatomic-devel" +build_style=gnu-makefile +make_build_args="V=1" +make_check_target="test" checkdepends="pkg-config procps-ng tcl-devel which" short_desc="Advanced key-value store" maintainer="Enno Boland " license="BSD-3-Clause" homepage="https://redis.io" -changelog="https://raw.githubusercontent.com/antirez/redis/${version%.*}/00-RELEASENOTES" -distfiles="http://download.redis.io/releases/${pkgname}-${version}.tar.gz" -checksum=67054cc37b58c125df93bd78000261ec0ef4436a26b40f38262c780e56315cc3 +changelog="https://raw.githubusercontent.com/redis/redis/${version%.*}/00-RELEASENOTES" +distfiles="http://download.redis.io/releases/redis-${version}.tar.gz" +checksum=06a339e491306783dcf55b97f15a5dbcbdc01ccbde6dc23027c475cab735e914 system_accounts="redis" redis_homedir="/var/lib/redis" @@ -18,24 +20,26 @@ conf_files="/etc/redis/redis.conf" make_dirs="/var/lib/redis 0700 redis redis" -do_configure() { +if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + make_build_args+=" MALLOC=libc" +else + makedepends+=" jemalloc-devel" + make_build_args+=" MALLOC=jemalloc" +fi + +if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then + makedepends+=" libatomic-devel" +fi + +post_patch() { vsed -i \ -e "s|^# bind 127.0.0.1|bind 127.0.0.1|" \ -e "s|^dir .*|dir ${redis_homedir}|" \ -e "s|^pidfile .*|pidfile /run/redis/redis.pid|" redis.conf - vsed -i -e "s|^FINAL_LIBS=.*|& -latomic|" src/Makefile -} -do_build() { - case "$XBPS_TARGET_MACHINE" in - *-musl) _malloc="none";; - *) _malloc="jemalloc";; - esac - make CC=$CC CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" V=1 MALLOC=${_malloc} ${makejobs} -} - -do_check() { - make test + if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then + vsed -i -e "s|^FINAL_LIBS=.*|& -latomic|" src/Makefile + fi } do_install() {