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://pagure.io/${PN}/archive/${P}/${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.109-install.patch
24 "${FILESDIR}"/${PN}-0.3.110-cppflags.patch
25 "${FILESDIR}"/${PN}-0.3.111-optional-werror.patch
26 "${FILESDIR}"/${PN}-0.3.110-link-stdlib.patch #558406
33 -e "/^prefix=/s:/usr:${EPREFIX}/usr:"
34 -e '/^libdir=/s:lib$:$(ABI_LIBDIR):'
36 if ! use static-libs; then
37 sed_args+=( -e '/\tinstall .*\/libaio.a/d' )
38 # Tests require the static library to be built.
39 use test || sed_args+=( -e '/^all_targets +=/s/ libaio.a//' )
41 sed -i "${sed_args[@]}" src/Makefile Makefile || die
46 multilib_src_configure() {
48 # When building for thumb, we can't allow frame pointers.
49 # http://crbug.com/464517
50 if $(tc-getCPP) ${CFLAGS} ${CPPFLAGS} - <<<$'#ifndef __thumb__\n#error\n#endif' >&/dev/null ; then
51 append-flags -fomit-frame-pointer
59 RANLIB=$(tc-getRANLIB) \
60 ABI_LIBDIR=$(get_libdir) \
65 multilib_src_compile() {
70 mkdir -p testdir || die
71 # 'make check' breaks with sandbox, 'make partcheck' works
72 _emake partcheck prefix="${S}/src" libdir="${S}/src"
75 multilib_src_install() {
76 _emake install DESTDIR="${D}"
79 multilib_src_install_all() {
83 # move crap to / for multipath-tools #325355
84 gen_usr_ldscript -a aio
86 # This lib is a bare minimal shim on top of kernel syscalls.
87 export QA_DT_NEEDED=$(find "${ED}" -type f -name 'libaio.so.*' -printf '/%P\n')