2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, bash-completion
|
|
|
|
, bison
|
|
|
|
, cdrkit
|
|
|
|
, cpio
|
2022-12-17 10:02:37 +00:00
|
|
|
, curl
|
2022-10-21 18:38:19 +00:00
|
|
|
, flex
|
|
|
|
, getopt
|
2023-07-15 17:15:38 +00:00
|
|
|
, glib
|
2022-12-17 10:02:37 +00:00
|
|
|
, gnupg
|
2022-10-21 18:38:19 +00:00
|
|
|
, hivex
|
|
|
|
, jansson
|
|
|
|
, libguestfs-with-appliance
|
2023-07-15 17:15:38 +00:00
|
|
|
, libosinfo
|
2022-10-21 18:38:19 +00:00
|
|
|
, libvirt
|
|
|
|
, libxml2
|
|
|
|
, makeWrapper
|
|
|
|
, ncurses
|
|
|
|
, ocamlPackages
|
|
|
|
, openssl
|
|
|
|
, pcre2
|
|
|
|
, perlPackages
|
|
|
|
, pkg-config
|
|
|
|
, qemu
|
|
|
|
, xz
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "guestfs-tools";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "1.52.0";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://download.libguestfs.org/guestfs-tools/${lib.versions.majorMinor version}-stable/guestfs-tools-${version}.tar.gz";
|
2024-02-07 01:22:34 +00:00
|
|
|
sha256 = "sha256-Iv0TIpcEX5CmdAbw/w7uDyoBBqXxyNz8XDlqYl/3g3Y=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
bison
|
|
|
|
cdrkit
|
|
|
|
cpio
|
|
|
|
flex
|
|
|
|
getopt
|
|
|
|
makeWrapper
|
|
|
|
pkg-config
|
|
|
|
qemu
|
|
|
|
] ++
|
|
|
|
(with perlPackages; [
|
|
|
|
GetoptLong
|
|
|
|
libintl-perl
|
|
|
|
ModuleBuild
|
|
|
|
perl
|
|
|
|
Po4a
|
|
|
|
]) ++
|
|
|
|
(with ocamlPackages; [
|
|
|
|
findlib
|
|
|
|
gettext-stub
|
|
|
|
ocaml
|
|
|
|
ocaml_gettext
|
|
|
|
ounit2
|
|
|
|
]);
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bash-completion
|
2023-07-15 17:15:38 +00:00
|
|
|
glib
|
2022-10-21 18:38:19 +00:00
|
|
|
hivex
|
|
|
|
jansson
|
|
|
|
libguestfs-with-appliance
|
2023-07-15 17:15:38 +00:00
|
|
|
libosinfo
|
2022-10-21 18:38:19 +00:00
|
|
|
libvirt
|
|
|
|
libxml2
|
|
|
|
ncurses
|
|
|
|
openssl
|
|
|
|
pcre2
|
|
|
|
xz
|
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
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)'
|
|
|
|
'';
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs ocaml-dep.sh.in ocaml-link.sh.in run.in
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"LIBGUESTFS_PATH=${libguestfs-with-appliance}/lib/guestfs"
|
|
|
|
];
|
|
|
|
|
|
|
|
installFlags = [
|
|
|
|
"BASH_COMPLETIONS_DIR=${placeholder "out"}/share/bash-completion/completions"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
2022-12-17 10:02:37 +00:00
|
|
|
wrapProgram $out/bin/virt-builder \
|
|
|
|
--argv0 virt-builder \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ curl gnupg ]}:$out/bin \
|
|
|
|
--suffix VIRT_BUILDER_DIRS : /etc:$out/etc
|
2022-10-21 18:38:19 +00:00
|
|
|
wrapProgram $out/bin/virt-win-reg \
|
|
|
|
--prefix PERL5LIB : ${with perlPackages; makeFullPerlPath [ hivex libintl-perl libguestfs-with-appliance ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Extra tools for accessing and modifying virtual machine disk images";
|
|
|
|
license = with licenses; [ gpl2Plus lgpl21Plus ];
|
|
|
|
homepage = "https://libguestfs.org/";
|
2024-01-13 08:15:51 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2022-10-21 18:38:19 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|