libaio: upgraded package to upstream

Upgraded dev-libs/libaio to version 0.3.112 for newer EAPI.

BUG=b:187789240
TEST=CQ passes

Change-Id: I4565a86ae73406f8800a6dc4c35f3c0b642f690b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/3183043
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Sarthak Kukreti <sarthakkukreti@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Sarthak Kukreti <sarthakkukreti@chromium.org>
diff --git a/dev-libs/libaio/Manifest b/dev-libs/libaio/Manifest
index e55d7cf..e956615 100644
--- a/dev-libs/libaio/Manifest
+++ b/dev-libs/libaio/Manifest
@@ -1 +1 @@
-DIST libaio-0.3.110.tar.gz 42270 SHA256 e019028e631725729376250e32b473012f7cb68e1f7275bfc1bbcdd0f8745f7e SHA512 664295d330d6e9adc005e2331e77582619625b479ffc2b81728ba6a682487380ee936079c4a69d35144b458bbe35c612f4ed9b32e913bd7e109b824345763eb3 WHIRLPOOL 21666b6d14e8091a52941b54b1c6d882dd495ed2d5ca9047a7951ee44e90aa33348ade0d3e4e7f12076a264b64b354a06cd96433cb39e18fc87b3655b59767af
+DIST libaio-0.3.112.tar.gz 46977 BLAKE2B 088f3b195a65bdc97ae2318e47af17c65259ed3208dca7bfef93c81a800602085e5b2078dbd436c740be316d0ebd923a1b3b7c0808257e2e7c7fb0f7ae1e0dba SHA512 5f984529c9f747a6c82f1e4457fc0832bb1fc299ae6e700f2ac5a8ea7b9bfc6ea1e75809728cc115a020cff6685ed1f4e38c6aeacc1ea98dfccce04dd19dafaa
diff --git a/dev-libs/libaio/files/libaio-0.3.109-install.patch b/dev-libs/libaio/files/libaio-0.3.109-install.patch
deleted file mode 100644
index 9c049fc..0000000
--- a/dev-libs/libaio/files/libaio-0.3.109-install.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 2e34caef82a2367a85de4f06daf5e5a92f61e845 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sun, 17 Jan 2010 17:10:14 -0500
-Subject: [PATCH] fix up install paths
-
-This is similar to the Fedora patch, but this uses more common conventions
-like "DESTDIR" instead of "destdir".
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- src/Makefile |   11 ++++++-----
- 1 files changed, 6 insertions(+), 5 deletions(-)
-
-diff --git a/src/Makefile b/src/Makefile
-index 687c7be..ee431a1 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -1,6 +1,7 @@
- prefix=/usr
- includedir=$(prefix)/include
- libdir=$(prefix)/lib
-+usrlibdir=$(libdir)
- 
- CFLAGS ?= -g -fomit-frame-pointer -O2
- CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
-@@ -53,11 +54,11 @@ $(libname): $(libaio_sobjs) libaio.map
- 	$(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname,$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
- 
- install: $(all_targets)
--	install -D -m 644 libaio.h $(includedir)/libaio.h
--	install -D -m 644 libaio.a $(libdir)/libaio.a
--	install -D -m 755 $(libname) $(libdir)/$(libname)
--	ln -sf $(libname) $(libdir)/$(soname)
--	ln -sf $(libname) $(libdir)/libaio.so
-+	install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
-+	install -D -m 644 libaio.a $(DESTDIR)$(usrlibdir)/libaio.a
-+	install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname)
-+	ln -sf $(libname) $(DESTDIR)$(usrlibdir)/$(soname)
-+	ln -sf $(libname) $(DESTDIR)$(usrlibdir)/libaio.so
- 
- $(libaio_objs): libaio.h
- 
--- 
-1.7.3.1
-
diff --git a/dev-libs/libaio/files/libaio-0.3.109-testcase-8.patch b/dev-libs/libaio/files/libaio-0.3.109-testcase-8.patch
deleted file mode 100644
index de66f21..0000000
--- a/dev-libs/libaio/files/libaio-0.3.109-testcase-8.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-Do not ignore return value of ftruncate(): testcases are compiled with -Werror,
-and ftruncate is declared with attribute warn_unused_result.
---- harness/cases/8.t.orig	2012-03-09 16:40:04.074168070 +0100
-+++ harness/cases/8.t	2012-03-09 16:40:57.777278646 +0100
-@@ -9,12 +9,13 @@
- {
- 	long long min = 0, max = 9223372036854775807LL;
- 	char c = 0;
-+	int ret;
- 
- 	while (max - min > 1) {
- 		if (pwrite64(fd, &c, 1, (min + max) / 2) == -1)
- 			max = (min + max) / 2;
- 		else {
--			ftruncate(fd, 0);
-+			ret = ftruncate(fd, 0);		assert(ret == 0);
- 			min = (min + max) / 2;
- 		}
- 	}
diff --git a/dev-libs/libaio/files/libaio-0.3.109-x32.patch b/dev-libs/libaio/files/libaio-0.3.109-x32.patch
deleted file mode 100644
index 1d2c2a9..0000000
--- a/dev-libs/libaio/files/libaio-0.3.109-x32.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=f5c071d93c9e6f57930bce56b1e4f009c160a826
-
-Upstream-Status: Pending
-
-Properly load arguments 5 an 6 for x86-64 syscall
-Use asm ("r10") and asm ("r8") to load arguments 5 an 6 for x86-64
-syscall so that it works with both x32 and x86-64.
-
-Received this patch from H.J. Lu <hjl.tools@gmail.com>
-
-Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>
-2011/12/02
-
---- libaio-0.3.109/src/syscall-x86_64.h.x32	2009-10-09 11:17:02.000000000 -0700
-+++ libaio-0.3.109/src/syscall-x86_64.h	2011-12-02 09:09:07.537603224 -0800
-@@ -1,8 +1,18 @@
-+#ifndef __NR_io_setup
- #define __NR_io_setup		206
-+#endif
-+#ifndef __NR_io_destroy
- #define __NR_io_destroy		207
-+#endif
-+#ifndef __NR_io_getevents
- #define __NR_io_getevents	208
-+#endif
-+#ifndef __NR_io_submit
- #define __NR_io_submit		209
-+#endif
-+#ifndef __NR_io_cancel
- #define __NR_io_cancel		210
-+#endif
- 
- #define __syscall_clobber "r11","rcx","memory" 
- #define __syscall "syscall"
-@@ -42,10 +52,11 @@ return __res;								\
- type fname (type1 arg1, type2 arg2, type3 arg3, type4 arg4)		\
- {									\
- long __res;								\
--__asm__ volatile ("movq %5,%%r10 ;" __syscall				\
-+register long __a4 asm ("r10") = (long) arg4;				\
-+__asm__ volatile (__syscall						\
- 	: "=a" (__res)							\
- 	: "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)),	\
--	  "d" ((long)(arg3)),"g" ((long)(arg4)) : __syscall_clobber,"r10" ); \
-+	  "d" ((long)(arg3)),"r" (__a4)); \
- return __res;								\
- } 
- 
-@@ -54,10 +65,11 @@ return __res;								\
- type fname (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5)	\
- {									\
- long __res;								\
--__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; " __syscall		\
-+register long __a4 asm ("r10") = (long) arg4;				\
-+register long __a5 asm ("r8") = (long) arg5;				\
-+__asm__ volatile ( __syscall						\
- 	: "=a" (__res)							\
- 	: "0" (__NR_##sname),"D" ((long)(arg1)),"S" ((long)(arg2)),	\
--	  "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5)) :	\
--	__syscall_clobber,"r8","r10" );					\
-+	  "d" ((long)(arg3)),"r" (__a4),"r" (__a5));			\
- return __res;								\
- }
diff --git a/dev-libs/libaio/files/libaio-0.3.110-cppflags.patch b/dev-libs/libaio/files/libaio-0.3.110-cppflags.patch
deleted file mode 100644
index 4567ac9..0000000
--- a/dev-libs/libaio/files/libaio-0.3.110-cppflags.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 3bf96bb62370035dba18d4b25459406b32365cfc Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 26 Mar 2014 23:10:18 -0400
-Subject: [PATCH] respect env CPPFLAGS
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- src/Makefile | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/Makefile b/src/Makefile
-index 49f448f..b918c8b 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -5,6 +5,7 @@ usrlibdir=$(libdir)
- 
- CFLAGS ?= -g -fomit-frame-pointer -O2
- CFLAGS += -nostdlib -nostartfiles -Wall -I. -fPIC
-+CFLAGS += $(CPPFLAGS)
- SO_CFLAGS=-shared $(CFLAGS)
- L_CFLAGS=$(CFLAGS)
- LINK_FLAGS=
--- 
-1.9.1
-
diff --git a/dev-libs/libaio/files/libaio-0.3.110-optional-werror.patch b/dev-libs/libaio/files/libaio-0.3.111-optional-werror.patch
similarity index 66%
rename from dev-libs/libaio/files/libaio-0.3.110-optional-werror.patch
rename to dev-libs/libaio/files/libaio-0.3.111-optional-werror.patch
index 2933cf5..5b6f91e 100644
--- a/dev-libs/libaio/files/libaio-0.3.110-optional-werror.patch
+++ b/dev-libs/libaio/files/libaio-0.3.111-optional-werror.patch
@@ -1,6 +1,6 @@
-From 0cc7dc108d0b2288b40d82bb2fd1fd8bdc08f764 Mon Sep 17 00:00:00 2001
+From ebe62b178f3e5fcde8a311e64aaffe62099204a5 Mon Sep 17 00:00:00 2001
 From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 26 Mar 2014 23:07:58 -0400
