commit:     c09e4b7cfb3c84a29dd2c66beb30fb5128078088
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  6 19:52:48 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Thu Oct  6 20:44:44 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c09e4b7c

net-misc/ices: fix build with clang/lld and upcoming clang-16

One configure test was broken with (any) clang/lld on multilib profiles
due to passing -L/usr/lib which led to underlinking wrt #740794.

For 16 it's the usual missing header, handled by adjusting the autoconf
test (revbumped in previous commit at same time for other compilers).

Closes: https://bugs.gentoo.org/740794
Closes: https://bugs.gentoo.org/870973
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 net-misc/ices/files/ices-2.0.2-gettimeofday.patch | 15 +++++++++++++++
 net-misc/ices/files/ices-2.0.2-libogg-test.patch  | 17 +++++++++++++++++
 net-misc/ices/ices-2.0.2-r2.ebuild                | 13 +++++++++++++
 3 files changed, 45 insertions(+)

diff --git a/net-misc/ices/files/ices-2.0.2-gettimeofday.patch 
b/net-misc/ices/files/ices-2.0.2-gettimeofday.patch
new file mode 100644
index 000000000000..ba5e7ca1c4a5
--- /dev/null
+++ b/net-misc/ices/files/ices-2.0.2-gettimeofday.patch
@@ -0,0 +1,15 @@
+Uses gettimeofday but won't include sys/time.h without HAVE_SYS_TIME_H
+leading to failure with -Werror=implicit-function-declaration (clang16).
+
+sys/timeb.h is for deprecated ftime() and should not be used.
+
+https://bugs.gentoo.org/870973
+--- a/configure.in
++++ b/configure.in
+@@ -51,5 +51,5 @@
+ dnl Checks for header files.
+ AC_HEADER_STDC
+-AC_CHECK_HEADERS([stropts.h sys/timeb.h sys/select.h])
++AC_CHECK_HEADERS([stropts.h sys/time.h sys/select.h])
+ 
+ dnl ================================================================

diff --git a/net-misc/ices/files/ices-2.0.2-libogg-test.patch 
b/net-misc/ices/files/ices-2.0.2-libogg-test.patch
new file mode 100644
index 000000000000..78a334b93096
--- /dev/null
+++ b/net-misc/ices/files/ices-2.0.2-libogg-test.patch
@@ -0,0 +1,17 @@
+clang/lld will try to use the given -L/usr/lib + 32bit files and potentially
+fail the the test on 64bit, carries on but leads to ogg underlinking.
+
+Quickfix, ideally this should use pkg-config and hard-fail if not found.
+
+https://bugs.gentoo.org/740794
+--- a/m4/ogg.m4
++++ b/m4/ogg.m4
+@@ -24,8 +24,4 @@
+ fi
+ 
+-XIPH_GCC_WARNING([-I$ogg_prefix/include],,
+-    [ OGG_CFLAGS="-I$ogg_prefix/include"
+-      OGG_LDFLAGS="-L$ogg_prefix/lib"
+-      ])
+ AC_CACHE_CHECK([for libogg], xt_cv_lib_ogg,
+ [dnl

diff --git a/net-misc/ices/ices-2.0.2-r2.ebuild 
b/net-misc/ices/ices-2.0.2-r2.ebuild
index 5e79e9e7469a..4f8c7a6de887 100644
--- a/net-misc/ices/ices-2.0.2-r2.ebuild
+++ b/net-misc/ices/ices-2.0.2-r2.ebuild
@@ -3,6 +3,8 @@
 
 EAPI=8
 
+inherit autotools
+
 DESCRIPTION="Icecast OGG streaming client, supports on the fly re-encoding"
 HOMEPAGE="https://icecast.org/ices/";
 SRC_URI="http://downloads.xiph.org/releases/${PN}/${P}.tar.bz2";
@@ -22,6 +24,17 @@ RDEPEND="
 DEPEND="${RDEPEND}"
 BDEPEND="virtual/pkgconfig"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-libogg-test.patch
+       "${FILESDIR}"/${P}-gettimeofday.patch
+)
+
+src_prepare() {
+       default
+
+       eautoreconf #740794,870973
+}
+
 src_configure() {
        econf --sysconfdir="${EPREFIX}"/etc/ices2
 }

Reply via email to