summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Vaněk <arkamar@gentoo.org>2024-04-19 11:34:15 +0200
committerPetr Vaněk <arkamar@gentoo.org>2024-04-19 11:35:48 +0200
commitd108c3e245ad060e3f1777ef3b3b97ac25c5b4dd (patch)
tree51ea1203b640bb4e4c07ed6792721ac92ebf8488 /dev-libs
parentdev-libs/hiredis: correct hiredis-test parameter (diff)
downloadgentoo-d108c3e245ad060e3f1777ef3b3b97ac25c5b4dd.tar.gz
gentoo-d108c3e245ad060e3f1777ef3b3b97ac25c5b4dd.tar.bz2
gentoo-d108c3e245ad060e3f1777ef3b3b97ac25c5b4dd.zip
dev-libs/hiredis: add 1.2.0
Signed-off-by: Petr Vaněk <arkamar@gentoo.org>
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/hiredis/Manifest1
-rw-r--r--dev-libs/hiredis/hiredis-1.2.0.ebuild96
2 files changed, 97 insertions, 0 deletions
diff --git a/dev-libs/hiredis/Manifest b/dev-libs/hiredis/Manifest
index 171a4ffec6a0..54d9108948d7 100644
--- a/dev-libs/hiredis/Manifest
+++ b/dev-libs/hiredis/Manifest
@@ -1,2 +1,3 @@
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
diff --git a/dev-libs/hiredis/hiredis-1.2.0.ebuild b/dev-libs/hiredis/hiredis-1.2.0.ebuild
new file mode 100644
index 000000000000..270f776b8fb1
--- /dev/null
+++ b/dev-libs/hiredis/hiredis-1.2.0.ebuild
@@ -0,0 +1,96 @@
+# Copyright 1999-2024 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 ~ia64 ~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
+)
+
+src_prepare() {
+ default
+
+ # use GNU ld syntax on Solaris
+ sed -i -e '/DYLIB_MAKE_CMD=.* -G/d' Makefile || die
+}
+
+_build() {
+ emake \
+ 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= \
+ "$@"
+}
+
+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
+}