Files
gentoo/dev-libs/libdispatch/libdispatch-5.7.1.ebuild
Georgy Yakovlev 102d9b22dc dev-libs/libdispatch: add USE=test
build system unconditionally was evaluating BUILD_TESTING as true

this leads to build failures in one of the test deps on some arches.

/usr/bin/powerpc64le-unknown-linux-gnu-ld.bfd: tests/libbsdtests.a(bsdtests.c.o): in function `test_ptr_null_format':
bsdtests.c:(.text+0x1d8): undefined reference to `vsnprintf.inline'
/usr/bin/powerpc64le-unknown-linux-gnu-ld.bfd: tests/libbsdtests.a(bsdtests.c.o): in function `test_ptr_notnull_format':
bsdtests.c:(.text+0x478): undefined reference to `vsnprintf.inline'
/usr/bin/powerpc64le-unknown-linux-gnu-ld.bfd: tests/libbsdtests.a(bsdtests.c.o): in function `test_ptr_format':
bsdtests.c:(.text+0x72c): undefined reference to `vsnprintf.inline'
/usr/bin/powerpc64le-unknown-linux-gnu-ld.bfd: tests/libbsdtests.a(bsdtests.c.o): in function `test_ptr_not_format':
bsdtests.c:(.text+0x9dc): undefined reference to `vsnprintf.inline'
/usr/bin/powerpc64le-unknown-linux-gnu-ld.bfd: tests/libbsdtests.a(bsdtests.c.o): in function `test_uint32_format':
bsdtests.c:(.text+0xc8c): undefined reference to `vsnprintf.inline'
/usr/bin/powerpc64le-unknown-linux-gnu-ld.bfd: tests/libbsdtests.a(bsdtests.c.o):bsdtests.c:(.text+0xf3c): more undefined references to `vsnprintf.inline' follow

explicitly passing -DBUILD_TESTINF=OFF allows to skip building and
linking offending test.
Library works well on ppc64le, just the test does not build with 128bit
ieee-long-double toolchain due to old headers somewhere in test deps.

The actual falure will still be visible with FEATURES="test"
but only on ppc64le systems with USE=ieee-long-double toolchain.

Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
2023-04-03 13:12:31 -07:00

58 lines
1.2 KiB
Bash

# Copyright 2022-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic cmake toolchain-funcs
MY_PN="swift-corelibs-${PN}"
MY_PV="swift-${PV}-RELEASE"
DESCRIPTION="A library for concurrent code execution on multicore hardware"
HOMEPAGE="https://github.com/apple/swift-corelibs-libdispatch"
SRC_URI="https://github.com/apple/${MY_PN}/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 ~arm64 ppc64 ~riscv x86"
IUSE="test"
RESTRICT="!test? ( test )"
DEPEND="
!gnustep-base/libobjc2
!sys-libs/blocksruntime
"
RDEPEND="${DEPEND}"
BDEPEND="
sys-devel/clang
sys-devel/llvm
virtual/pkgconfig
"
S="${WORKDIR}/${MY_PN}-${MY_PV}"
PATCHES=(
"${FILESDIR}/remove-Werror.patch"
"${FILESDIR}/libdispatch-5.3.3-musl.patch"
)
src_configure () {
if ! tc-is-clang ; then
AR=llvm-ar
CC=${CHOST}-clang
CXX=${CHOST}-clang++
NM=llvm-nm
RANLIB=llvm-ranlib
strip-unsupported-flags
fi
export HOST_CC="$(tc-getBUILD_CC)"
export HOST_CXX="$(tc-getBUILD_CXX)"
tc-export CC CXX LD AR NM OBJDUMP RANLIB PKG_CONFIG
local mycmakeargs=( -DBUILD_TESTING=$(usex test) )
cmake_src_configure
}