git.iko.soy/typeable/nixpkgs
on master help sign in
libguestfs: Made Java dependency optional
commit440cfd3e420c232a30ccefa7ccf210c8e60fa5a7 authorTeo Klestrup Röijezon <teo@nullable.se> dateTue 9 Jan 2018, 14:36 (9 years ago) parente74f61f
1 file changed+8−4
pkgs/development/libraries/libguestfs/default.nix+8−4
pkgs/development/libraries/libguestfs/default.nix+8−4
@@ -2,7 +2,10 @@
22, ncurses, cpio, gperf, perl, cdrkit, flex, bison, qemu, pcre, augeas, libxml2
33, acl, libcap, libcap_ng, libconfig, systemd, fuse, yajl, libvirt, hivex
44, gmp, readline, file, libintlperl, GetoptLong, SysVirt, numactl, xen, libapparmor
5−, getopt, perlPackages, ocamlPackages, jdk }:
5+, getopt, perlPackages, ocamlPackages
6+, javaSupport ? false, jdk ? null }:
7+
8+assert javaSupport -> jdk != null;
69
710stdenv.mkDerivation rec {
811 name = "libguestfs-${version}";
@@ -24,8 +27,8 @@ stdenv.mkDerivation rec {
2427 cdrkit flex bison qemu pcre augeas libxml2 acl libcap libcap_ng libconfig
2528 systemd fuse yajl libvirt gmp readline file hivex libintlperl GetoptLong
2629 SysVirt numactl xen libapparmor getopt perlPackages.ModuleBuild
27− jdk
28− ] ++ (with ocamlPackages; [ ocaml findlib ocamlbuild ocaml_libvirt ocaml_gettext ounit ]);
30+ ] ++ (with ocamlPackages; [ ocaml findlib ocamlbuild ocaml_libvirt ocaml_gettext ounit ])
31+ ++ stdenv.lib.optional javaSupport jdk;
2932
3033 prePatch = ''
3134 # build-time scripts
@@ -41,7 +44,8 @@ stdenv.mkDerivation rec {
4144 # some scripts hardcore /usr/bin/env which is not available in the build env
4245 patchShebangs .
4346 '';
44− configureFlags = "--disable-appliance --disable-daemon";
47+ configureFlags = [ "--disable-appliance" "--disable-daemon" ]
48+ ++ stdenv.lib.optionals (!javaSupport) [ "--disable-java" "--without-java" ];
4549 patches = [ ./libguestfs-syms.patch ];
4650 NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/";
4751 installFlags = "REALLY_INSTALL=yes";