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/, dev-libs/hiredis/files/
Date: Thu, 08 Oct 2020 19:03:37
Message-Id: 1602183755.c1badd3b7cb84cdfd37e40c81258eb8e933c95a8.sam@gentoo
1 commit: c1badd3b7cb84cdfd37e40c81258eb8e933c95a8
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Oct 8 19:02:35 2020 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Oct 8 19:02:35 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1badd3b
7
8 dev-libs/hiredis: bump to 1.0.0
9
10 Package-Manager: Portage-3.0.4, Repoman-3.0.1
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 dev-libs/hiredis/Manifest | 1 +
14 .../hiredis-1.0.0-disable-network-tests.patch | 53 ++++++++++++++
15 dev-libs/hiredis/hiredis-1.0.0.ebuild | 80 ++++++++++++++++++++++
16 3 files changed, 134 insertions(+)
17
18 diff --git a/dev-libs/hiredis/Manifest b/dev-libs/hiredis/Manifest
19 index 6cc58a1f9b4..bee3dbedda0 100644
20 --- a/dev-libs/hiredis/Manifest
21 +++ b/dev-libs/hiredis/Manifest
22 @@ -1 +1,2 @@
23 DIST hiredis-0.14.1.tar.gz 64372 BLAKE2B 9846b05e21bfadb876e26ab45bf5c29a3283b602ef725dfbd877815be690bb5579551f0c452e1d8abf9ae985f6b71408a3b86b343ca5d6dce58dd4897640996a SHA512 a7310f2d65075df0c17636a0220e16487759471a3442b1de2595ab747565f6b6262e37131613b13e396b31050bcbe5529c35d420cd43fd7d500d9d563d469c4f
24 +DIST hiredis-1.0.0.tar.gz 97507 BLAKE2B 247852d53be96e36dbdd7d4d8cfbda4406aa66281f26c28c3f80ab4593679122fd59430b2d5f04d20126b4459fc75af0a1fd67f1ee1db691d8db575debad2b61 SHA512 eb56201121eecdbfc8d42e8c2c141ae77bea248eeb36687ac6835c9b2404f5475beb351c4d8539d552db4d88e933bb2bd5b73f165e62b130bb11aeff39928e69
25
26 diff --git a/dev-libs/hiredis/files/hiredis-1.0.0-disable-network-tests.patch b/dev-libs/hiredis/files/hiredis-1.0.0-disable-network-tests.patch
27 new file mode 100644
28 index 00000000000..c8a5822c8ef
29 --- /dev/null
30 +++ b/dev-libs/hiredis/files/hiredis-1.0.0-disable-network-tests.patch
31 @@ -0,0 +1,53 @@
32 +diff --git a/test.c b/test.c
33 +index c0eeca7..5d70471 100644
34 +--- a/test.c
35 ++++ b/test.c
36 +@@ -641,6 +641,7 @@ static void test_blocking_connection_errors(void) {
37 + struct addrinfo *ai_tmp = NULL;
38 +
39 + int rv = getaddrinfo(HIREDIS_BAD_DOMAIN, "6379", &hints, &ai_tmp);
40 ++ #if 0
41 + if (rv != 0) {
42 + // Address does *not* exist
43 + test("Returns error when host cannot be resolved: ");
44 +@@ -662,6 +663,7 @@ static void test_blocking_connection_errors(void) {
45 + printf("Skipping NXDOMAIN test. Found evil ISP!\n");
46 + freeaddrinfo(ai_tmp);
47 + }
48 ++ #endif
49 +
50 + #ifndef _WIN32
51 + test("Returns error when the port is not open: ");
52 +@@ -670,10 +672,12 @@ static void test_blocking_connection_errors(void) {
53 + strcmp(c->errstr,"Connection refused") == 0);
54 + redisFree(c);
55 +
56 ++ #if 0
57 + test("Returns error when the unix_sock socket path doesn't accept connections: ");
58 + c = redisConnectUnix((char*)"/tmp/idontexist.sock");
59 + test_cond(c->err == REDIS_ERR_IO); /* Don't care about the message... */
60 + redisFree(c);
61 ++ #endif
62 + #endif
63 + }
64 +
65 +diff --git a/test.c b/test.c
66 +index 1e8fce1..91625ca 100644
67 +--- a/test.c
68 ++++ b/test.c
69 +@@ -1324,6 +1324,7 @@ int main(int argc, char **argv) {
70 + test_blocking_connection_errors();
71 + test_free_null();
72 +
73 ++ #if 0
74 + printf("\nTesting against TCP connection (%s:%d):\n", cfg.tcp.host, cfg.tcp.port);
75 + cfg.type = CONN_TCP;
76 + test_blocking_connection(cfg);
77 +@@ -1332,6 +1333,7 @@ int main(int argc, char **argv) {
78 + test_invalid_timeout_errors(cfg);
79 + test_append_formatted_commands(cfg);
80 + if (throughput) test_throughput(cfg);
81 ++ #endif
82 +
83 + printf("\nTesting against Unix socket connection (%s): ", cfg.unix_sock.path);
84 + if (test_unix_socket) {
85
86 diff --git a/dev-libs/hiredis/hiredis-1.0.0.ebuild b/dev-libs/hiredis/hiredis-1.0.0.ebuild
87 new file mode 100644
88 index 00000000000..f65824d561b
89 --- /dev/null
90 +++ b/dev-libs/hiredis/hiredis-1.0.0.ebuild
91 @@ -0,0 +1,80 @@
92 +# Copyright 1999-2020 Gentoo Authors
93 +# Distributed under the terms of the GNU General Public License v2
94 +
95 +EAPI="7"
96 +
97 +inherit toolchain-funcs
98 +
99 +DESCRIPTION="Minimalistic C client library for the Redis database"
100 +HOMEPAGE="https://github.com/redis/hiredis"
101 +SRC_URI="https://github.com/redis/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
102 +
103 +LICENSE="BSD"
104 +SLOT="0/1.0.0"
105 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86 ~x64-solaris"
106 +IUSE="examples static-libs test"
107 +RESTRICT="!test? ( test )"
108 +
109 +DEPEND="test? ( dev-db/redis )"
110 +
111 +src_prepare() {
112 + local PATCHES=(
113 + "${FILESDIR}/${PN}-1.0.0-disable-network-tests.patch"
114 + )
115 + default
116 +
117 + # use GNU ld syntax on Solaris
118 + sed -i -e '/DYLIB_MAKE_CMD=.* -G/d' Makefile || die
119 +}
120 +
121 +_build() {
122 + emake \
123 + AR="$(tc-getAR)" \
124 + CC="$(tc-getCC)" \
125 + PREFIX="${EPREFIX}/usr" \
126 + LIBRARY_PATH="$(get_libdir)" \
127 + DEBUG_FLAGS= \
128 + OPTIMIZATION= \
129 + "$@"
130 +}
131 +
132 +src_compile() {
133 + # The static lib re-uses the same objects as the shared lib, so
134 + # overhead is low w/creating it all the time. It's also needed
135 + # by the tests.
136 + _build dynamic static hiredis.pc
137 +}
138 +
139 +src_test() {
140 + local REDIS_PID="${T}"/hiredis.pid
141 + local REDIS_SOCK="${T}"/hiredis.sock
142 + local REDIS_PORT=56379
143 + local REDIS_TEST_CONFIG="daemonize yes
144 + pidfile ${REDIS_PID}
145 + port ${REDIS_PORT}
146 + bind 127.0.0.1
147 + unixsocket //${REDIS_SOCK}"
148 +
149 + _build hiredis-test
150 +
151 + /usr/sbin/redis-server - <<< "${REDIS_TEST_CONFIG}" || die
152 + ./hiredis-test -h 127.0.0.1 -p ${REDIS_PID} -s ${REDIS_SOCK}
153 + local ret=$?
154 +
155 + kill "$(<"${REDIS_PID}")" || die
156 + [ ${ret} != "0" ] && die "tests failed"
157 +}
158 +
159 +src_install() {
160 + _build PREFIX="${ED}/usr" install
161 + if ! use static-libs; then
162 + rm "${ED}/usr/$(get_libdir)/libhiredis.a" || die
163 + fi
164 +
165 + insinto /usr/$(get_libdir)/pkgconfig
166 + doins ${PN}.pc
167 +
168 + local DOCS=( CHANGELOG.md README.md )
169 + use examples && DOCS+=( examples )
170 + einstalldocs
171 +}