Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 52 lines 1.7 kB view raw
1{ lib, stdenv, fetchFromGitHub, util-linux }: 2 3stdenv.mkDerivation rec { 4 pname = "mcelog"; 5 version = "180"; 6 7 src = fetchFromGitHub { 8 owner = "andikleen"; 9 repo = "mcelog"; 10 rev = "v${version}"; 11 sha256 = "1xy1082c67yd48idg5vwvrw7yx74gn6jj2d9c67d0rh6yji091ki"; 12 }; 13 14 postPatch = '' 15 for i in mcelog.conf paths.h; do 16 substituteInPlace $i --replace /etc $out/etc 17 done 18 touch mcelog.conf.5 # avoid regeneration requiring Python 19 20 substituteInPlace Makefile --replace '"unknown"' '"${version}"' 21 22 for i in triggers/*; do 23 substituteInPlace $i --replace 'logger' '${util-linux}/bin/logger' 24 done 25 ''; 26 27 enableParallelBuilding = true; 28 29 installFlags = [ "DESTDIR=$(out)" "prefix=" "DOCDIR=/share/doc" ]; 30 31 postInstall = '' 32 mkdir -p $out/lib/systemd/system 33 substitute mcelog.service $out/lib/systemd/system/mcelog.service \ 34 --replace /usr/sbin $out/bin 35 ''; 36 37 meta = with lib; { 38 description = "Log x86 machine checks: memory, IO, and CPU hardware errors"; 39 mainProgram = "mcelog"; 40 longDescription = '' 41 The mcelog daemon accounts memory and some other errors in various ways 42 on modern x86 Linux systems. The daemon can be queried and/or execute 43 triggers when configurable error thresholds are exceeded. This is used to 44 implement a range of automatic predictive failure analysis algorithms, 45 including bad page offlining and automatic cache error handling. All 46 errors are logged to /var/log/mcelog or syslog or the journal. 47 ''; 48 homepage = "http://mcelog.org/"; 49 license = licenses.gpl2Plus; 50 platforms = platforms.linux; 51 }; 52}