commit:     3ac67989573aeea738011373bcac8d835e6f163f
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Sat Oct 19 05:53:25 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 20 19:33:42 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ac67989

app-benchmarks/iozone: add 3.506

Closes: https://bugs.gentoo.org/894334
Closes: https://bugs.gentoo.org/871093
Closes: https://bugs.gentoo.org/729118
Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/39038
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 app-benchmarks/iozone/Manifest                     |  1 +
 .../iozone-3.506-include-function-parameters.patch | 23 +++++++
 app-benchmarks/iozone/iozone-3.506.ebuild          | 73 ++++++++++++++++++++++
 3 files changed, 97 insertions(+)

diff --git a/app-benchmarks/iozone/Manifest b/app-benchmarks/iozone/Manifest
index 6a9a704272d8..4ebe117a2d37 100644
--- a/app-benchmarks/iozone/Manifest
+++ b/app-benchmarks/iozone/Manifest
@@ -1 +1,2 @@
 DIST iozone3_488.tar 1873920 BLAKE2B 
60e97d588a273c1af7a8c83ec207593fcf43766f92171774b974aa04a8df690a1a84aae4b448e4a6f9e4e9c7dc3cd98ad327a0ea196779e6dbe3a88326314eaf
 SHA512 
033f9e6e7395fe84ae6f4ae8737544e399ac0f16e82ba95eed2a2d0df52b7efcbe0c9282abc68d3c5b53d859073c74bff2e8c34bc35e1e1cc887ed36ad5d840b
+DIST iozone3_506.tar 1894400 BLAKE2B 
7434b691114aa5fabe10d659d47abe60b7efd76b75dff1c6cd0fc9205807f48cb3452022dc300b454acfbcf07df26f972ffa5ff62b51fa858eecb0340fb26402
 SHA512 
908919aef957ee587e23ab1d29c0e7cdb985caa1ec80ddee0d3fcdad8aa78978de0f8fc83161b37223237119c50e0626a8366ce6b29debefbfee00240e97105e

diff --git 
a/app-benchmarks/iozone/files/iozone-3.506-include-function-parameters.patch 
b/app-benchmarks/iozone/files/iozone-3.506-include-function-parameters.patch
new file mode 100644
index 000000000000..6b1421f4bb5e
--- /dev/null
+++ b/app-benchmarks/iozone/files/iozone-3.506-include-function-parameters.patch
@@ -0,0 +1,23 @@
+Clang won't allow an incorrect redeclaration.
+
+iozone.c:1272:9: error: redeclaration of 'pread64' must have the 
'overloadable' attribute
+ 1272 | ssize_t pread64(); 
+      |         ^
+/usr/include/bits/unistd.h:66:1: note: previous overload of function is here
+   66 | pread64 (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf),
+      | ^
+
+--- a/src/current/iozone.c        2023-05-01 06:29:49.000000000 +0300
++++ b/src/current/iozone.c   2024-10-19 08:44:44.697717249 +0300
+@@ -1268,8 +1268,8 @@
+ 
+ #ifdef HAVE_ANSIC_C
+ #if defined (HAVE_PREAD) && defined(_LARGEFILE64_SOURCE)
+-ssize_t pwrite64(); 
+-ssize_t pread64(); 
++ssize_t pwrite64(int fd, const void *buf, size_t count, off_t offset); 
++ssize_t pread64(int fd, void *buf, size_t count, off_t offset); 
+ #endif
+ #if !defined(linux)
+ char *getenv();
+

diff --git a/app-benchmarks/iozone/iozone-3.506.ebuild 
b/app-benchmarks/iozone/iozone-3.506.ebuild
new file mode 100644
index 000000000000..3a3b81775264
--- /dev/null
+++ b/app-benchmarks/iozone/iozone-3.506.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Filesystem benchmarking program"
+HOMEPAGE="http://www.iozone.org/";
+SRC_URI="http://www.iozone.org/src/current/${PN}${PV/./_}.tar";
+S="${WORKDIR}/${PN}${PV/./_}"
+
+LICENSE="freedist"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~riscv ~sparc ~x86"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.506-include-function-parameters.patch
+)
+
+src_prepare() {
+       default
+
+       # Options FIX
+       sed -e '/CC     =.*/d' \
+               -e 's:-O[23]:$(CFLAGS):g' \
+               -e 's:-Dlinux:$(LDFLAGS) -Dlinux:g' \
+               -i src/current/makefile || die
+}
+
+src_configure() {
+       tc-export CC
+
+       case ${ARCH} in
+               x86|alpha|riscv)  PLATFORM="linux";;
+               arm)              PLATFORM="linux-arm";;
+               ppc)              PLATFORM="linux-powerpc";;
+               ppc64)            PLATFORM="linux-powerpc64";;
+               amd64)            PLATFORM="linux-AMD64";;
+               ia64)             PLATFORM="linux-ia64";;
+               s390)             PLATFORM="linux-S390";;
+               *)                PLATFORM="linux-${ARCH}";;
+       esac
+
+       # makefile uses $(GCC) in a few places, probably
+       # by mistake.
+       export GCC="$(tc-getCC)"
+
+       # Otherwise it uses K&R function declaration where ints are sometimes 
omited
+       # https://bugs.gentoo.org/894334
+       append-cppflags -DHAVE_ANSIC_C
+}
+
+src_compile() {
+       emake -C src/current ${PLATFORM}
+}
+
+src_test() {
+       cd "${T}" || die
+       "${S}"/src/current/iozone testfile || die "self test failed"
+}
+
+src_install() {
+       dosbin src/current/{iozone,fileop}
+
+       # decompress pre-compressed file to make QA check happy
+       gunzip docs/Iozone_ps.gz || die
+
+       dodoc docs/I* docs/Run_rules.doc src/current/Changes.txt
+       doman docs/iozone.1
+       cd src/current || die
+       dodoc Generate_Graphs Gnuplot.txt gengnuplot.sh gnu3d.dem
+}

Reply via email to