nixpkgs-suyu/pkgs/servers/monitoring/fusion-inventory/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

82 lines
1.8 KiB
Nix

{ stdenv, lib, perlPackages, nix, dmidecode, pciutils, usbutils, iproute, nettools
, fetchFromGitHub, makeWrapper
}:
perlPackages.buildPerlPackage rec {
pname = "FusionInventory-Agent";
version = "2.6";
src = fetchFromGitHub {
owner = "fusioninventory";
repo = "fusioninventory-agent";
rev = version;
sha256 = "1hbp5a9m03n6a80xc8z640zs71qhqk4ifafr6fp0vvzzvq097ip2";
};
postPatch = ''
patchShebangs bin
substituteInPlace "lib/FusionInventory/Agent/Tools/Linux.pm" \
--replace /sbin/ip ${iproute}/sbin/ip
substituteInPlace "lib/FusionInventory/Agent/Task/Inventory/Linux/Networks.pm" \
--replace /sbin/ip ${iproute}/sbin/ip
'';
buildTools = [];
buildInputs = [ makeWrapper ] ++ (with perlPackages; [
CGI
DataStructureUtil
FileCopyRecursive
HTTPProxy
HTTPServerSimple
HTTPServerSimpleAuthen
IOCapture
IOSocketSSL
IPCRun
JSON
LWPProtocolHttps
ModuleInstall
NetSNMP
TestCompile
TestDeep
TestException
TestMockModule
TestMockObject
TestNoWarnings
]);
propagatedBuildInputs = with perlPackages; [
FileWhich
LWP
NetIP
TextTemplate
UNIVERSALrequire
XMLTreePP
];
# Test fails due to "Argument list too long"
doCheck = false;
installPhase = ''
mkdir -p $out
cp -r bin $out
cp -r lib $out
for cur in $out/bin/*; do
if [ -x "$cur" ]; then
sed -e "s|./lib|$out/lib|" -i "$cur"
wrapProgram "$cur" --prefix PATH : ${lib.makeBinPath [nix dmidecode pciutils usbutils nettools iproute]}
fi
done
'';
outputs = [ "out" ];
meta = with lib; {
homepage = "http://www.fusioninventory.org";
description = "FusionInventory unified Agent for UNIX, Linux, Windows and MacOSX";
license = stdenv.lib.licenses.gpl2;
maintainers = [ maintainers.phile314 ];
};
}