mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 12:11:28 +00:00
libguestfs: fix path to appliance
This commit is contained in:
parent
510907a598
commit
f823d50259
7
pkgs/development/libraries/libguestfs/appliance.nix
Normal file
7
pkgs/development/libraries/libguestfs/appliance.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ fetchzip }:
|
||||
|
||||
fetchzip {
|
||||
name = "libguestfs-appliance-1.38.0";
|
||||
url = "http://libguestfs.org/download/binaries/appliance/appliance-1.38.0.tar.xz";
|
||||
sha256 = "15rxwj5qjflizxk7slpbrj9lcwkd2lgm52f5yv101qba4yyn3g76";
|
||||
}
|
|
@ -3,19 +3,16 @@
|
|||
, acl, libcap, libcap_ng, libconfig, systemd, fuse, yajl, libvirt, hivex
|
||||
, gmp, readline, file, libintlperl, GetoptLong, SysVirt, numactl, xen, libapparmor
|
||||
, getopt, perlPackages, ocamlPackages
|
||||
, appliance ? null
|
||||
, javaSupport ? false, jdk ? null }:
|
||||
|
||||
assert appliance == null || stdenv.lib.isDerivation appliance;
|
||||
assert javaSupport -> jdk != null;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "libguestfs-${version}";
|
||||
version = "1.38.0";
|
||||
|
||||
appliance = fetchurl {
|
||||
url = "http://libguestfs.org/download/binaries/appliance/appliance-1.38.0.tar.xz";
|
||||
sha256 = "05481qxgidakga871yb5rgpyci2jaxmplmkh6y79anfh5m19nzhy";
|
||||
};
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://libguestfs.org/download/1.38-stable/libguestfs-${version}.tar.gz";
|
||||
sha256 = "0cgapiad3x5ggwm097mq62hng3bv91p5gmrikrb6adfaasr1l6m3";
|
||||
|
@ -54,14 +51,31 @@ stdenv.mkDerivation rec {
|
|||
postInstall = ''
|
||||
for bin in $out/bin/*; do
|
||||
wrapProgram "$bin" \
|
||||
--prefix "PATH" : "$out/bin:${hivex}/bin:${qemu}/bin" \
|
||||
--prefix "PERL5LIB" : "$PERL5LIB:$out/lib/perl5/site_perl"
|
||||
--prefix PATH : "$out/bin:${hivex}/bin:${qemu}/bin" \
|
||||
--prefix PERL5LIB : "$out/lib/perl5/site_perl"
|
||||
done
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
mkdir -p "$out/lib/guestfs"
|
||||
tar -Jxvf "$appliance" --strip 1 -C "$out/lib/guestfs"
|
||||
postFixup = stdenv.lib.optionalString (appliance != null) ''
|
||||
mkdir -p $out/{lib,lib64}
|
||||
ln -s ${appliance} $out/lib64/guestfs
|
||||
ln -s ${appliance} $out/lib/guestfs
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
export HOME=$(mktemp -d) # avoid access to /homeless-shelter/.guestfish
|
||||
|
||||
${qemu}/bin/qemu-img create -f qcow2 disk1.img 10G
|
||||
|
||||
$out/bin/guestfish <<'EOF'
|
||||
add-drive disk1.img
|
||||
run
|
||||
list-filesystems
|
||||
part-disk /dev/sda mbr
|
||||
mkfs ext2 /dev/sda1
|
||||
list-filesystems
|
||||
EOF
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
|
|
@ -9836,8 +9836,10 @@ with pkgs;
|
|||
|
||||
libgudev = callPackage ../development/libraries/libgudev { };
|
||||
|
||||
libguestfs-appliance = callPackage ../development/libraries/libguestfs/appliance.nix {};
|
||||
libguestfs = callPackage ../development/libraries/libguestfs {
|
||||
inherit (perlPackages) libintlperl GetoptLong SysVirt;
|
||||
appliance = libguestfs-appliance;
|
||||
};
|
||||
|
||||
libhangul = callPackage ../development/libraries/libhangul { };
|
||||
|
|
Loading…
Reference in a new issue