1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit multilib-minimal toolchain-funcs flag-o-matic usr-ldscript
8 DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
9 HOMEPAGE="https://pagure.io/libaio"
10 if [[ "${PV}" == 9999 ]] ; then
12 EGIT_REPO_URI="https://pagure.io/libaio.git"
14 SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.gz"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
19 IUSE="static-libs test"
20 RESTRICT="!test? ( test )"
23 "${FILESDIR}"/${PN}-0.3.112-cppflags.patch
24 "${FILESDIR}"/${PN}-0.3.111-optional-werror.patch
31 -e "/^prefix=/s:/usr:${EPREFIX}/usr:"
32 -e '/^libdir=/s:lib$:$(ABI_LIBDIR):'
34 if ! use static-libs; then
35 sed_args+=( -e '/\tinstall .*\/libaio.a/d' )
36 # Tests require the static library to be built.
37 use test || sed_args+=( -e '/^all_targets +=/s/ libaio.a//' )
39 sed -i "${sed_args[@]}" src/Makefile Makefile || die
44 multilib_src_configure() {
46 # When building for thumb, we can't allow frame pointers.
47 # http://crbug.com/464517
48 if $(tc-getCPP) ${CFLAGS} ${CPPFLAGS} - <<<$'#ifndef __thumb__\n#error\n#endif' >&/dev/null ; then
49 append-flags -fomit-frame-pointer
57 RANLIB=$(tc-getRANLIB) \
58 ABI_LIBDIR=$(get_libdir) \
63 multilib_src_compile() {
68 mkdir -p testdir || die
69 # 'make check' breaks with sandbox, 'make partcheck' works
70 _emake partcheck prefix="${S}/src" libdir="${S}/src"
73 multilib_src_install() {
74 _emake install DESTDIR="${D}"
77 multilib_src_install_all() {
81 # move crap to / for multipath-tools #325355
82 gen_usr_ldscript -a aio
84 # This lib is a bare minimal shim on top of kernel syscalls.
85 export QA_DT_NEEDED=$(find "${ED}" -type f -name 'libaio.so.*' -printf '/%P\n')