commit:     07cf4f6acae4827766ff465039c4bcfbe0fcbbf2
Author:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 20 20:49:53 2024 +0000
Commit:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Sat Apr 20 21:33:22 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07cf4f6a

dev-libs/hiredis: avoid default -Werror

Upstream introduced unconditional addition of -Werror flag in
hiredis-1.2.0 in commit [1]. This was changed to conditional addition
controlled by USE_WERROR variable later in commit [2]. This change
backports it in form of patch.

Additionally, emake newly takes arguments from local myconf array.

[1] 
https://github.com/redis/hiredis/commit/5cbd1f2960662c18b1d2b2dac7352f2b5b1ba776
[2] 
https://github.com/redis/hiredis/commit/bff171c9fc83f8abed9a283a3da2dc91a5671419

Closes: https://bugs.gentoo.org/930336
Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>

 .../files/hiredis-1.2.0-conditional-werror.patch   | 24 ++++++++++++++++++++++
 dev-libs/hiredis/hiredis-1.2.0.ebuild              | 23 ++++++++++++---------
 2 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/dev-libs/hiredis/files/hiredis-1.2.0-conditional-werror.patch 
b/dev-libs/hiredis/files/hiredis-1.2.0-conditional-werror.patch
new file mode 100644
index 000000000000..2ab7cf86e089
--- /dev/null
+++ b/dev-libs/hiredis/files/hiredis-1.2.0-conditional-werror.patch
@@ -0,0 +1,24 @@
+From bff171c9fc83f8abed9a283a3da2dc91a5671419 Mon Sep 17 00:00:00 2001
+From: Romain Geissler <[email protected]>
+Date: Thu, 13 Jul 2023 12:39:45 +0000
+Subject: [PATCH] Allow disabling the -Werror flag.
+
+Upstream-commit: 
https://github.com/redis/hiredis/commit/bff171c9fc83f8abed9a283a3da2dc91a5671419
+
+diff --git a/Makefile b/Makefile
+index bd2106b1d..56e3d59be 100644
+--- a/Makefile
++++ b/Makefile
+@@ -39,7 +39,11 @@ export REDIS_TEST_CONFIG
+ CC:=$(shell sh -c 'type $${CC%% *} >/dev/null 2>/dev/null && echo $(CC) || 
echo gcc')
+ CXX:=$(shell sh -c 'type $${CXX%% *} >/dev/null 2>/dev/null && echo $(CXX) || 
echo g++')
+ OPTIMIZATION?=-O3
+-WARNINGS=-Wall -Wextra -Werror -Wstrict-prototypes -Wwrite-strings 
-Wno-missing-field-initializers
++WARNINGS=-Wall -Wextra -Wstrict-prototypes -Wwrite-strings 
-Wno-missing-field-initializers
++USE_WERROR?=1
++ifeq ($(USE_WERROR),1)
++  WARNINGS+=-Werror
++endif
+ DEBUG_FLAGS?= -g -ggdb
+ REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CPPFLAGS) $(CFLAGS) $(WARNINGS) 
$(DEBUG_FLAGS) $(PLATFORM_FLAGS)
+ REAL_LDFLAGS=$(LDFLAGS)

diff --git a/dev-libs/hiredis/hiredis-1.2.0.ebuild 
b/dev-libs/hiredis/hiredis-1.2.0.ebuild
index 6c1b7be7b083..10071f0716a4 100644
--- a/dev-libs/hiredis/hiredis-1.2.0.ebuild
+++ b/dev-libs/hiredis/hiredis-1.2.0.ebuild
@@ -28,19 +28,22 @@ BDEPEND="
 
 PATCHES=(
        "${FILESDIR}"/${PN}-1.1.0-disable-network-tests.patch
+       "${FILESDIR}"/${PN}-1.2.0-conditional-werror.patch # bug 930336
 )
 
 _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= \
-               "$@"
+       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() {

Reply via email to