dev-libs/libaio: Sync with Gentoo

It's from Gentoo commit dd197413c04eebf560ce7f20e7f53bc0890e62a8.

Signed-off-by: Flatcar Buildbot <buildbot@flatcar-linux.org>
This commit is contained in:
Flatcar Buildbot 2025-09-01 07:07:48 +00:00 committed by Krzesimir Nowak
parent eab20be066
commit d7f36006e9
5 changed files with 275 additions and 18 deletions

View File

@ -1 +1,2 @@
DIST libaio-0.3.113.tar.gz 49980 BLAKE2B 2379c88670310b36942563d10f29dfcba0f49391952ffe7fe18b0c917f33ef610405fe13297d1dbb34b7ad1d3066d4a32587a7fb20babba2f264cfc2ab289e57 SHA512 65c30a102433bf8386581b03fc706d84bd341be249fbdee11a032b237a7b239e8c27413504fef15e2797b1acd67f752526637005889590ecb380e2e120ab0b71
DIST libaio_0.3.113-8.debian.tar.xz 25244 BLAKE2B d65a0f5f7ec521754b8a4cc4da8160c24e8b7426210d72ad2cebb990ba71ee25e795916b72dfebb10578dba578b59137fc8a5e229a0f752aa6ecbeb6b0fdc88b SHA512 f17307895f9a485e60b708881b7352eaf4dfbf3a9b62583b84bf4cb18879669c5348f2af89ddde65686711833486a7632922370284e260fefd614bec8ecd0624

View File

