From 128a3b10a696a1d29a6f71fad0033520cbd063c5 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Wed, 3 Aug 2022 10:48:00 +0200 Subject: [PATCH 1/2] libguestfs: format using nixpkgs-fmt --- .../libraries/libguestfs/default.nix | 86 ++++++++++++++++--- 1 file changed, 72 insertions(+), 14 deletions(-) diff --git a/pkgs/development/libraries/libguestfs/default.nix b/pkgs/development/libraries/libguestfs/default.nix index d65ead78624c..4c4ba888e669 100644 --- a/pkgs/development/libraries/libguestfs/default.nix +++ b/pkgs/development/libraries/libguestfs/default.nix @@ -1,11 +1,43 @@ -{ lib, stdenv, fetchurl, pkg-config, autoreconfHook, makeWrapper -, ncurses, cpio, gperf, cdrkit, flex, bison, qemu, pcre2, augeas, libxml2 -, acl, libcap, libcap_ng, libconfig, systemd, fuse, yajl, libvirt, hivex, db -, gmp, readline, file, numactl, libapparmor, jansson -, getopt, perlPackages, ocamlPackages +{ lib +, stdenv +, fetchurl +, pkg-config +, autoreconfHook +, makeWrapper +, ncurses +, cpio +, gperf +, cdrkit +, flex +, bison +, qemu +, pcre2 +, augeas +, libxml2 +, acl +, libcap +, libcap_ng +, libconfig +, systemd +, fuse +, yajl +, libvirt +, hivex +, db +, gmp +, readline +, file +, numactl +, libapparmor +, jansson +, getopt +, perlPackages +, ocamlPackages , libtirpc , appliance ? null -, javaSupport ? false, jdk ? null }: +, javaSupport ? false +, jdk ? null +}: assert appliance == null || lib.isDerivation appliance; assert javaSupport -> jdk != null; @@ -21,17 +53,43 @@ stdenv.mkDerivation rec { strictDeps = true; nativeBuildInputs = [ - autoreconfHook bison cdrkit cpio flex getopt gperf makeWrapper pkg-config qemu + autoreconfHook + bison + cdrkit + cpio + flex + getopt + gperf + makeWrapper + pkg-config + qemu ] ++ (with perlPackages; [ perl libintl-perl GetoptLong SysVirt ]) - ++ (with ocamlPackages; [ ocaml findlib ]); + ++ (with ocamlPackages; [ ocaml findlib ]); buildInputs = [ - ncurses jansson - pcre2 augeas libxml2 acl libcap libcap_ng libconfig - systemd fuse yajl libvirt gmp readline file hivex db - numactl libapparmor perlPackages.ModuleBuild + ncurses + jansson + pcre2 + augeas + libxml2 + acl + libcap + libcap_ng + libconfig + systemd + fuse + yajl + libvirt + gmp + readline + file + hivex + db + numactl + libapparmor + perlPackages.ModuleBuild libtirpc ] ++ (with ocamlPackages; [ ocamlbuild ocaml_libvirt gettext-stub ounit ]) - ++ lib.optional javaSupport jdk; + ++ lib.optional javaSupport jdk; prePatch = '' # build-time scripts @@ -95,7 +153,7 @@ stdenv.mkDerivation rec { description = "Tools for accessing and modifying virtual machine disk images"; license = with licenses; [ gpl2Plus lgpl21Plus ]; homepage = "https://libguestfs.org/"; - maintainers = with maintainers; [offline]; + maintainers = with maintainers; [ offline ]; platforms = platforms.linux; # this is to avoid "output size exceeded" hydraPlatforms = if appliance != null then appliance.meta.hydraPlatforms else platforms.linux; From a567b45ef61810966ab4b71006b72835dd0fd969 Mon Sep 17 00:00:00 2001 From: Tom Wieczorek Date: Sat, 6 Aug 2022 10:50:50 +0200 Subject: [PATCH 2/2] libguestfs: 1.48.0 -> 1.48.4 * Fix Perl dependencies, so that the Perl bindings will be built * Move OCaml bindings into the proper place, so they can be picked up --- pkgs/development/libraries/libguestfs/default.nix | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libguestfs/default.nix b/pkgs/development/libraries/libguestfs/default.nix index 4c4ba888e669..e2da1a30ff14 100644 --- a/pkgs/development/libraries/libguestfs/default.nix +++ b/pkgs/development/libraries/libguestfs/default.nix @@ -36,19 +36,18 @@ , libtirpc , appliance ? null , javaSupport ? false -, jdk ? null +, jdk }: assert appliance == null || lib.isDerivation appliance; -assert javaSupport -> jdk != null; stdenv.mkDerivation rec { pname = "libguestfs"; - version = "1.48.0"; + version = "1.48.4"; src = fetchurl { url = "https://libguestfs.org/download/${lib.versions.majorMinor version}-stable/${pname}-${version}.tar.gz"; - sha256 = "sha256-FoH93t/PSEym3uxUIwMwoy3vvTDCqx+BeI4lLLXQSCk="; + sha256 = "sha256-ncIrbFpF8ZwsupEaN7Oo2G9idEUhsQ61PD05B+UIAxI="; }; strictDeps = true; @@ -63,7 +62,7 @@ stdenv.mkDerivation rec { makeWrapper pkg-config qemu - ] ++ (with perlPackages; [ perl libintl-perl GetoptLong SysVirt ]) + ] ++ (with perlPackages; [ perl libintl-perl GetoptLong ModuleBuild ]) ++ (with ocamlPackages; [ ocaml findlib ]); buildInputs = [ ncurses @@ -112,10 +111,14 @@ stdenv.mkDerivation rec { patches = [ ./libguestfs-syms.patch ]; + + createFindlibDestdir = true; + installFlags = [ "REALLY_INSTALL=yes" ]; enableParallelBuilding = true; postInstall = '' + mv "$out/lib/ocaml/guestfs" "$OCAMLFIND_DESTDIR/guestfs" for bin in $out/bin/*; do wrapProgram "$bin" \ --prefix PATH : "$out/bin:${hivex}/bin:${qemu}/bin" \