Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/hiredis/
Date: Tue, 05 Oct 2021 04:09:06
Message-Id: 1633406931.24428f0153ac66a130c29e4c9a91b161f3da6278.sam@gentoo
1 commit: 24428f0153ac66a130c29e4c9a91b161f3da6278
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 5 04:07:00 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 5 04:08:51 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=24428f01
7
8 dev-libs/hiredis: add 1.0.1
9
10 Bug: https://bugs.gentoo.org/816318
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 dev-libs/hiredis/Manifest | 1 +
14 dev-libs/hiredis/hiredis-1.0.1.ebuild | 87 +++++++++++++++++++++++++++++++++++
15 2 files changed, 88 insertions(+)
16
17 diff --git a/dev-libs/hiredis/Manifest b/dev-libs/hiredis/Manifest
18 index bee3dbedda0..314ee23696f 100644
19 --- a/dev-libs/hiredis/Manifest
20 +++ b/dev-libs/hiredis/Manifest
21 @@ -1,2 +1,3 @@
22 DIST hiredis-0.14.1.tar.gz 64372 BLAKE2B 9846b05e21bfadb876e26ab45bf5c29a3283b602ef725dfbd877815be690bb5579551f0c452e1d8abf9ae985f6b71408a3b86b343ca5d6dce58dd4897640996a SHA512 a7310f2d65075df0c17636a0220e16487759471a3442b1de2595ab747565f6b6262e37131613b13e396b31050bcbe5529c35d420cd43fd7d500d9d563d469c4f
23 DIST hiredis-1.0.0.tar.gz 97507 BLAKE2B 247852d53be96e36dbdd7d4d8cfbda4406aa66281f26c28c3f80ab4593679122fd59430b2d5f04d20126b4459fc75af0a1fd67f1ee1db691d8db575debad2b61 SHA512 eb56201121eecdbfc8d42e8c2c141ae77bea248eeb36687ac6835c9b2404f5475beb351c4d8539d552db4d88e933bb2bd5b73f165e62b130bb11aeff39928e69
24 +DIST hiredis-1.0.1.tar.gz 97937 BLAKE2B 476bb3607aabe2147eead61c98de325f4dbd2d7c7439513ea0cd98980fc151a64798647757e46feb61e8914e47b42963bf128c938c94c42c448369065532166f SHA512 87909f78171cf4deeb3d030484b55fbd1a7f7f27f33636f90e169a900ddc5c5ec447d2df34739ada3cf35a50d647cb4fcbe2754f4521d18f770f1cf8ed962909
25
26 diff --git a/dev-libs/hiredis/hiredis-1.0.1.ebuild b/dev-libs/hiredis/hiredis-1.0.1.ebuild
27 new file mode 100644
28 index 00000000000..29725e58a6b
29 --- /dev/null
30 +++ b/dev-libs/hiredis/hiredis-1.0.1.ebuild
31 @@ -0,0 +1,87 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +inherit toolchain-funcs
38 +
39 +DESCRIPTION="Minimalistic C client library for the Redis database"
40 +HOMEPAGE="https://github.com/redis/hiredis"
41 +SRC_URI="https://github.com/redis/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
42 +
43 +LICENSE="BSD"
44 +SLOT="0/1.0.0"
45 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-solaris"
46 +IUSE="examples ssl static-libs test"
47 +RESTRICT="!test? ( test )"
48 +
49 +DEPEND="ssl? ( dev-libs/openssl:= )"
50 +RDEPEND="${RDEPEND}"
51 +BDEPEND="test? ( dev-db/redis )"
52 +
53 +PATCHES=(
54 + "${FILESDIR}"/${PN}-1.0.0-disable-network-tests.patch
55 +)
56 +
57 +src_prepare() {
58 + default
59 +
60 + # use GNU ld syntax on Solaris
61 + sed -i -e '/DYLIB_MAKE_CMD=.* -G/d' Makefile || die
62 +}
63 +
64 +_build() {
65 + emake \
66 + AR="$(tc-getAR)" \
67 + CC="$(tc-getCC)" \
68 + PREFIX="${EPREFIX}/usr" \
69 + LIBRARY_PATH="$(get_libdir)" \
70 + USE_SSL=$(usex ssl 1 0) \
71 + DEBUG_FLAGS= \
72 + OPTIMIZATION= \
73 + "$@"
74 +}
75 +
76 +src_compile() {
77 + # The static lib re-uses the same objects as the shared lib, so
78 + # overhead is low w/creating it all the time. It's also needed
79 + # by the tests.
80 + _build dynamic static hiredis.pc
81 +}
82 +
83 +src_test() {
84 + local REDIS_PID="${T}"/hiredis.pid
85 + local REDIS_SOCK="${T}"/hiredis.sock
86 + local REDIS_PORT=56379
87 + local REDIS_TEST_CONFIG="
88 + daemonize yes
89 + pidfile ${REDIS_PID}
90 + port ${REDIS_PORT}
91 + bind 127.0.0.1
92 + unixsocket //${REDIS_SOCK}
93 + "
94 +
95 + _build hiredis-test
96 +
97 + "${EPREFIX}"/usr/sbin/redis-server - <<< "${REDIS_TEST_CONFIG}" || die
98 + ./hiredis-test -h 127.0.0.1 -p ${REDIS_PID} -s ${REDIS_SOCK}
99 + local ret=$?
100 +
101 + kill "$(<"${REDIS_PID}")" || die
102 + [[ ${ret} != "0" ]] && die "tests failed"
103 +}
104 +
105 +src_install() {
106 + _build PREFIX="${ED}/usr" install
107 +
108 + if ! use static-libs ; then
109 + find "${ED}" -name '*.a' -delete || die
110 + fi
111 +
112 + insinto /usr/$(get_libdir)/pkgconfig
113 + doins ${PN}.pc
114 +
115 + local DOCS=( CHANGELOG.md README.md )
116 + use examples && DOCS+=( examples )
117 + einstalldocs
118 +}