summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakov Smolic <jakov.smolic@sartura.hr>2021-02-11 20:53:21 +0100
committerBen Kohler <bkohler@gentoo.org>2021-02-12 07:44:32 -0600
commit58e4239da7523f1889ad080a5d484d133faba8dc (patch)
tree2c8a4d55663467b97a96429845a81baad502b8d4 /app-crypt/dieharder
parentdev-util/android-tools: tweak for gcc-11 (diff)
downloadgentoo-58e4239da7523f1889ad080a5d484d133faba8dc.tar.gz
gentoo-58e4239da7523f1889ad080a5d484d133faba8dc.tar.bz2
gentoo-58e4239da7523f1889ad080a5d484d133faba8dc.zip
app-crypt/dieharder: Apply gcc-10 workaround and cross-compile patch
Closes: https://bugs.gentoo.org/708538 Closes: https://github.com/gentoo/gentoo/pull/12544 Co-authored-by: Tom Hughes <tomhughes@chromium.org> Signed-off-by: Tom Hughes <tomhughes@chromium.org> Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr> Signed-off-by: Ben Kohler <bkohler@gentoo.org>
Diffstat (limited to 'app-crypt/dieharder')
-rw-r--r--app-crypt/dieharder/dieharder-3.31.1-r3.ebuild51
-rw-r--r--app-crypt/dieharder/files/dieharder-3.31.1-build.patch8
-rw-r--r--app-crypt/dieharder/files/dieharder-3.31.1-cross-compile.patch57
-rw-r--r--app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch15
4 files changed, 86 insertions, 45 deletions
diff --git a/app-crypt/dieharder/dieharder-3.31.1-r3.ebuild b/app-crypt/dieharder/dieharder-3.31.1-r3.ebuild
index 269cb352cf1f..fe4f37aa10e3 100644
--- a/app-crypt/dieharder/dieharder-3.31.1-r3.ebuild
+++ b/app-crypt/dieharder/dieharder-3.31.1-r3.ebuild
@@ -1,11 +1,13 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
+inherit autotools flag-o-matic
+
DESCRIPTION="An advanced suite for testing the randomness of RNG's"
-HOMEPAGE="http://www.phy.duke.edu/~rgb/General/dieharder.php"
-SRC_URI="http://www.phy.duke.edu/~rgb/General/${PN}/${P}.tgz"
+HOMEPAGE="https://www.phy.duke.edu/~rgb/General/dieharder.php"
+SRC_URI="https://www.phy.duke.edu/~rgb/General/${PN}/${P}.tgz"
LICENSE="GPL-2"
SLOT="0"
@@ -14,30 +16,22 @@ IUSE="doc"
RESTRICT="test" # Way too long
RDEPEND="sci-libs/gsl"
-DEPEND="${RDEPEND}
- doc? ( dev-tex/latex2html )"
-
-DOCS=(
- NOTES
-)
-HTML_DOCS=()
+DEPEND="${RDEPEND}"
+BDEPEND=" doc? ( dev-tex/latex2html )"
PATCHES=(
- "${FILESDIR}/${P}-build.patch"
- "${FILESDIR}/${P}-urandom-64bit.patch"
+ "${FILESDIR}"/${P}-build.patch
+ "${FILESDIR}"/${P}-urandom-64bit.patch
+ "${FILESDIR}"/${P}-cross-compile.patch
)
-pkg_setup() {
- use doc && DOCS+=(
- ChangeLog
- manual/dieharder.pdf manual/dieharder.ps
- )
- use doc && HTML_DOCS+=(
- dieharder.html
- )
+src_prepare() {
+ default
+ eautoreconf
}
src_configure() {
+ append-flags -fcommon
econf --disable-static
}
@@ -46,17 +40,18 @@ src_compile() {
use doc && emake -C manual
}
-src_test() {
- "${S}/dieharder/dieharder" -g 501 -a
-}
-
src_install() {
+ if use doc; then
+ DOCS=( ChangeLog manual/dieharder.pdf manual/dieharder.ps)
+ HTML_DOCS=( dieharder.html )
+ fi
+
default
- docinto "dieharder"
- dodoc dieharder/README dieharder/NOTES
- docinto "libdieharder"
- dodoc libdieharder/README libdieharder/NOTES
+ docinto dieharder
+ dodoc dieharder/{NOTES,README}
+ docinto libdieharder
+ dodoc libdieharder/{NOTES,README}
find "${ED}" -name '*.la' -delete || die
}
diff --git a/app-crypt/dieharder/files/dieharder-3.31.1-build.patch b/app-crypt/dieharder/files/dieharder-3.31.1-build.patch
index 50e2119030c9..07d33171a4cb 100644
--- a/app-crypt/dieharder/files/dieharder-3.31.1-build.patch
+++ b/app-crypt/dieharder/files/dieharder-3.31.1-build.patch
@@ -1,5 +1,3 @@
-diff --git a/include/dieharder/libdieharder.h b/include/dieharder/libdieharder.h
-index 2138ebf..f6d471b 100644
--- a/include/dieharder/libdieharder.h
+++ b/include/dieharder/libdieharder.h
@@ -6,6 +6,8 @@
@@ -34,8 +32,6 @@ Subject: [PATCH 1/2] rgb_operm: convert to noop as implementation missing
include/dieharder/rgb_operm.h | 2 ++
1 file changed, 2 insertions(+)
-diff --git a/include/dieharder/rgb_operm.h b/include/dieharder/rgb_operm.h
-index c48fa37..f33fc1f 100644
--- a/include/dieharder/rgb_operm.h
+++ b/include/dieharder/rgb_operm.h
@@ -1,3 +1,4 @@
@@ -62,8 +58,6 @@ Subject: [PATCH 2/2] dab_filltree2: inline cannot have prototype nor can it be
libdieharder/dab_filltree2.c | 48 +++++++++++++++++-------------------
2 files changed, 41 insertions(+), 44 deletions(-)
-diff --git a/libdieharder/dab_filltree.c b/libdieharder/dab_filltree.c
-index 9cc5ce7..3ed6b00 100644
--- a/libdieharder/dab_filltree.c
+++ b/libdieharder/dab_filltree.c
@@ -34,7 +34,24 @@ static double targetData[] = {
@@ -117,8 +111,6 @@ index 9cc5ce7..3ed6b00 100644
#include<time.h>
int main_filltree(int argc, char **argv) {
-diff --git a/libdieharder/dab_filltree2.c b/libdieharder/dab_filltree2.c
-index 1e33af2..7102d3c 100644
--- a/libdieharder/dab_filltree2.c
+++ b/libdieharder/dab_filltree2.c
@@ -92,7 +92,29 @@ static double targetData[128] = { // size=128, generated from 6e9 samples
diff --git a/app-crypt/dieharder/files/dieharder-3.31.1-cross-compile.patch b/app-crypt/dieharder/files/dieharder-3.31.1-cross-compile.patch
new file mode 100644
index 000000000000..18bbf659fc04
--- /dev/null
+++ b/app-crypt/dieharder/files/dieharder-3.31.1-cross-compile.patch
@@ -0,0 +1,57 @@
+From: Tom Hughes <tomhughes@chromium.org>
+Fix cross-compilation by removing gsl header/library check (these are enforced
+through ebuild DEPENDS) and using AC_C_BIGENDIAN instead of the non-standard
+AC_C_ENDIAN macro which tries to execute code.
+--- a/configure.ac
++++ b/configure.ac
+@@ -108,48 +108,7 @@
+ AC_SUBST(DIEHARDER_LIBS)
+ AC_SUBST(ACLOCAL_AMFLAGS)
+
+-#==================================================================
+-# Checks for libraries, and headers. Test for dependency libraries
+-# FIRST in reverse order that you need -lwhatever to appear on
+-# compile line as it accumulates libraries to build e.g.
+-# -lgsl -lgslcblas
+-# for the SECOND test, required (in that order) to succeed.
+-#==================================================================
+-AC_CHECK_HEADER([gsl/gsl_sf_gamma.h],,[AC_MSG_ERROR([Couldn't find GSL headers. Please install the gsl-devel package.])])
+-AC_CHECK_LIB([gslcblas], [main],,[AC_MSG_ERROR([Couldn't find libgsl. Please install the gsl package.])])
+-AC_CHECK_LIB([gsl],[gsl_sf_gamma])
+-
+-
+-#==================================================================
+-# Check if we're a little-endian or a big-endian system, needed by
+-# brg_endian.h in the build of rng_threefish. This is a very
+-# certain test, and therefore is checked FIRST in this header file.
+-#==================================================================
+-AC_DEFUN([AC_C_ENDIAN],
+-[AC_CACHE_CHECK(for endianness, ac_cv_c_endian,
+-[
+- AC_RUN_IFELSE(
+- [AC_LANG_PROGRAM([], [dnl
+- long val = 1;
+- char *c = (char *) &val;
+- exit(*c == 1);
+- ])
+- ],[
+- ac_cv_c_endian=big
+- ],[
+- ac_cv_c_endian=little
+- ])
+-])
+-if test $ac_cv_c_endian = big; then
+- AC_SUBST(LITTLE_ENDIAN,0)
+-fi
+-if test $ac_cv_c_endian = little; then
+- AC_SUBST(LITTLE_ENDIAN,1)
+-fi
+-])
+-
+-AC_C_ENDIAN
+-
++AC_C_BIGENDIAN([AC_SUBST(LITTLE_ENDIAN,0)],[AC_SUBST(LITTLE_ENDIAN,1)])
+
+ #==================================================================
+ # Checks for typedefs, structures, and compiler characteristics.
+
diff --git a/app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch b/app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch
index c5615b673fd0..e8a28ea41775 100644
--- a/app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch
+++ b/app-crypt/dieharder/files/dieharder-3.31.1-urandom-64bit.patch
@@ -1,6 +1,5 @@
-diff -ru dieharder-3.31.1/libdieharder/rng_dev_arandom.c dieharder-3.31.1_fixed/libdieharder/rng_dev_arandom.c
---- dieharder-3.31.1/libdieharder/rng_dev_arandom.c 2011-10-14 15:41:37.000000000 +0200
-+++ dieharder-3.31.1_fixed/libdieharder/rng_dev_arandom.c 2014-01-03 22:51:30.010534418 +0100
+--- a/libdieharder/rng_dev_arandom.c
++++ b/libdieharder/rng_dev_arandom.c
@@ -6,6 +6,7 @@
*/
@@ -27,9 +26,8 @@ diff -ru dieharder-3.31.1/libdieharder/rng_dev_arandom.c dieharder-3.31.1_fixed/
}
static void
-diff -ru dieharder-3.31.1/libdieharder/rng_dev_random.c dieharder-3.31.1_fixed/libdieharder/rng_dev_random.c
---- dieharder-3.31.1/libdieharder/rng_dev_random.c 2011-10-14 15:41:37.000000000 +0200
-+++ dieharder-3.31.1_fixed/libdieharder/rng_dev_random.c 2014-01-03 22:50:57.852321485 +0100
+--- a/libdieharder/rng_dev_random.c
++++ b/libdieharder/rng_dev_random.c
@@ -6,6 +6,7 @@
*/
@@ -56,9 +54,8 @@ diff -ru dieharder-3.31.1/libdieharder/rng_dev_random.c dieharder-3.31.1_fixed/l
}
static void
-diff -ru dieharder-3.31.1/libdieharder/rng_dev_urandom.c dieharder-3.31.1_fixed/libdieharder/rng_dev_urandom.c
---- dieharder-3.31.1/libdieharder/rng_dev_urandom.c 2011-10-14 15:41:37.000000000 +0200
-+++ dieharder-3.31.1_fixed/libdieharder/rng_dev_urandom.c 2014-01-03 23:06:24.124239582 +0100
+--- a/libdieharder/rng_dev_urandom.c
++++ b/libdieharder/rng_dev_urandom.c
@@ -3,6 +3,7 @@
*/