commit: 19f86ccdf28653e51f08608e474c02ee45783dac Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Fri Sep 19 13:56:38 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Sep 19 13:57:01 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=19f86ccd
dev-libs/hiredis: add 1.3.0 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-libs/hiredis/Manifest | 1 + dev-libs/hiredis/hiredis-1.3.0.ebuild | 92 +++++++++++++++++++++++++++++++++++ 2 files changed, 93 insertions(+) diff --git a/dev-libs/hiredis/Manifest b/dev-libs/hiredis/Manifest index 54d9108948d7..e7d74dfb65ba 100644 --- a/dev-libs/hiredis/Manifest +++ b/dev-libs/hiredis/Manifest @@ -1,3 +1,4 @@ DIST hiredis-1.0.2.tar.gz 98139 BLAKE2B 86d872cfec3d4e925d5d68e4f4faf1301aa6d706bd0406a8080471e14afc2c25db13b9a0937d29baccd457611af8e46922b5379183c7470c9ae1860aac3af096 SHA512 86497a1c21869bbe535378885eee6dbd594ef96325966511a3513f81e501af0f5ac7fed864f3230372f3ac7a23c05bad477fa5aa90b9747c9fb1408028174f9b DIST hiredis-1.1.0.tar.gz 122002 BLAKE2B 74c23816e59ea241c68640f99970ae68536a1cd605ac1a7146bf52e355f5f74b3d39fb81be02741cf776c06b47b9d5acc7ec66bfdcf802dec3ed68fb28a82b1b SHA512 9dad012c144ed24de6aa413a3a10d19a9d0d9ece18dbc388406cd86c5b98cb66c76c586cb559c601ed13a75051d8921dc2882534cc3605513fde47d57276c3bb DIST hiredis-1.2.0.tar.gz 126216 BLAKE2B 3f0b74205fb4ceb42fb4c1700a9bf95cf2ad2d9880ee1f2da9cbed6096cde5e918b01465ce9d6ec1b29b5934cfa6ab41000ed344a9983cebe6bd1bf64ac0ede1 SHA512 f8984abb29c09e7e6b56e656616c5155f36c53da4161a2d4c85688486411cadcdf20aa1adb9bda208c500b401c750871be1c8d58ba9df5328634d00e9d1b6589 +DIST hiredis-1.3.0.tar.gz 124013 BLAKE2B 8553e08c07f8c9e62f9acaa861a365ee701c3c41c9e187c897c18cddd47a06c6722c458e73fbad5b4ef2938eb5e9ad943428177fd7296a962d6643ae7274385d SHA512 e6e9f7e617bf1d03bdf64a80e74ed24816b6c71607b976757a9962ae02a3b65be7006d84fd353dd5a63c8d0ef1ed385c3b73851b4a119c5ed48f3f86437cf250 diff --git a/dev-libs/hiredis/hiredis-1.3.0.ebuild b/dev-libs/hiredis/hiredis-1.3.0.ebuild new file mode 100644 index 000000000000..8b34923b9eec --- /dev/null +++ b/dev-libs/hiredis/hiredis-1.3.0.ebuild @@ -0,0 +1,92 @@ +# Copyright 1999-2025 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-110 +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 +}
