nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 perlPackages,
4 nix,
5 dmidecode,
6 pciutils,
7 usbutils,
8 iproute2,
9 net-tools,
10 fetchFromGitHub,
11 makeWrapper,
12}:
13
14perlPackages.buildPerlPackage rec {
15 pname = "FusionInventory-Agent";
16 version = "2.6";
17
18 src = fetchFromGitHub {
19 owner = "fusioninventory";
20 repo = "fusioninventory-agent";
21 rev = version;
22 sha256 = "1hbp5a9m03n6a80xc8z640zs71qhqk4ifafr6fp0vvzzvq097ip2";
23 };
24
25 postPatch = ''
26
27 patchShebangs bin
28
29 substituteInPlace "lib/FusionInventory/Agent/Tools/Linux.pm" \
30 --replace /sbin/ip ${iproute2}/sbin/ip
31 substituteInPlace "lib/FusionInventory/Agent/Task/Inventory/Linux/Networks.pm" \
32 --replace /sbin/ip ${iproute2}/sbin/ip
33 '';
34
35 buildTools = [ ];
36 nativeBuildInputs = [ makeWrapper ];
37 buildInputs = (
38 with perlPackages;
39 [
40 CGI
41 DataStructureUtil
42 FileCopyRecursive
43 HTTPProxy
44 HTTPServerSimple
45 HTTPServerSimpleAuthen
46 IOCapture
47 IOSocketSSL
48 IPCRun
49 JSON
50 LWPProtocolHttps
51 ModuleInstall
52 NetSNMP
53 TestCompile
54 TestDeep
55 TestException
56 TestMockModule
57 TestMockObject
58 TestNoWarnings
59 ]
60 );
61 propagatedBuildInputs = with perlPackages; [
62 FileWhich
63 LWP
64 NetIP
65 TextTemplate
66 UNIVERSALrequire
67 XMLTreePP
68 ];
69
70 # Test fails due to "Argument list too long"
71 doCheck = false;
72
73 installPhase = ''
74 mkdir -p $out
75
76 cp -r bin $out
77 cp -r lib $out
78 cp -r share $out
79
80 for cur in $out/bin/*; do
81 if [ -x "$cur" ]; then
82 sed -e "s|./lib|$out/lib|" -i "$cur"
83 wrapProgram "$cur" --prefix PATH : ${
84 lib.makeBinPath [
85 nix
86 dmidecode
87 pciutils
88 usbutils
89 net-tools
90 iproute2
91 ]
92 }
93 fi
94 done
95 '';
96
97 outputs = [ "out" ];
98
99 meta = {
100 homepage = "https://www.fusioninventory.org";
101 description = "FusionInventory unified Agent for UNIX, Linux, Windows and MacOSX";
102 license = lib.licenses.gpl2Only;
103 maintainers = [ lib.maintainers.phile314 ];
104 };
105}