3
0
Fork 0
forked from mirrors/nixpkgs

libguestfs: Made Java dependency optional

This commit is contained in:
Teo Klestrup Röijezon 2018-01-09 14:36:37 +01:00
parent e74f61f30d
commit 440cfd3e42

View file

@ -2,7 +2,10 @@
, ncurses, cpio, gperf, perl, cdrkit, flex, bison, qemu, pcre, augeas, libxml2 , ncurses, cpio, gperf, perl, cdrkit, flex, bison, qemu, pcre, augeas, libxml2
, acl, libcap, libcap_ng, libconfig, systemd, fuse, yajl, libvirt, hivex , acl, libcap, libcap_ng, libconfig, systemd, fuse, yajl, libvirt, hivex
, gmp, readline, file, libintlperl, GetoptLong, SysVirt, numactl, xen, libapparmor , gmp, readline, file, libintlperl, GetoptLong, SysVirt, numactl, xen, libapparmor
, getopt, perlPackages, ocamlPackages, jdk }: , getopt, perlPackages, ocamlPackages
, javaSupport ? false, jdk ? null }:
assert javaSupport -> jdk != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libguestfs-${version}"; name = "libguestfs-${version}";
@ -24,8 +27,8 @@ stdenv.mkDerivation rec {
cdrkit flex bison qemu pcre augeas libxml2 acl libcap libcap_ng libconfig cdrkit flex bison qemu pcre augeas libxml2 acl libcap libcap_ng libconfig
systemd fuse yajl libvirt gmp readline file hivex libintlperl GetoptLong systemd fuse yajl libvirt gmp readline file hivex libintlperl GetoptLong
SysVirt numactl xen libapparmor getopt perlPackages.ModuleBuild SysVirt numactl xen libapparmor getopt perlPackages.ModuleBuild
jdk ] ++ (with ocamlPackages; [ ocaml findlib ocamlbuild ocaml_libvirt ocaml_gettext ounit ])
] ++ (with ocamlPackages; [ ocaml findlib ocamlbuild ocaml_libvirt ocaml_gettext ounit ]); ++ stdenv.lib.optional javaSupport jdk;
prePatch = '' prePatch = ''
# build-time scripts # build-time scripts
@ -41,7 +44,8 @@ stdenv.mkDerivation rec {
# some scripts hardcore /usr/bin/env which is not available in the build env # some scripts hardcore /usr/bin/env which is not available in the build env
patchShebangs . patchShebangs .
''; '';
configureFlags = "--disable-appliance --disable-daemon"; configureFlags = [ "--disable-appliance" "--disable-daemon" ]
++ stdenv.lib.optionals (!javaSupport) [ "--disable-java" "--without-java" ];
patches = [ ./libguestfs-syms.patch ]; patches = [ ./libguestfs-syms.patch ];
NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/"; NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/";
installFlags = "REALLY_INSTALL=yes"; installFlags = "REALLY_INSTALL=yes";