From d9a792586fe09e079b6765c67722950d3f1e2526 Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Mon, 21 Nov 2016 12:32:08 +0100 Subject: app-benchmarks/tiobench: 0.4.2 version bump, fix build w/ GCC-5 Gentoo-bug: 520986, 570842 * Also fix perl shebangs to be more portable Package-Manager: portage-2.3.0 Closes: https://github.com/gentoo/gentoo/pull/2878 --- app-benchmarks/tiobench/Manifest | 1 + .../files/tiobench-0.4.2-fix-perl-shebang.patch | 51 ++++++++++++++++++++++ .../tiobench/files/tiobench-0.4.2-gcc5.patch | 48 ++++++++++++++++++++ app-benchmarks/tiobench/metadata.xml | 2 +- app-benchmarks/tiobench/tiobench-0.4.2.ebuild | 45 +++++++++++++++++++ 5 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 app-benchmarks/tiobench/files/tiobench-0.4.2-fix-perl-shebang.patch create mode 100644 app-benchmarks/tiobench/files/tiobench-0.4.2-gcc5.patch create mode 100644 app-benchmarks/tiobench/tiobench-0.4.2.ebuild (limited to 'app-benchmarks') diff --git a/app-benchmarks/tiobench/Manifest b/app-benchmarks/tiobench/Manifest index 841c62577ffb..00a5f8249b63 100644 --- a/app-benchmarks/tiobench/Manifest +++ b/app-benchmarks/tiobench/Manifest @@ -1 +1,2 @@ DIST tiobench-0.3.3.tar.gz 28282 SHA256 8ad011059a35ac70cdb5e3d3999ceee44a8e8e9078926844b0685b7ea9db2bcc SHA512 e2752e32e9deaea611217629e99dc8fd738e63b4a21f49a0286f894bece3a258a3d223e0eb403ad5350dbb408738b9c5ba7300a85c8eea464266152965730328 WHIRLPOOL f6bb9b353cbbf007f6095caa5e893b3bac9af2f4cdb681be9b3f1abf6e07a5b4cd8dd0ceebfa96fd4a888fa28528a78ce00ff239c93cb96a11795168e4b2e81e +DIST tiobench-0.4.2.tar.gz 32182 SHA256 d6166edd6892725d413566ffe348d58927726fa7fa000efb384f7bcccad2e0ba SHA512 02e82d86ee889a366c1a00d4fb49f63d926e44ba6e2f297212479a5c13abe008b62c12d44483de7e971b5ebf875d5c07847f1d69dd11b2e87a050e27d8f9f09f WHIRLPOOL 8b6e5601b3079943eb1c7adf2d2fb12d05f36eaba19552c76b042b37743b0ceda5e5fd105cd64db6c0b2c111e20f9c54424113a427ad7b790a01a714c2bc1f87 diff --git a/app-benchmarks/tiobench/files/tiobench-0.4.2-fix-perl-shebang.patch b/app-benchmarks/tiobench/files/tiobench-0.4.2-fix-perl-shebang.patch new file mode 100644 index 000000000000..900472d80dd2 --- /dev/null +++ b/app-benchmarks/tiobench/files/tiobench-0.4.2-fix-perl-shebang.patch @@ -0,0 +1,51 @@ +Fix perl shebangs, in order to be maximally compatible with Gentoo Prefix. +Rationale: https://blogs.gentoo.org/mgorny/2016/02/08/a-quick-note-on-portable-shebangs/ + +--- a/scripts/makeimages.pl ++++ b/scripts/makeimages.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl -w ++#!/usr/bin/env perl + + # Author: James Manning + # This software may be used and distributed according to the terms of +@@ -8,6 +8,7 @@ + # Perl wrapper for calling tiobench.pl and displaying results + # graphically using gnuplot + ++use warnings; + use strict; + + my $args = join(" ",@ARGV); +--- a/scripts/tiosum.pl ++++ b/scripts/tiosum.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl -w ++#!/usr/bin/env perl + # Author: Randy Hron + # This software may be used and distributed according to the terms of + # the GNU General Public License, http://www.gnu.org/copyleft/gpl.html +@@ -6,6 +6,7 @@ + # Summarize output of tiobench2.pl for multiple kernels/runs. + # Assumes logfiles created with: + # ./tiobench2.pl > tiobench-`uname -r` 2> tiobench-`uname -r`.err ++use warnings; + use strict; + $|++; + +--- a/tiobench.pl ++++ b/tiobench.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl -w ++#!/usr/bin/env perl + + # Author: James Manning + # Author: Randy Hron +@@ -9,6 +9,7 @@ + # Perl wrapper for calling the tiotest executable multiple times + # with varying sets of parameters as instructed + ++use warnings; + use strict; + use Getopt::Long; + diff --git a/app-benchmarks/tiobench/files/tiobench-0.4.2-gcc5.patch b/app-benchmarks/tiobench/files/tiobench-0.4.2-gcc5.patch new file mode 100644 index 000000000000..e1bf89b87ec3 --- /dev/null +++ b/app-benchmarks/tiobench/files/tiobench-0.4.2-gcc5.patch @@ -0,0 +1,48 @@ +diff --git a/crc32.c b/crc32.c +index bae7384..a22fc5d 100644 +--- a/crc32.c ++++ b/crc32.c +@@ -72,10 +72,9 @@ static const unsigned long crctab[256] = { + 0xA2F33668, 0xBCB4666D, 0xB8757BDA, 0xB5365D03, 0xB1F740B4 + }; + +-inline +-unsigned long crc32( const void* buffer, +- unsigned long length, +- unsigned long crc) ++unsigned long crc32(const void* buffer, ++ unsigned long length, ++ unsigned long crc) + { + const unsigned char* cp = (const unsigned char*)buffer; + +diff --git a/crc32.h b/crc32.h +index 62b3433..cb9b96f 100644 +--- a/crc32.h ++++ b/crc32.h +@@ -18,9 +18,8 @@ + #ifndef CRC32_H + #define CRC32_H + +-inline +-unsigned long crc32( const void* const buffer, +- unsigned long length, +- unsigned long crc); ++unsigned long crc32(const void* const buffer, ++ unsigned long length, ++ unsigned long crc); + + #endif +diff --git a/tiotest.c b/tiotest.c +index c23ceb4..bb73fcb 100644 +--- a/tiotest.c ++++ b/tiotest.c +@@ -1392,7 +1392,7 @@ static int do_mmap_read_operation(void *loc, ThreadData *d) + + if(crc != d->bufferCrc) + { +- fprintf(stderr, "Thread(%lu) mmap consistency check failed at 0x%x\n", d->myNumber, (unsigned int)loc); ++ fprintf(stderr, "Thread(%lu) mmap consistency check failed at 0x%p\n", d->myNumber, loc); + return -1; + } + } diff --git a/app-benchmarks/tiobench/metadata.xml b/app-benchmarks/tiobench/metadata.xml index 2057275d24e0..b7cbcebb3c08 100644 --- a/app-benchmarks/tiobench/metadata.xml +++ b/app-benchmarks/tiobench/metadata.xml @@ -6,6 +6,6 @@ Alice Ferrazzi - tiobench + mkuoppal/tiobench diff --git a/app-benchmarks/tiobench/tiobench-0.4.2.ebuild b/app-benchmarks/tiobench/tiobench-0.4.2.ebuild new file mode 100644 index 000000000000..7d9805682cb8 --- /dev/null +++ b/app-benchmarks/tiobench/tiobench-0.4.2.ebuild @@ -0,0 +1,45 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=6 + +inherit toolchain-funcs + +DESCRIPTION="Portable, robust, fully-threaded I/O benchmark program" +HOMEPAGE="https://github.com/mkuoppal/tiobench" +SRC_URI="https://github.com/mkuoppal/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" +IUSE="" + +RDEPEND="dev-lang/perl" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-gcc5.patch + "${FILESDIR}"/${P}-fix-perl-shebang.patch +) + +src_prepare() { + default + sed -i \ + -e "s:/usr/local/bin:${EPREFIX}/usr/sbin:" tiobench.pl \ + || die "sed tiobench.pl failed" +} + +src_compile() { + emake \ + CC="$(tc-getCC)" \ + LINK="$(tc-getCC)" \ + DEFINES="-DLARGEFILES" \ + CFLAGS="${CFLAGS}" \ + LDFLAGS="${LDFLAGS}" +} + +src_install() { + dosbin tiotest tiobench.pl scripts/tiosum.pl + einstalldocs +} -- cgit v1.2.3-65-gdbad