2012-04-09 23:54:34 +04:00
|
|
|
{ stdenv, fetchurl }:
|
|
|
|
|
2013-10-02 13:37:43 +04:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "memtest86+-5.01";
|
|
|
|
|
2012-04-09 23:54:34 +04:00
|
|
|
src = fetchurl {
|
2013-10-02 13:37:43 +04:00
|
|
|
url = "http://www.memtest.org/download/5.01/${name}.tar.gz";
|
|
|
|
sha256 = "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l";
|
2012-04-09 23:54:34 +04:00
|
|
|
};
|
|
|
|
|
2015-02-28 02:30:36 +03:00
|
|
|
# Patch incompatiblity with GCC. Source: http://koji.fedoraproject.org/koji/buildinfo?buildID=586907
|
|
|
|
patches = [ ./compile-fix.patch ./crash-fix.patch ./no-optimization.patch ];
|
|
|
|
|
2012-04-09 23:54:34 +04:00
|
|
|
preBuild = ''
|
|
|
|
# Really dirty hack to get Memtest to build without needing a Glibc
|
|
|
|
# with 32-bit libraries and headers.
|
|
|
|
if test "$system" = x86_64-linux; then
|
|
|
|
mkdir gnu
|
|
|
|
touch gnu/stubs-32.h
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2015-06-28 01:49:30 +03:00
|
|
|
NIX_CFLAGS_COMPILE = "-I. -std=gnu90";
|
2013-10-02 13:37:43 +04:00
|
|
|
|
|
|
|
buildFlags = "memtest.bin";
|
|
|
|
|
2012-04-09 23:54:34 +04:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
2013-10-02 14:09:42 +04:00
|
|
|
chmod -x memtest.bin
|
2012-04-09 23:54:34 +04:00
|
|
|
cp memtest.bin $out/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.memtest.org/;
|
2013-10-02 13:37:43 +04:00
|
|
|
description = "A tool to detect memory errors";
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2012-04-09 23:54:34 +04:00
|
|
|
};
|
|
|
|
}
|