1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit eutils multilib-minimal toolchain-funcs flag-o-matic usr-ldscript
8 DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
9 HOMEPAGE="http://lse.sourceforge.net/io/aio.html"
10 SRC_URI="mirror://debian/pool/main/liba/${PN}/${PN}_${PV}.orig.tar.gz -> ${P}.tar.gz"
14 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
15 IUSE="static-libs test"
16 RESTRICT="!test? ( test )"
20 "${FILESDIR}"/${PN}-0.3.109-install.patch \
21 "${FILESDIR}"/${PN}-0.3.109-x32.patch \
22 "${FILESDIR}"/${PN}-0.3.109-testcase-8.patch \
23 "${FILESDIR}"/${PN}-0.3.110-cppflags.patch \
24 "${FILESDIR}"/${PN}-0.3.110-optional-werror.patch \
25 "${FILESDIR}"/${PN}-0.3.110-link-stdlib.patch #558406
28 -e "/^prefix=/s:/usr:${EPREFIX}/usr:"
29 -e '/^libdir=/s:lib$:$(ABI_LIBDIR):'
31 if ! use static-libs; then
32 sed_args+=( -e '/\tinstall .*\/libaio.a/d' )
33 # Tests require the static library to be built.
34 use test || sed_args+=( -e '/^all_targets +=/s/ libaio.a//' )
36 sed -i "${sed_args[@]}" src/Makefile Makefile || die
41 multilib_src_configure() {
43 # When building for thumb, we can't allow frame pointers.
44 # http://crbug.com/464517
45 if $(tc-getCPP) ${CFLAGS} ${CPPFLAGS} - <<<$'#ifndef __thumb__\n#error\n#endif' >&/dev/null ; then
46 append-flags -fomit-frame-pointer
54 RANLIB=$(tc-getRANLIB) \
55 ABI_LIBDIR=$(get_libdir) \
60 multilib_src_compile() {
65 mkdir -p testdir || die
66 # 'make check' breaks with sandbox, 'make partcheck' works
67 _emake partcheck prefix="${S}/src" libdir="${S}/src"
70 multilib_src_install() {
71 _emake install DESTDIR="${D}"
74 multilib_src_install_all() {
78 # move crap to / for multipath-tools #325355
79 gen_usr_ldscript -a aio
81 # This lib is a bare minimal shim on top of kernel syscalls.
82 export QA_DT_NEEDED=$(find "${ED}" -type f -name 'libaio.so.*' -printf '/%P\n')