+Date: Sun, 21 Apr 2019 12:44:26 +0200
 Subject: [PATCH] make -Werror into an optional flag
 
 This lets distros disable the flag as random errors might come up with
@@ -12,19 +12,19 @@
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/harness/Makefile b/harness/Makefile
-index 2a88e71..cf8c90d 100644
+index f477737..a155c4b 100644
 --- a/harness/Makefile
 +++ b/harness/Makefile
 @@ -6,7 +6,8 @@ PROGS:=$(PARTPROGS) $(EXTRAPROGS)
  HARNESS_SRCS:=main.c
  # io_queue.c
  
--CFLAGS+=-Wall -Werror -I../src -g -O
+-CFLAGS+=-Wall -Werror -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE)
 +CFLAGS_WERROR?=-Werror
-+CFLAGS+=-Wall $(CFLAGS_WERROR) -I../src -g -O
++CFLAGS+=-Wall $(CFLAGS_WERROR) -I../src -g -O2 -DPAGE_SIZE=$(shell getconf PAGESIZE)
  #-lpthread -lrt
  
  all: $(PROGS)
 -- 
-1.9.1
+2.21.0
 
diff --git a/dev-libs/libaio/files/libaio-0.3.112-cppflags.patch b/dev-libs/libaio/files/libaio-0.3.112-cppflags.patch
new file mode 100644
index 0000000..dddb9c2
--- /dev/null
+++ b/dev-libs/libaio/files/libaio-0.3.112-cppflags.patch
@@ -0,0 +1,16 @@
+respect env CPPFLAGS
+
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -2,8 +2,9 @@ prefix=/usr
+ includedir=$(prefix)/include
+ libdir=$(prefix)/lib
+ 
+-CFLAGS ?= -g -fomit-frame-pointer -O2
+-CFLAGS += -Wall -I. -fPIC
++CFLAGS ?= -fomit-frame-pointer -O2
++CFLAGS += -I. -fPIC
++CFLAGS += $(CPPFLAGS)
+ SO_CFLAGS=-shared $(CFLAGS)
+ L_CFLAGS=$(CFLAGS)
+ LINK_FLAGS=
diff --git a/dev-libs/libaio/libaio-0.3.110.ebuild b/dev-libs/libaio/libaio-0.3.112.ebuild
similarity index 70%
rename from dev-libs/libaio/libaio-0.3.110.ebuild
rename to dev-libs/libaio/libaio-0.3.112.ebuild
index d7282d9..936bd62 100644
--- a/dev-libs/libaio/libaio-0.3.110.ebuild
+++ b/dev-libs/libaio/libaio-0.3.112.ebuild
@@ -1,27 +1,31 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/libaio/libaio-0.3.110.ebuild,v 1.8 2015/03/09 19:22:19 vapier Exp $
 
