guestfs-tools: fix virt-builder lookup path

virt-builder --list would be empty, because it would look in
/etc/.virt-builder-wrapped.  Instead, we want it to look in
$out/etc/virt-builder, where the data is actually installed (while
still allowing user-provided overrides to be placed in /etc).
This commit is contained in:
Alyssa Ross 2022-12-01 08:37:13 +00:00
parent 12c758b069
commit ad3c91ce35
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -70,6 +70,14 @@ stdenv.mkDerivation rec {
xz
];
postPatch = ''
# If it uses the executable name, then there's nothing we can do
# when wrapping to stop it looking in
# $out/etc/.virt-builder-wrapped, which won't exist.
substituteInPlace common/mlstdutils/std_utils.ml \
--replace Sys.executable_name '(Array.get Sys.argv 0)'
'';
preConfigure = ''
patchShebangs ocaml-dep.sh.in ocaml-link.sh.in run.in
'';
@ -85,6 +93,9 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
postInstall = ''
wrapProgram $out/bin/virt-builder \
--argv0 virt-builder \
--suffix VIRT_BUILDER_DIRS : /etc:$out/etc
wrapProgram $out/bin/virt-win-reg \
--prefix PERL5LIB : ${with perlPackages; makeFullPerlPath [ hivex libintl-perl libguestfs-with-appliance ]}
'';