Subject: Re: bug#73260: Add libguestfs

From: Ludovic Courtès <[email-masked]>
Date: Mon, 30 Sep 2024 19:03:59 +0200

Hi,

Giacomo Leidi <[email-masked]> skribis:

> * gnu/packages/virtualization.scm (hivex): New variable.
>
> Change-Id: I9828d267d5c6f24dc5039ea3b1849248cd9d23fb

[...]

> +      #:configure-flags
> +      #~(list
> +         "--disable-static"
> +         "--with-readline"
> +         "--disable-rpath")

Please keep it on one line.

> +      #~(modify-phases %standard-phases
> +          (replace 'bootstrap
> +            (lambda _
> +              (invoke "autoreconf" "-vif")))

I expect this to be unnecessary: isn’t that equivalent to the default
‘bootstrap’ phase?

> +          (add-before 'install 'set-rpath
> +            (lambda _
> +              (for-each
> +               (lambda (sofile)
> +                 ;; The ‘validate-runpath’ phase fails to find libhivex.so.0.
> +                 (invoke (string-append #$(this-package-native-input "patchelf")
> +                                        "/bin/patchelf")
> +                         "--add-rpath" (string-append #$output "/lib") sofile))
> +               '("perl/blib/arch/auto/Win/Hivex/Hivex.so"
> +                 "ruby/ext/hivex/_hivex.so"))))

As a rule of thumb, when building from source, better arrange to pass
the right ‘-Wl,-rpath=…’ flags to the compiler than resorting to
PatchELF (PatchELF is useful when dealing with prebuilt binaries).

In this case, could you tweak the build system to pass
‘-Wl,-rpath=(string-append #$output "/lib")’ when building these two
shared libraries?

> +    (license license:lgpl2.1)))

Please double-check whether it’s really explicitly “v2.1-only”.  By
default, it’s “or any later version”, meaning ‘lgpl2.1+’.

Thanks,
Ludo’.