From 8f1dcbaf5d1c170f320b8eab8d60d9bbbb9d4471 Mon Sep 17 00:00:00 2001 From: Sam James Date: Mon, 7 Sep 2026 21:47:22 +0100 Subject: [PATCH] dev-libs/hiredis: add 1.4.1 Bug: https://bugs.gentoo.org/982123 Signed-off-by: Sam James --- dev-libs/hiredis/Manifest | 1 + dev-libs/hiredis/hiredis-1.4.1.ebuild | 92 +++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 dev-libs/hiredis/hiredis-1.4.1.ebuild diff --git a/dev-libs/hiredis/Manifest b/dev-libs/hiredis/Manifest index 4b0c2d9fff85e..0a386eeceb8fb 100644 --- a/dev-libs/hiredis/Manifest +++ b/dev-libs/hiredis/Manifest @@ -5,3 +5,4 @@ DIST hiredis-1.2.0.tar.gz 126216 BLAKE2B 3f0b74205fb4ceb42fb4c1700a9bf95cf2ad2d9 DIST hiredis-1.2.1.tar.gz 128766 BLAKE2B cf77fc0f4e5a711059a0b84de5239a6e1e18c03ba7c59f73e39efd11f4c8d86ac32f5cf14d7a5119fd8e4341050c5a64009f3bfcc292765440d46c39d3513b4a SHA512 51f4a11199d9fc77121c65e211c7e8d802de9180bfbd7130851be63c5625aaaab2da7aa9614c292ee76ccccb5bff5fbfba37aa231f6e93af9c086b0b96c45603 DIST hiredis-1.3.0.tar.gz 124013 BLAKE2B 8553e08c07f8c9e62f9acaa861a365ee701c3c41c9e187c897c18cddd47a06c6722c458e73fbad5b4ef2938eb5e9ad943428177fd7296a962d6643ae7274385d SHA512 e6e9f7e617bf1d03bdf64a80e74ed24816b6c71607b976757a9962ae02a3b65be7006d84fd353dd5a63c8d0ef1ed385c3b73851b4a119c5ed48f3f86437cf250 DIST hiredis-1.3.1.tar.gz 126467 BLAKE2B 5d6f09b2f11601837bdf55137361dfa01474cf816fa36056ed861be3423fbfb3ee96921ee65b5c50cf5eaedaeb45d543cc0795c7ae1f155bf5e45c85c2ecf7c5 SHA512 c7d852b57d8e7e534b5a79496956afe253b6868629344bd9c2d45304ef769cc52f18bb86e0dc8e4deb1222ea2d7d7fb5e3b14c2012bb44bb81ec25e6577d61ae +DIST hiredis-1.4.1.tar.gz 175407 BLAKE2B 78e142a9c9bad04f8c921ac0be7bcd35aac5508a97f6eee133a0ed78aa76901f65d737145a7d0c56d5b91c8faef263bae4ff79d846e4690ff93fea1efc171762 SHA512 2f7a826032bedb85473b06684e075d9e57105068c44f21b00217f94a7ebbefaa8700c7bf4675c382060a7b00aceb01c90023fdfbe4024a412e05432b852d6dc2 diff --git a/dev-libs/hiredis/hiredis-1.4.1.ebuild b/dev-libs/hiredis/hiredis-1.4.1.ebuild new file mode 100644 index 0000000000000..3e8f3809b3993 --- /dev/null +++ b/dev-libs/hiredis/hiredis-1.4.1.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="Minimalistic C client library for the Redis database" +HOMEPAGE="https://github.com/redis/hiredis" +SRC_URI="https://github.com/redis/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +# Always check "Upgrading from ..." in README +# e.g. https://github.com/redis/hiredis#upgrading-to--120-prerelease +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-solaris" +IUSE="examples ssl static-libs test" +RESTRICT="!test? ( test )" + +DEPEND="ssl? ( dev-libs/openssl:= )" +RDEPEND="${DEPEND}" +BDEPEND=" + test? ( + dev-db/redis + dev-libs/libevent + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-1.1.0-disable-network-tests.patch +) + +_build() { + local myconf=( + AR="$(tc-getAR)" + CC="$(tc-getCC)" + PREFIX="${EPREFIX}/usr" + LIBRARY_PATH="$(get_libdir)" + USE_SSL=$(usex ssl 1 0) + TEST_ASYNC=$(usex test 1 0) + DEBUG_FLAGS= + OPTIMIZATION= + USE_WERROR=0 + ) + + emake "${myconf[@]}" "$@" +} + +src_compile() { + # The static lib re-uses the same objects as the shared lib, so + # overhead is low w/creating it all the time. It's also needed + # by the tests. + _build dynamic static hiredis{,_ssl}.pc +} + +src_test() { + # Compare with https://github.com/redis/hiredis/blob/648763c36e9f6493b13a77da35eb33ef0652b4e2/Makefile#L32 + local REDIS_PID="${T}"/hiredis.pid + local REDIS_SOCK="${T}"/hiredis.sock + local REDIS_PORT=56379 + local REDIS_TEST_CONFIG=" + daemonize yes + pidfile ${REDIS_PID} + port ${REDIS_PORT} + bind 127.0.0.1 + unixsocket //${REDIS_SOCK} + " + + _build hiredis-test + + "${EPREFIX}"/usr/sbin/redis-server - <<< "${REDIS_TEST_CONFIG}" || die + ./hiredis-test -h 127.0.0.1 -p ${REDIS_PORT} -s ${REDIS_SOCK} + local ret=$? + + kill "$(<"${REDIS_PID}")" || die + [[ ${ret} != "0" ]] && die "tests failed" +} + +src_install() { + _build PREFIX="${ED}"/usr install + + if ! use static-libs ; then + find "${ED}" -name '*.a' -delete || die + fi + + insinto /usr/$(get_libdir)/pkgconfig + doins ${PN}.pc + + local DOCS=( CHANGELOG.md README.md ) + use examples && DOCS+=( examples ) + einstalldocs +}