Subject: Re: bug#56803: [PATCH 0/6] Add hydrus network and its dependencies

From: Ludovic Courtès <[email-masked]>
Date: Tue, 09 Aug 2022 17:09:56 +0200

Hi Tomasz,

Tomasz Jeneralczyk <[email-masked]> skribis:

> Hydrus-network has a weekly release cycle and is meant to be used from its own
> directory so I artificially spread it out to comply with guix's expectations.
>
> Three binaries from inputs are copied into a directory hydrus knows about:
>   * ffmpeg - works as expected
>   * swftools - does not do anything neither on guix or Arch linux - possibly
>   an unfinished feature, but I left it in, in case it gets fixed in a future version.
>   * miniupnpc - times out on my system, but it should work otherwise.
>
> I was not able to build the program's help files. Updating
> python-pymdown-extensions to its latest version might be the solution, but
> this would require also packaging its new build system that is not present in
> guix yet. I decided to cut short there.

Perhaps these comments, or some of them, should go as comments in the
source?  That will prove helpful next time you or someone else tries to
work on the package.

> +      (with-imported-modules '((guix build utils))

This is unnecessary as (guix build utils) is always present on the build
side.

> +              (replace 'install
> +                (lambda* (#:key outputs inputs #:allow-other-keys)
> +                  (let* ((out (assoc-ref outputs "out"))
> +                         (python (assoc-ref inputs "python"))
> +                         (client-path (string-append out "/bin/hydrus"))
> +                         (server-path (string-append out "/bin/hydrus-server")))

Nitpick: GNU and Guix convention is to use the term “path” to denote a
search path (like $PATH, etc.) and to use “file name” (or “file”) to
denote a file name, as is the case here.

In this case it might be enough to write ‘client’ instead of
‘client-path’, and similarly for ‘server-path’.

> +              ;; Hydrus searches for some binaries at bin-dir so it's important
> +              ;; to put them there so it can find and use them.

In general, the solution here, rather than copy files like the ‘ffmpeg’
executable, would be to patch Hydrus so that it contains the absolute
file name of ‘ffmpeg’ as returned by (search-input-file inputs "/bin/ffmpeg").

How does that sound?

Thanks,
Ludo’.