2022-06-05 22:13:55 +00:00
|
|
|
{ pkgs, ... }:
|
|
|
|
with pkgs;
|
2022-06-05 21:43:30 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "triton-vmtools";
|
|
|
|
version = "0.0.1";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "TritonDataCenter";
|
|
|
|
repo = "sdc-vmtools";
|
|
|
|
rev = "664539f808786bc71a2ab566f663fd25b8c12140";
|
|
|
|
sha256 = "sha256-RI1iqRvjSEPVJob0Y20/eJ8AmObhXP6Nn9b1Vv1cCO4=";
|
|
|
|
};
|
|
|
|
|
|
|
|
PATH = lib.makeBinPath nativeBuildInputs;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
coreutils
|
|
|
|
e2fsprogs
|
|
|
|
inetutils
|
|
|
|
iputils
|
|
|
|
policycoreutils
|
|
|
|
util-linux
|
|
|
|
parted
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./0001-fix-paths-in-scripts.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
sdcvmtools="src/linux"
|
|
|
|
mkdir -p $out/bin $out/lib $out/share/man/man1
|
|
|
|
cp -r ''${sdcvmtools}/lib/smartdc $out/lib/
|
|
|
|
cp -r ''${sdcvmtools}/usr/sbin/mdata-* $out/bin/
|
|
|
|
cp -r ''${sdcvmtools}/usr/share/man/man1/mdata-* $out/share/man/man1/
|
2022-06-06 01:03:12 +00:00
|
|
|
|
|
|
|
for file in $out/lib/smartdc/*
|
|
|
|
do
|
|
|
|
substituteInPlace ''$file \
|
|
|
|
--replace "/__replace_lib/" "$out/lib/"
|
|
|
|
substituteInPlace ''$file \
|
|
|
|
--replace "/__replace_lib/" "$out/lib/"
|
|
|
|
done
|
|
|
|
|
|
|
|
substituteInPlace $out/lib/smartdc/lib_smartdc_scripts.cfg \
|
|
|
|
--replace "/usr/sbin/" "$out/bin/"
|
2022-06-05 21:43:30 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "The VM Guest tools contains scripts and drivers that are used to create virtualized machine images in SmartOS.";
|
|
|
|
homepage = "https://github.com/TritonDataCenter/sdc-vmtools";
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
}
|