Subject: [bug#52027] [PATCH] Add lz4json

From: Nicolas Goaziou <[email-masked]>
Date: Sun, 21 Nov 2021 21:27:28 +0100

Hello,

Baptiste Strazzulla <[email-masked]> writes:

> I couldn't figure out a license for this package. It says " *
> Copyright (c) 2014 Intel Corporation" in the source. I don't even know
> if it's an actual license.
> In any case, it doesn't seem really
> engaging and there's no mention of it in `licenses.scm`… How shall
> I proceed?

The license is below, in the lz4jsoncat.c header. It's bsd-2

> +(define-public lz4json
> +  (package
> +    (name "lz4json")
> +    (version "2")
> +    (home-page "https://github.com/andikleen/lz4json")

This should be moved right before the synopsis field.

> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri
> +        (git-reference (url home-page) (commit (string-append "v" version))))

(url ...) should provide the github URL and not re-use the home-page.
Also there should be newline characters before and after the url field.

> +    (arguments
> +     '(#:phases
> +       (modify-phases %standard-phases
> +         (delete 'configure)
> +         (delete 'check)
> +         (replace 'install

Could you add comment explaining why 'configure' is deleted (probably
because there is no configure script) and 'install' is replaced
(probably because upstream provides no install script either).

Instead of deleting `check', you should use:

  #:tests? #false

instead.

> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin"))
> +                    (man (string-append out "/share/man/man1")))
> +               (install-file "lz4jsoncat" bin)
> +               (install-file "lz4jsoncat.1" man))
> +             #t)))

You can remove the trailing boolean at the end of the phase.

> +       #:make-flags '("CC=gcc")))

The above is not cross-compilation friendly. It should become

  `(,(string-append "CC=" (cc-for-target)))

instead.

> +    (synopsis "C decompress tool for mozilla lz4json format")
> +    (description
> +     "A little utility to unpack lz4json files as generated by Firefox's
> +bookmark backups and session restore.  This is a different format from what
> +the normal lz4 utility expects.  The data is dumped to stdout.")

The description should consist of full sentences. So it may start as

  @code{lz4json} is a little utility to unpack lz4json files…

> +    (license license:gpl3+)))

This should be license:bsd-2.

Thanks for your work. Could you send an updated patch?

Regards,
-- 
Nicolas Goaziou