11{
2- lib ,
3- stdenv ,
4- fetchFromGitHub ,
52 autoreconfHook ,
6- pkg-config ,
7- glibcLocales ,
8- kmod ,
9- coreutils ,
10- perl ,
11- dmidecode ,
12- hwdata ,
13- sqlite ,
3+ fetchFromGitHub ,
4+ lib ,
145 libtraceevent ,
15- fetchpatch ,
6+ nix-update-script ,
167 nixosTests ,
8+ perl ,
9+ pkg-config ,
10+ sqlite ,
11+ stdenv ,
12+ # Options
13+ enableDmidecode ? stdenv . hostPlatform . isx86_64 ,
14+ dmidecode ,
1715} :
1816
19- stdenv . mkDerivation rec {
17+ stdenv . mkDerivation ( finalAttrs : {
2018 pname = "rasdaemon" ;
21- version = "0.8.0 " ;
19+ version = "0.8.2 " ;
2220
2321 src = fetchFromGitHub {
2422 owner = "mchehab" ;
2523 repo = "rasdaemon" ;
26- rev = "v${ version } " ;
27- sha256 = "sha256-BX3kc629FOh5cnD6Sa/69wKdhmhT3Rpz5ZvhnD4MclQ =" ;
24+ tag = "v${ finalAttrs . version } " ;
25+ hash = "sha256-veaqAbSJvoUzkn1OLYY3t3y9Bh8dzuenpLGO2yz/yaM =" ;
2826 } ;
2927
30- patches = [
31- ( fetchpatch {
32- # fix #295002 (segfault on AMD), will be in the release after 0.8.0
33- name = "fix crash on AMD" ;
34- url = "https://github.com/mchehab/rasdaemon/commit/f1ea76375281001cdf4a048c1a4a24d86c6fbe48.patch" ;
35- hash = "sha256-1VPDTrAsvZGiGbh52EUdG6tYV/n6wUS0mphOSXzran0=" ;
36- } )
37- ] ;
28+ strictDeps = true ;
29+
30+ enableParallelBuilding = true ;
3831
3932 nativeBuildInputs = [
4033 autoreconfHook
4134 pkg-config
4235 ] ;
4336
44- buildInputs = [
45- coreutils
46- glibcLocales
47- hwdata
48- kmod
49- sqlite
50- libtraceevent
51- ( perl . withPackages (
52- ps : with ps ; [
53- DBI
54- DBDSQLite
55- ]
56- ) )
57- ] ++ lib . optionals ( ! stdenv . hostPlatform . isAarch64 ) [ dmidecode ] ;
37+ buildInputs =
38+ [
39+ libtraceevent
40+ ( perl . withPackages (
41+ ps : with ps ; [
42+ DBDSQLite
43+ ]
44+ ) )
45+ sqlite
46+ ]
47+ ++ lib . optionals enableDmidecode [
48+ dmidecode
49+ ] ;
5850
5951 configureFlags = [
6052 "--sysconfdir=/etc"
6153 "--localstatedir=/var"
62- "--with-sysconfdefdir=${ placeholder "out" } /etc/sysconfig"
6354 "--enable-all"
6455 ] ;
6556
@@ -83,9 +74,15 @@ stdenv.mkDerivation rec {
8374
8475 # easy way out, ends up installing /nix/store/...rasdaemon/bin in $out
8576
86- postConfigure = ''
87- substituteInPlace Makefile \
88- --replace '"$(DESTDIR)/etc/ras/dimm_labels.d"' '"$(prefix)/etc/ras/dimm_labels.d"'
77+ postPatch = ''
78+ patchShebangs contrib/
79+ '' ;
80+
81+ preConfigure = ''
82+ substituteInPlace Makefile.am \
83+ --replace-fail '"$(DESTDIR)@sysconfdir@/ras/dimm_labels.d"' '"$(prefix)@sysconfdir@/ras/dimm_labels.d"' \
84+ --replace-fail '"$(DESTDIR)@SYSCONFDEFDIR@/rasdaemon"' '"$(prefix)@SYSCONFDEFDIR@/rasdaemon"' \
85+ --replace-fail '"$(DESTDIR)@sysconfdir@/ras/triggers' '"$(prefix)@sysconfdir@/ras/triggers'
8986 '' ;
9087
9188 outputs = [
@@ -100,20 +97,16 @@ stdenv.mkDerivation rec {
10097 install -Dm 0755 contrib/edac-tests $inject/bin/edac-tests
10198 '' ;
10299
103- postFixup =
104- ''
105- # Fix dmidecode and modprobe paths
106- substituteInPlace $out/bin/ras-mc-ctl \
107- --replace 'find_prog ("modprobe") or exit (1)' '"${ kmod } /bin/modprobe"'
108- ''
109- + lib . optionalString ( ! stdenv . hostPlatform . isAarch64 ) ''
110- substituteInPlace $out/bin/ras-mc-ctl \
111- --replace 'find_prog ("dmidecode")' '"${ dmidecode } /bin/dmidecode"'
112- '' ;
100+ postFixup = lib . optionalString enableDmidecode ''
101+ substituteInPlace $out/bin/ras-mc-ctl \
102+ --replace-fail 'find_prog ("dmidecode")' '"${ dmidecode } /bin/dmidecode"'
103+ '' ;
113104
114105 passthru . tests = nixosTests . rasdaemon ;
115106
116- meta = with lib ; {
107+ passthru . updateScript = nix-update-script { } ;
108+
109+ meta = {
117110 description = ''
118111 A Reliability, Availability and Serviceability (RAS) logging tool using EDAC kernel tracing events
119112 '' ;
@@ -125,9 +118,9 @@ stdenv.mkDerivation rec {
125118 drivers for other architectures like arm also exists.
126119 '' ;
127120 homepage = "https://github.com/mchehab/rasdaemon" ;
128- license = licenses . gpl2Plus ;
129- platforms = platforms . linux ;
130- changelog = "https://github.com/mchehab/rasdaemon/blob/ v${ version } /ChangeLog " ;
131- maintainers = with maintainers ; [ evils ] ;
121+ license = lib . licenses . gpl2Plus ;
122+ platforms = lib . platforms . linux ;
123+ changelog = "${ finalAttrs . meta . homepage } /releases/tag/ v${ finalAttrs . version } " ;
124+ maintainers = with lib . maintainers ; [ evils ] ;
132125 } ;
133- }
126+ } )
0 commit comments