1 { lib, stdenv, fetchFromGitHub, makeWrapper, which, coreutils, rrdtool, perlPackages
2 , python3, ruby, jre8, nettools, bc
5 stdenv.mkDerivation rec {
9 src = fetchFromGitHub {
10 owner = "munin-monitoring";
13 sha256 = "sha256-fxjF2CV5SoUTirusGQBpbNu9MYKU5yx+DHS2h0NJoic=";
26 perlPackages.ModuleBuild
27 perlPackages.HTMLTemplate
29 perlPackages.NetSSLeay
30 perlPackages.NetServer
31 perlPackages.LogLog4perl
32 perlPackages.IOSocketINET6
37 perlPackages.FileCopyRecursive
40 perlPackages.NetServer
41 perlPackages.ListMoreUtils
48 perlPackages.TestLongString
49 perlPackages.TestDifferences
51 perlPackages.TestMockModule
52 perlPackages.TestMockObject
53 perlPackages.FileSlurp
54 perlPackages.IOStringy
57 # needs to find a local perl module during build
58 env.PERL_USE_UNSAFE_INC = "1";
60 # TODO: tests are failing https://munin-monitoring.org/ticket/1390#comment:1
61 # NOTE: important, test command always exits with 0, think of a way to abort the build once tests pass
65 export PERL5LIB="$PERL5LIB:${rrdtool}/${perlPackages.perl.libPrefix}"
66 LC_ALL=C make -j1 test
70 # https://rt.cpan.org/Public/Bug/Display.html?id=75112
71 ./dont_preserve_source_dir_permissions.patch
73 # https://github.com/munin-monitoring/munin/pull/134
74 ./adding_servicedir_munin-node.patch
76 ./adding_sconfdir_munin-node.patch
77 ./preserve_environment.patch
81 echo "${version}" > RELEASE
82 substituteInPlace "Makefile" \
83 --replace "/bin/pwd" "pwd" \
84 --replace "HTMLOld.3pm" "HTMLOld.3"
86 # munin checks at build time if user/group exists, unpure
87 sed -i '/CHECKUSER/d' Makefile
88 sed -i '/CHOWN/d' Makefile
89 sed -i '/CHECKGROUP/d' Makefile
91 # munin hardcodes PATH, we need it to obey $PATH
92 sed -i '/ENV{PATH}/d' node/lib/Munin/Node/Service.pm
95 # Disable parallel build, errors:
96 # Can't locate Munin/Common/Defaults.pm in @INC ...
97 enableParallelBuilding = false;
99 # DESTDIR shouldn't be needed (and shouldn't have worked), but munin
100 # developers have forgotten to use PREFIX everywhere, so we use DESTDIR to
101 # ensure that everything is installed in $out.
105 "PERLLIB=$(out)/${perlPackages.perl.libPrefix}"
106 "PERL=${perlPackages.perl.outPath}/bin/perl"
107 "PYTHON=${python3.interpreter}"
108 "RUBY=${ruby.outPath}/bin/ruby"
109 "JAVARUN=${jre8.outPath}/bin/java"
114 echo "Removing references to /usr/{bin,sbin}/ from munin plugins..."
115 find "$out/lib/plugins" -type f -print0 | xargs -0 -L1 \
116 sed -i -e "s|/usr/bin/||g" -e "s|/usr/sbin/||g" -e "s|\<bc\>|${bc}/bin/bc|g"
118 if test -e $out/nix-support/propagated-build-inputs; then
119 ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
122 for file in "$out"/bin/munindoc "$out"/sbin/munin-* "$out"/lib/munin-* "$out"/www/cgi/*; do
123 # don't wrap .jar files
127 wrapProgram "$file" \
128 --set PERL5LIB "$out/${perlPackages.perl.libPrefix}:${with perlPackages; makePerlPath [
129 LogLog4perl IOSocketINET6 Socket6 URI DBFile TimeDate
130 HTMLTemplate FileCopyRecursive FCGI NetCIDR NetSNMP NetServer
131 ListMoreUtils DBDPg LWP rrdtool
137 description = "Networked resource monitoring tool";
139 Munin is a monitoring tool that surveys all your computers and remembers
140 what it saw. It presents all the information in graphs through a web
141 interface. Munin can help analyze resource trends and 'what just happened
142 to kill our performance?' problems.
144 homepage = "https://munin-monitoring.org/";
145 license = licenses.gpl2;
146 maintainers = [ maintainers.bjornfor ];
147 platforms = platforms.linux;