From 36b4d9dbb8f37a0a047c0e6255b95e629699f2ee Mon Sep 17 00:00:00 2001 From: lukts30 Date: Thu, 17 Oct 2024 20:10:35 +0200 Subject: [PATCH] libguestfs: 1.50.1 -> 1.54.0 --- ...ss-CFLAGS-through-extra_linker_flags.patch | 17 +++ pkgs/by-name/li/libguestfs/package.nix | 114 ++++++++---------- 2 files changed, 67 insertions(+), 64 deletions(-) create mode 100644 pkgs/by-name/li/libguestfs/Revert-perl-Pass-CFLAGS-through-extra_linker_flags.patch diff --git a/pkgs/by-name/li/libguestfs/Revert-perl-Pass-CFLAGS-through-extra_linker_flags.patch b/pkgs/by-name/li/libguestfs/Revert-perl-Pass-CFLAGS-through-extra_linker_flags.patch new file mode 100644 index 000000000000..59a0a61a177b --- /dev/null +++ b/pkgs/by-name/li/libguestfs/Revert-perl-Pass-CFLAGS-through-extra_linker_flags.patch @@ -0,0 +1,17 @@ +Subject: [PATCH] Revert "perl: Pass @CFLAGS@ through extra_linker_flags" + +This reverts commit be06cb048b595200bf7d1cec9684ab7958188b97. +--- +--- a/perl/Build.PL.in ++++ b/perl/Build.PL.in +@@ -65,8 +65,6 @@ my $build = Module::Build->new ( + '@top_srcdir@/include', + ], + extra_linker_flags => [ +- '-DGUESTFS_PRIVATE=1', +- split (' ', '@CFLAGS@'), + '-L@top_builddir@/lib/.libs', + '-lguestfs', + ], +-- +2.44.1 diff --git a/pkgs/by-name/li/libguestfs/package.nix b/pkgs/by-name/li/libguestfs/package.nix index ae369c1d314a..78fc77e24737 100644 --- a/pkgs/by-name/li/libguestfs/package.nix +++ b/pkgs/by-name/li/libguestfs/package.nix @@ -35,7 +35,7 @@ jansson, getopt, perlPackages, - ocaml-ng, + ocamlPackages, libtirpc, appliance ? null, javaSupport ? false, @@ -45,17 +45,14 @@ assert appliance == null || lib.isDerivation appliance; -let - # GetoptLong not avaible with newer ocaml - ocamlPackages' = ocaml-ng.ocamlPackages_4_14; -in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "libguestfs"; - version = "1.50.1"; + + version = "1.54.0"; src = fetchurl { - url = "https://libguestfs.org/download/${lib.versions.majorMinor version}-stable/${pname}-${version}.tar.gz"; - sha256 = "sha256-Xmhx6I+C5SHjHUQt5qELZJcCN8t5VumdEXsSO1hWWm8="; + url = "https://libguestfs.org/download/${lib.versions.majorMinor finalAttrs.version}-stable/${finalAttrs.pname}-${finalAttrs.version}.tar.gz"; + sha256 = "sha256-tK+g+P1YAgXqVUjUaLxuQ8O+y5leL2DmMmVSemMFQkY="; }; strictDeps = true; @@ -80,58 +77,43 @@ stdenv.mkDerivation rec { GetoptLong ModuleBuild ]) - ++ (with ocamlPackages'; [ + ++ (with ocamlPackages; [ ocaml findlib ]); - buildInputs = - [ - libxcrypt - ncurses - jansson - pcre2 - augeas - libxml2 - acl - libcap - libcap_ng - libconfig - systemdLibs - fuse - yajl - libvirt - gmp - readline - file - hivex - db - numactl - libapparmor - perlPackages.ModuleBuild - libtirpc - ] - ++ (with ocamlPackages'; [ - ocamlbuild - ocaml_libvirt - gettext-stub - ounit - ]) - ++ [ - ocamlPackages'.augeas - (hivex.override { ocamlPackages = ocamlPackages'; }) - ] - ++ lib.optional javaSupport jdk; + buildInputs = [ + libxcrypt + ncurses + jansson + pcre2 + augeas + libxml2 + acl + libcap + libcap_ng + libconfig + systemdLibs + fuse + yajl + libvirt + gmp + readline + file + hivex + db + numactl + libapparmor + perlPackages.ModuleBuild + libtirpc + zstd + ocamlPackages.ocamlbuild + ocamlPackages.ocaml_libvirt + ocamlPackages.ounit + ocamlPackages.augeas + ocamlPackages.ocamlbuild + ] ++ lib.optional javaSupport jdk; prePatch = '' - # build-time scripts - substituteInPlace run.in --replace '#!/bin/bash' '#!${stdenv.shell}' - substituteInPlace ocaml-link.sh.in --replace '#!/bin/bash' '#!${stdenv.shell}' - - # $(OCAMLLIB) is read-only "${ocamlPackages'.ocaml}/lib/ocaml" - substituteInPlace ocaml/Makefile.am --replace '$(DESTDIR)$(OCAMLLIB)' '$(out)/lib/ocaml' - substituteInPlace ocaml/Makefile.in --replace '$(DESTDIR)$(OCAMLLIB)' '$(out)/lib/ocaml' - - # some scripts hardcore /usr/bin/env which is not available in the build env patchShebangs . ''; configureFlags = [ @@ -139,13 +121,17 @@ stdenv.mkDerivation rec { "--enable-install-daemon" "--disable-appliance" "--with-distro=NixOS" - "--disable-perl" # build broken since 1.53.x "--with-readline" "CPPFLAGS=-I${lib.getDev libxml2}/include/libxml2" "INSTALL_OCAMLLIB=${placeholder "out"}/lib/ocaml" "--with-guestfs-path=${placeholder "out"}/lib/guestfs" ] ++ lib.optionals (!javaSupport) [ "--without-java" ]; - patches = [ ./libguestfs-syms.patch ]; + + patches = [ + ./libguestfs-syms.patch + # Fixes PERL Sys-Guestfs build failure + ./Revert-perl-Pass-CFLAGS-through-extra_linker_flags.patch + ]; createFindlibDestdir = true; @@ -197,19 +183,19 @@ stdenv.mkDerivation rec { runHook postInstallCheck ''; - meta = with lib; { + meta = { description = "Tools for accessing and modifying virtual machine disk images"; - license = with licenses; [ + license = with lib.licenses; [ gpl2Plus lgpl21Plus ]; homepage = "https://libguestfs.org/"; - maintainers = with maintainers; [ + maintainers = with lib.maintainers; [ offline lukts30 ]; - platforms = platforms.linux; + platforms = lib.platforms.linux; # this is to avoid "output size exceeded" - hydraPlatforms = if appliance != null then appliance.meta.hydraPlatforms else platforms.linux; + hydraPlatforms = if appliance != null then appliance.meta.hydraPlatforms else lib.platforms.linux; }; -} +})