@ -0,0 +1,48 @@
https://bugs.gentoo.org/722672#c4
--- a/src/syscall-x86_64.h
+++ b/src/syscall-x86_64.h
@@ -1,6 +1,16 @@
+#if ! defined(__ILP32__)
#define __NR_io_setup 206
#define __NR_io_destroy 207
#define __NR_io_getevents 208
#define __NR_io_submit 209
#define __NR_io_cancel 210
#define __NR_io_pgetevents 333
+#else
+#define __X32_SYSCALL_BIT 0x40000000
+#define __NR_io_setup (__X32_SYSCALL_BIT + 543)
+#define __NR_io_destroy (__X32_SYSCALL_BIT + 207)
+#define __NR_io_getevents (__X32_SYSCALL_BIT + 208)
+#define __NR_io_submit (__X32_SYSCALL_BIT + 544)
+#define __NR_io_cancel (__X32_SYSCALL_BIT + 210)
+#define __NR_io_pgetevents (__X32_SYSCALL_BIT + 333)
+#endif
--- a/src/io_pgetevents.c
+++ b/src/io_pgetevents.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <time.h>
#include <signal.h>
+#include <stdint.h>
#include "syscall.h"
#include "aio_ring.h"
@@ -33,10 +34,17 @@
struct io_event *events, struct timespec *timeout,
sigset_t *sigmask)
{
+#if (defined(__x86_64__) && ! defined(__ILP32__)) || ! defined(__x86_64__)
struct {
unsigned long ss;
unsigned long ss_len;
} data;
+#else
+ struct {
+ uint64_t ss;
+ uint64_t ss_len;
+ } data;
+#endif
if (aio_ring_is_empty(ctx, timeout))
return 0;

View File

@ -0,0 +1,92 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit multilib-minimal toolchain-funcs flag-o-matic
DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
HOMEPAGE="https://pagure.io/libaio"
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://pagure.io/libaio.git"
else
SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.gz"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
fi
LICENSE="LGPL-2"
SLOT="0"
IUSE="static-libs test"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}"/${PN}-0.3.112-cppflags.patch
"${FILESDIR}"/${PN}-0.3.113-respect-LDFLAGS.patch
"${FILESDIR}"/${PN}-0.3.113-32-bit-tests.patch
"${FILESDIR}"/${PN}-0.3.113-x32.patch
)
src_prepare() {
default
local sed_args=(
-e "/^prefix=/s:/usr:${EPREFIX}/usr:"
-e '/^libdir=/s:lib$:$(ABI_LIBDIR):'
-e 's:-Werror ::'
)
if ! use static-libs; then
sed_args+=( -e '/\tinstall .*\/libaio.a/d' )
# Tests require the static library to be built.
use test || sed_args+=( -e '/^all_targets +=/s/ libaio.a//' )
fi
sed -i "${sed_args[@]}" src/Makefile harness/Makefile Makefile || die
multilib_copy_sources
}
multilib_src_configure() {
# Upstream aren't interested in fixing: bug #855698
filter-lto
if use arm ; then
# When building for thumb, we can't allow frame pointers.
# http://crbug.com/464517
if $(tc-getCPP) ${CFLAGS} ${CPPFLAGS} - <<<$'#ifndef __thumb__\n#error\n#endif' >&/dev/null ; then
append-flags -fomit-frame-pointer
fi
fi
}
_emake() {
CC="$(tc-getCC)" \
AR="$(tc-getAR)" \
RANLIB="$(tc-getRANLIB)" \
ABI_LIBDIR="$(get_libdir)" \
CFLAGS_WERROR= \
emake "$@"
}
multilib_src_compile() {
_emake
}
multilib_src_test() {
mkdir -p testdir || die
# 'make check' breaks with sandbox, 'make partcheck' works
_emake partcheck prefix="${S}/src" libdir="${S}/src"
}
multilib_src_install() {
_emake install DESTDIR="${D}"
}
multilib_src_install_all() {
doman man/*
dodoc ChangeLog TODO
# This lib is a bare minimal shim on top of kernel syscalls.
export QA_DT_NEEDED=$(find "${ED}" -type f -name 'libaio.so.*' -printf '/%P\n')
}

View File

@ -0,0 +1,103 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit multilib-minimal toolchain-funcs flag-o-matic
DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
HOMEPAGE="https://pagure.io/libaio"
if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://pagure.io/libaio.git"
else
SRC_URI="https://releases.pagure.org/${PN}/${P%_p*}.tar.gz"
# Take Debian's patchset as upstream is dead and there's a lot of valuable
# portability fixes in there.
if [[ ${PV} == *_p* ]] ; then
SRC_URI+=" mirror://debian/pool/main/liba/${PN}/${PN}_${PV/_p/-}.debian.tar.xz"
fi
S="${WORKDIR}"/${P%_p*}
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
fi
LICENSE="LGPL-2"
SLOT="0"
IUSE="static-libs test"
RESTRICT="!test? ( test )"
src_prepare() {
if [[ ${PV} == *_p* ]] ; then
local i
# Exclude patches from Debian which add time64 APIs which
# aren't yet merged upstream.
for i in $(sed \
-e '/^#/d' \
-e '/gitignore/d' \
-e '/SONAME/d' \
-e '/time64/d' \
-e '/Fix-io_pgetevents-syscall-wrapper/d' "${WORKDIR}"/debian/patches/series) ; do
PATCHES+=( "${WORKDIR}"/debian/patches/${i} )
done
fi
default
local sed_args=(
-e 's:-Werror ::'
)
if ! use static-libs; then
sed_args+=( -e '/\tinstall .*\/libaio.a/d' )
# Tests require the static library to be built.
use test || sed_args+=( -e '/^all_targets +=/s/ libaio.a//' )
fi
sed -i "${sed_args[@]}" src/Makefile harness/Makefile Makefile || die
multilib_copy_sources
}
multilib_src_configure() {
if use arm ; then
# When building for thumb, we can't allow frame pointers.
# http://crbug.com/464517
if $(tc-getCPP) ${CFLAGS} ${CPPFLAGS} - <<<$'#ifndef __thumb__\n#error\n#endif' >&/dev/null ; then
append-flags -fomit-frame-pointer
fi
fi
}
_emake() {
emake \
CC="$(tc-getCC)" \
AR="$(tc-getAR)" \
RANLIB="$(tc-getRANLIB)" \
CFLAGS_WERROR= \
prefix="${EPREFIX}/usr" \
libdir="${EPREFIX}/usr/$(get_libdir)" \
"$@"
}
multilib_src_compile() {
_emake
}
multilib_src_test() {
mkdir -p testdir || die
# 'make check' breaks with sandbox, 'make partcheck' works
_emake partcheck prefix="${S}/src" libdir="${S}/src"
}
multilib_src_install() {
_emake install DESTDIR="${D}"
}
multilib_src_install_all() {
doman man/*
dodoc ChangeLog TODO
# This lib is a bare minimal shim on top of kernel syscalls.
export QA_DT_NEEDED=$(find "${ED}" -type f -name 'libaio.so.*' -printf '/%P\n')
}

View File

@ -1,4 +1,4 @@
# Copyright 1999-2024 Gentoo Authors
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@ -12,7 +12,14 @@ if [[ ${PV} == 9999 ]] ; then
inherit git-r3
EGIT_REPO_URI="https://pagure.io/libaio.git"
else
SRC_URI="https://releases.pagure.org/${PN}/${P}.tar.gz"
SRC_URI="https://releases.pagure.org/${PN}/${P%_p*}.tar.gz"
# Take Debian's patchset as upstream is dead and there's a lot of valuable
# portability fixes in there.
if [[ ${PV} == *_p* ]] ; then
SRC_URI+=" mirror://debian/pool/main/liba/${PN}/${PN}_${PV/_p/-}.debian.tar.xz"
fi
S="${WORKDIR}"/${P%_p*}
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
fi
@ -21,17 +28,24 @@ SLOT="0"
IUSE="static-libs test"
RESTRICT="!test? ( test )"
PATCHES=(
"${FILESDIR}"/${PN}-0.3.112-cppflags.patch
"${FILESDIR}"/${PN}-0.3.113-respect-LDFLAGS.patch
)
src_prepare() {
if [[ ${PV} == *_p* ]] ; then
local i
# Exclude patches from Debian which add time64 APIs which
# aren't yet merged upstream.
for i in $(sed \
-e '/^#/d' \
-e '/gitignore/d' \
-e '/SONAME/d' \
-e '/time64/d' \
-e '/Fix-io_pgetevents-syscall-wrapper/d' "${WORKDIR}"/debian/patches/series) ; do
PATCHES+=( "${WORKDIR}"/debian/patches/${i} )
done
fi
default
local sed_args=(
-e "/^prefix=/s:/usr:${EPREFIX}/usr:"
-e '/^libdir=/s:lib$:$(ABI_LIBDIR):'
-e 's:-Werror ::'
)
if ! use static-libs; then
@ -45,9 +59,6 @@ src_prepare() {
}
multilib_src_configure() {
# Upstream aren't interested in fixing: bug #855698
filter-lto
if use arm ; then
# When building for thumb, we can't allow frame pointers.
# http://crbug.com/464517
@ -58,12 +69,14 @@ multilib_src_configure() {
}
_emake() {
emake \
CC="$(tc-getCC)" \
AR="$(tc-getAR)" \
RANLIB="$(tc-getRANLIB)" \
ABI_LIBDIR="$(get_libdir)" \
CFLAGS_WERROR= \
emake "$@"
prefix="${EPREFIX}/usr" \
libdir="${EPREFIX}/usr/$(get_libdir)" \
"$@"
}
multilib_src_compile() {