diff --git a/srcpkgs/valkey-redis b/srcpkgs/valkey-redis new file mode 120000 index 00000000000..59d070a5166 --- /dev/null +++ b/srcpkgs/valkey-redis @@ -0,0 +1 @@ +valkey \ No newline at end of file diff --git a/srcpkgs/valkey/files/valkey-sentinel/run b/srcpkgs/valkey/files/valkey-sentinel/run new file mode 100644 index 00000000000..fbe6afb589d --- /dev/null +++ b/srcpkgs/valkey/files/valkey-sentinel/run @@ -0,0 +1,4 @@ +#!/bin/sh +exec 2>&1 +install -d -m0750 -o _valkey -g _valkey /run/valkey +exec chpst -u _valkey:_valkey valkey-sentinel /etc/valkey/sentinel.conf diff --git a/srcpkgs/valkey/files/valkey/run b/srcpkgs/valkey/files/valkey/run new file mode 100644 index 00000000000..5cb531e30e1 --- /dev/null +++ b/srcpkgs/valkey/files/valkey/run @@ -0,0 +1,4 @@ +#!/bin/sh +exec 2>&1 +install -d -m0750 -o _valkey -g _valkey /run/valkey +exec chpst -u _valkey:_valkey valkey-server /etc/valkey/valkey.conf diff --git a/srcpkgs/valkey/patches/system-jemalloc.patch b/srcpkgs/valkey/patches/system-jemalloc.patch new file mode 100644 index 00000000000..7597a7e49b3 --- /dev/null +++ b/srcpkgs/valkey/patches/system-jemalloc.patch @@ -0,0 +1,15 @@ +diff --git a/src/Makefile b/src/Makefile +index 3bc9f11c0..a4b23d986 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -229,8 +229,8 @@ endif + + ifeq ($(MALLOC),jemalloc) + DEPENDENCY_TARGETS+= jemalloc +- FINAL_CFLAGS+= -DUSE_JEMALLOC -I../deps/jemalloc/include +- FINAL_LIBS := ../deps/jemalloc/lib/libjemalloc.a $(FINAL_LIBS) ++ FINAL_CFLAGS+= -DUSE_JEMALLOC -DJEMALLOC_NO_DEMANGLE -I/usr/include/jemalloc ++ FINAL_LIBS := -ljemalloc $(FINAL_LIBS) + endif + + ifeq ($(BUILD_TLS),yes) diff --git a/srcpkgs/valkey/template b/srcpkgs/valkey/template new file mode 100644 index 00000000000..ca494b0bf54 --- /dev/null +++ b/srcpkgs/valkey/template @@ -0,0 +1,60 @@ +# Template file for 'valkey' +pkgname=valkey +version=8.0.1 +revision=1 +build_style=gnu-makefile +make_build_args="V=1 BUILD_TLS=yes" +make_check_target="test" +hostmakedepends="pkg-config which" +makedepends="openssl-devel" +checkdepends="tcl procps-ng" +short_desc="Flexible distributed key-value datastore" +maintainer="classabbyamp " +license="BSD-3-Clause" +homepage="https://valkey.io" +changelog="https://github.com/valkey-io/valkey/releases" +distfiles="https://github.com/valkey-io/valkey/archive/refs/tags/${version}.tar.gz" +checksum=1e1d6dfbed2f932a87afbc7402be050a73974a9b19a9116897e537a6638e5e1d + +system_accounts="_valkey" +_valkey_homedir="/var/lib/valkey" + +conf_files="/etc/valkey/valkey.conf + /etc/valkey/sentinel.conf" +make_dirs="/var/lib/valkey 0700 _valkey _valkey + /etc/valkey 0750 root _valkey" + +if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + make_build_args+=" MALLOC=libc" +else + makedepends+=" jemalloc-devel" + make_build_args+=" MALLOC=jemalloc" +fi + +post_patch() { + vsed -i \ + -e "s|^dir .*|dir ${_valkey_homedir}|" \ + -e "s|^pidfile .*|pidfile /run/valkey/valkey.pid|" valkey.conf + vsed -i \ + -e "s|^dir .*|dir ${_valkey_homedir}|" \ + -e "s|^pidfile .*|pidfile /run/valkey/sentinel.pid|" sentinel.conf +} + +do_install() { + make INSTALL_BIN=${DESTDIR}/usr/bin PREFIX=/usr install + vlicense COPYING + vinstall valkey.conf 644 etc/valkey + vinstall sentinel.conf 644 etc/valkey + vsv valkey + vsv valkey-sentinel +} + +valkey-redis_package() { + short_desc+=" - redis compatibility links" + depends="${sourcepkg}>=${version}_${revision}" + conflicts="redis>=0" + replaces="redis>=0" + pkg_install() { + vmove usr/bin/redis-* + } +}