summary refs log tree commit diff
path: root/pkgs/development/libraries/libguestfs
diff options
context:
space:
mode:
authorJaka Hudoklin <jakahudoklin@gmail.com>2014-11-06 11:32:59 +0100
committerJaka Hudoklin <jakahudoklin@gmail.com>2014-11-09 15:24:25 +0100
commit25b2d2d9b040814f1a1ac3daa7d0493178eab2d0 (patch)
tree0985cbaaaa8d07ee3598939127a0fd8516409210 /pkgs/development/libraries/libguestfs
parent7dc7ccbe5bae19e10ff80ab13a511349ffcd8906 (diff)
downloadnixpkgs-25b2d2d9b040814f1a1ac3daa7d0493178eab2d0.tar
nixpkgs-25b2d2d9b040814f1a1ac3daa7d0493178eab2d0.tar.gz
nixpkgs-25b2d2d9b040814f1a1ac3daa7d0493178eab2d0.tar.bz2
nixpkgs-25b2d2d9b040814f1a1ac3daa7d0493178eab2d0.tar.lz
nixpkgs-25b2d2d9b040814f1a1ac3daa7d0493178eab2d0.tar.xz
nixpkgs-25b2d2d9b040814f1a1ac3daa7d0493178eab2d0.tar.zst
nixpkgs-25b2d2d9b040814f1a1ac3daa7d0493178eab2d0.zip
Add libguestfs, tools for accessing and modifying virtual machine images
Diffstat (limited to 'pkgs/development/libraries/libguestfs')
-rw-r--r--pkgs/development/libraries/libguestfs/default.nix55
-rw-r--r--pkgs/development/libraries/libguestfs/libguestfs-syms.patch13
2 files changed, 68 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libguestfs/default.nix b/pkgs/development/libraries/libguestfs/default.nix
new file mode 100644
index 00000000000..27e1c6adc00
--- /dev/null
+++ b/pkgs/development/libraries/libguestfs/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchurl, pkgconfig, autoconf, automake, libtool, makeWrapper
+, ncurses, cpio, gperf, perl, cdrkit, flex, bison, qemu, pcre, augeas, libxml2
+, acl, libcap, libcap_ng, libconfig, systemd, fuse, yajl, libvirt, hivex
+, gmp, readline, file, libintlperl, GetoptLong, SysVirt }:
+
+stdenv.mkDerivation rec {
+  name = "libguestfs-${version}";
+  version = "1.29.5";
+
+  appliance = fetchurl {
+    url = "http://libguestfs.org/download/binaries/appliance/appliance-1.26.0.tar.xz";
+    sha256 = "1kzvgmy845kclvr93y6rdpss2q0p8yfqg14r0i1pi5r4zc68yvj4";
+  };
+
+  src = fetchurl {
+    url = "http://libguestfs.org/download/1.29-development/libguestfs-${version}.tar.gz";
+    sha256 = "1il0p3irwcyfdm83935hj4bvxsx0kdfn8dvqmg2lbzap17jvzj8h";
+  };
+
+  buildInputs = [
+    makeWrapper pkgconfig autoconf automake libtool ncurses cpio gperf perl
+    cdrkit flex bison qemu pcre augeas libxml2 acl libcap libcap_ng libconfig
+    systemd fuse yajl libvirt gmp readline file hivex libintlperl GetoptLong
+    SysVirt
+  ];
+
+  configureFlags = "--disable-appliance --disable-daemon";
+  patches = [ ./libguestfs-syms.patch ];
+  NIX_CFLAGS_COMPILE="-I${libxml2}/include/libxml2/";
+
+  preConfigure = ''
+    AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose --install
+  '';
+
+  postInstall = ''
+    for bin in $out/bin/*; do
+      wrapProgram "$bin" \
+        --prefix "PATH" : "$out/bin:${hivex}/bin" \
+        --prefix "PERL5LIB" : "$PERL5LIB:$out/lib/perl5/site_perl"
+    done
+  '';
+
+  postFixup = ''
+    mkdir -p "$out/lib/guestfs"
+    tar -Jxvf "$appliance" --strip 1 -C "$out/lib/guestfs"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Tools for accessing and modifying virtual machine disk images";
+    license = licenses.gpl2;
+    homepage = http://libguestfs.org/;
+    maintainers = with maintainers; [offline];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/pkgs/development/libraries/libguestfs/libguestfs-syms.patch b/pkgs/development/libraries/libguestfs/libguestfs-syms.patch
new file mode 100644
index 00000000000..44cdc4e69b2
--- /dev/null
+++ b/pkgs/development/libraries/libguestfs/libguestfs-syms.patch
@@ -0,0 +1,13 @@
+diff -rupN libguestfs-1.29.5/src/Makefile.am libguestfs-1.29.5-new/src/Makefile.am
+--- libguestfs-1.29.5/src/Makefile.am	2014-11-05 16:43:08.000000000 +0100
++++ libguestfs-1.29.5-new/src/Makefile.am	2014-11-05 20:07:45.760730596 +0100
+@@ -167,8 +167,7 @@ libguestfs_la_LIBADD = \
+ # Force libtool to name the library 'libguestfs.so.0.$(MAX_PROC_NR).0'.
+ # Include the version script to limit which symbols are exported.
+ libguestfs_la_LDFLAGS = \
+-	-version-info $(MAX_PROC_NR):0:$(MAX_PROC_NR) \
+-	$(VERSION_SCRIPT_FLAGS)$(srcdir)/libguestfs.syms
++	-version-info $(MAX_PROC_NR):0:$(MAX_PROC_NR)
+ 
+ if HAVE_FUSE
+ # XXX Unfortunately FUSE_CFLAGS defines _FILE_OFFSET_BITS=64.