2012-04-09 19:54:34 +00:00
|
|
|
{ stdenv, fetchurl }:
|
|
|
|
|
2013-10-02 09:37:43 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "memtest86+-5.01";
|
|
|
|
|
2012-04-09 19:54:34 +00:00
|
|
|
src = fetchurl {
|
2013-10-02 09:37:43 +00:00
|
|
|
url = "http://www.memtest.org/download/5.01/${name}.tar.gz";
|
|
|
|
sha256 = "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l";
|
2012-04-09 19:54:34 +00:00
|
|
|
};
|
|
|
|
|
2017-08-18 15:10:51 +00:00
|
|
|
patches = [
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://sources.debian.net/data/main/m/memtest86+/5.01-3/debian/patches/doc-serialconsole";
|
|
|
|
sha256 = "1qh2byj9bmpchym8iq20n4hqmy10nrl6bi0d9pgdqikkmw9m38jq";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://sources.debian.net/data/main/m/memtest86+/5.01-3/debian/patches/multiboot";
|
|
|
|
sha256 = "0nq61307ah5b41ff5nqs99wjzjzlajvfv6k9c9d0gqvhx8r4dvmy";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://sources.debian.net/data/main/m/memtest86+/5.01-3/debian/patches/memtest86+-5.01-O0.patch";
|
|
|
|
sha256 = "1xmj3anq1fr0cxwv8lqfp5cr5f58v7glwc6z0v8hx8aib8yj1wl2";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://sources.debian.net/data/main/m/memtest86+/5.01-3/debian/patches/memtest86+-5.01-array-size.patch";
|
|
|
|
sha256 = "0yxlzpfs6313s91y984p7rlf5rgybcjhg7i9zqy4wqhm3j90f1kb";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://sources.debian.net/data/main/m/memtest86+/5.01-3/debian/patches/gcc-5";
|
|
|
|
sha256 = "13xfy6sn8qbj1hx4vms2cz24dsa3bl8n2iblz185hkn11y7141sc";
|
|
|
|
})
|
|
|
|
];
|
2015-02-27 23:30:36 +00:00
|
|
|
|
2012-04-09 19:54:34 +00: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-27 22:49:30 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-I. -std=gnu90";
|
2013-10-02 09:37:43 +00:00
|
|
|
|
2017-03-07 14:40:40 +00:00
|
|
|
hardeningDisable = [ "fortify" "stackprotector" "pic" ];
|
2016-03-04 13:48:06 +00:00
|
|
|
|
2013-10-02 09:37:43 +00:00
|
|
|
buildFlags = "memtest.bin";
|
|
|
|
|
2012-04-09 19:54:34 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
2013-10-02 10:09:42 +00:00
|
|
|
chmod -x memtest.bin
|
2012-04-09 19:54:34 +00:00
|
|
|
cp memtest.bin $out/
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.memtest.org/;
|
2013-10-02 09:37:43 +00:00
|
|
|
description = "A tool to detect memory errors";
|
|
|
|
license = stdenv.lib.licenses.gpl2;
|
2017-12-03 17:47:03 +00:00
|
|
|
platforms = [ "x86_64-linux" "i686-linux" ];
|
2012-04-09 19:54:34 +00:00
|
|
|
};
|
|
|
|
}
|