Subject: [bug#50369] [PATCH] gnu: Add video-contact-sheet

From: Leo Famulari <[email-masked]>
Date: Fri, 17 Dec 2021 10:24:07 -0500

On Sat, Sep 04, 2021 at 11:52:57AM +0200, Pradana Adrinusa AUMARS via Guix-patches via wrote:
> From 9851db2b3036ee3d5e8ef85ed8bae2f6398702e0 Mon Sep 17 00:00:00 2001
> From: Pradana AUMARS <[email-masked]>
> Date: Fri, 18 Jun 2021 16:13:07 +0200
> Subject: [PATCH] gnu: Add video-contact-sheet

Thank you for packaging this very useful program! And sorry for the long
delay in reviewing your contribution.

I've pushed your patch as commit
61ae42e773526373f0dc3ca99c7251d20434d3d1 with the following changes:

> +            (uri (string-append "http://p.outlyer.net/files/vcs/-" version
> +				".tar.gz"))

This URL was incorrect. This can happen when you first download the
source code with `guix download`. Since you will already have the
tarball in /gnu/store, Guix will not try to download it again based on
the package definition, and you won't notice that the URL is wrong.

For that reason, when making new packages I suggest downloading the
tarball in another way and then using `guix hash` to get the hash, or
using `guix build --source video-contact-sheet --check`.

> +   (arguments
> +    `(#:phases (modify-phases %standard-phases
> +                              (delete 'configure)
> +                              (delete 'build)
> +                              (delete 'check))
> +      #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))))
> +   (inputs
> +    `(("bash" ,bash)
> +      ("ffmpeg" ,ffmpeg)
> +      ("imagemagick" ,imagemagick)))

I added a "wrap-program" phase to ensure that the built package will
retain its dependencies on ffmpeg and imagemagick. Without this, it did
not keep any "references" to those packages, and so they would not be
made available when installing video-contact-sheet.

You can check these references like this:

$ guix gc --references $(guix build video-contact-sheet)
/gnu/store/czv41lxhgrmmvbabrqhshxjaj1z3qgvq-ffmpeg-4.4.1
/gnu/store/frs0cv3f6r8frqan91wlm05hm6iwlyn1-bash-minimal-5.1.8
/gnu/store/ph6ikrlflwp240cw9r0sp9zwri9x44sz-imagemagick-6.9.12-4
/gnu/store/rjqgadyzrxdhpr00kwybwyyi7pw7sc1l-video-contact-sheet-1.13.4

I also changed the bash dependency to bash-minimal, which is more
suitable for non-interactive use.

I partially updated the package to the new style described here:

https://guix.gnu.org/en/blog/2021/the-big-change/

> +   (synopsis "Bash script to create contact sheets (preview images) from videos")
> +   (description "This is a bash script meant to create video contact sheets (previews) of videos. 
> Any video supported by mplayer and ffmpeg can be used. A note of warning: Unlike most similar tools it, 
> by default, makes screenshots the same size as the video, see the manual for details on how to change 
> this.")

In a follow-up commit, I tweaked the synopsis and description a little
bit. I meant to do this in the same commit but forgot to include these
changes.

> +   (license license:lgpl3)))

Finally, I changed the license to lgpl2.1+, since that is what is
specified in the `vcs` shell script.

Thanks again for this patch!