-EAPI=5
+EAPI="7"
 
-inherit eutils multilib-minimal toolchain-funcs flag-o-matic
+inherit multilib-minimal toolchain-funcs flag-o-matic usr-ldscript
 
 DESCRIPTION="Asynchronous input/output library that uses the kernels native interface"
-HOMEPAGE="https://git.fedorahosted.org/cgit/libaio.git/  http://lse.sourceforge.net/io/aio.html"
-SRC_URI="https://fedorahosted.org/releases/${PN:0:1}/${PN:1:1}/${PN}/${P}.tar.gz"
-
+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="*"
+fi
 LICENSE="LGPL-2"
 SLOT="0"
-KEYWORDS="*"
 IUSE="static-libs test"
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.3.112-cppflags.patch
+	"${FILESDIR}"/${PN}-0.3.111-optional-werror.patch
+)
 
 src_prepare() {
-	epatch \
-		"${FILESDIR}"/${PN}-0.3.109-install.patch \
-		"${FILESDIR}"/${PN}-0.3.109-x32.patch \
-		"${FILESDIR}"/${PN}-0.3.109-testcase-8.patch \
-		"${FILESDIR}"/${PN}-0.3.110-cppflags.patch \
-		"${FILESDIR}"/${PN}-0.3.110-optional-werror.patch
+	default
 
 	local sed_args=(
 		-e "/^prefix=/s:/usr:${EPREFIX}/usr:"
diff --git a/dev-libs/libaio/metadata.xml b/dev-libs/libaio/metadata.xml
index a5a7a60..8035a40 100644
--- a/dev-libs/libaio/metadata.xml
+++ b/dev-libs/libaio/metadata.xml
@@ -1,9 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
-<maintainer>
-  <email>maintainer-needed@gentoo.org</email>
-</maintainer>
-<longdescription>Library to provide user-level kernel Asynchronous I/O (AIO)
- support for Linux (needs kernel patches as of 2.6.12)</longdescription>
+	<maintainer type="project">
+		<email>base-system@gentoo.org</email>
+		<name>Gentoo Base System</name>
+	</maintainer>
+	<longdescription>
+		Library to provide user-level kernel Asynchronous I/O (AIO)
+		support for Linux (needs kernel patches as of 2.6.12)
+	</longdescription>
 </pkgmetadata>