[PATCH] Add lz4json

DoneSubmitted by Baptiste Strazzulla.
Details
2 participants
  • Baptiste Strazzulla
  • Nicolas Goaziou
Owner
unassigned
Severity
normal
B
B
Baptiste Strazzulla wrote on 21 Nov 2021 20:55
(name . guix-patches@gnu.org)(address . guix-patches@gnu.org)
PA4PR03MB7101460B8ABA8E1330BF86F2B99E9@PA4PR03MB7101.eurprd03.prod.outlook.com
Hello,

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?

Kind regards,
Baptiste
Attachment: file
From 8307da6cad6b9604f368eb2165c79906b9f9c0fd Mon Sep 17 00:00:00 2001
From: Zzull <bstrazzull@hotmail.fr>
Date: Sun, 21 Nov 2021 20:19:44 +0100
Subject: [PATCH] gnu: Add lz4json

* gnu/packages/gnuzilla.scm
---
gnu/packages/gnuzilla.scm | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)

Toggle diff (47 lines)
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 9edfcaa2ab..029a1be480 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -1992,3 +1992,40 @@ (define-public firefox-decrypt
     (description "Firefox Decrypt is a tool to extract passwords from
 Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
     (license license:gpl3+)))
+
+(define-public lz4json
+  (package
+    (name "lz4json")
+    (version "2")
+    (home-page "https://github.com/andikleen/lz4json")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference (url home-page) (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1xxn8yzr6j8j6prmbj6mxspdczigarfiv3vlm9k70yxmky65ijh3"))))
+    (build-system gnu-build-system)
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (inputs `(("lz4" ,lz4)))
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'check)
+         (replace 'install
+           (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)))
+       #:make-flags '("CC=gcc")))
+    (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.")
+    (license license:gpl3+)))
-- 
2.33.1
N
N
Nicolas Goaziou wrote on 21 Nov 2021 21:27
(name . Baptiste Strazzulla)(address . bstrazzull@hotmail.fr)(address . 52027@debbugs.gnu.org)
87tug5uudr.fsf@nicolasgoaziou.fr
Hello,

Baptiste Strazzulla <bstrazzull@hotmail.fr> writes:

Toggle quote (7 lines)
> 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


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

This should be moved right before the synopsis field.

Toggle quote (6 lines)
> + (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.

Toggle quote (7 lines)
> + (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.

Toggle quote (8 lines)
> + (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.

Toggle quote (2 lines)
> + #:make-flags '("CC=gcc")))

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

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

instead.

Toggle quote (6 lines)
> + (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…

Toggle quote (2 lines)
> + (license license:gpl3+)))

This should be license:bsd-2.

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

Regards,
--
Nicolas Goaziou
B
B
Baptiste Strazzulla wrote on 21 Nov 2021 22:54
[bug#52027] [PATCH] Add lz4json
(name . 52027@debbugs.gnu.org)(address . 52027@debbugs.gnu.org)
PA4PR03MB710147BABD7D9CA9241A3CE1B99E9@PA4PR03MB7101.eurprd03.prod.outlook.com
Here is the revised version.

Regards again
Attachment: file
From db07a9915dc6237f057939c1877511e3f8e1fd02 Mon Sep 17 00:00:00 2001
From: Zzull <bstrazzull@hotmail.fr>
Date: Sun, 21 Nov 2021 22:43:15 +0100
Subject: [PATCH] gnu: Add lz4json

* gnu/packages/gnuzilla.scm (lz4json)
New variable
---
gnu/packages/gnuzilla.scm | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm
index 9edfcaa2ab..efd031f90d 100644
--- a/gnu/packages/gnuzilla.scm
+++ b/gnu/packages/gnuzilla.scm
@@ -1992,3 +1992,41 @@ (define-public firefox-decrypt
     (description "Firefox Decrypt is a tool to extract passwords from
 Mozilla (Firefox, Waterfox, Thunderbird, SeaMonkey) profiles.")
     (license license:gpl3+)))
+
+(define-public lz4json
+  (package
+    (name "lz4json")
+    (version "2")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/andikleen/lz4json")
+         (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1xxn8yzr6j8j6prmbj6mxspdczigarfiv3vlm9k70yxmky65ijh3"))))
+    (build-system gnu-build-system)
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (inputs `(("lz4" ,lz4)))
+    (arguments
+     `(#:tests? #f                              ; no check target
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)                    ; no configure script
+         (replace 'install                      ; no install target
+           (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)))))
+       #:make-flags `(,(string-append "CC=" ,(cc-for-target)))))
+    (home-page "https://github.com/andikleen/lz4json")
+    (synopsis "C decompress tool for mozilla lz4json format")
+    (description
+     "@code{lz4json} is 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.")
+    (license license:bsd-2)))
-- 
2.33.1
N
N
Nicolas Goaziou wrote on 22 Nov 2021 11:24
(name . Baptiste Strazzulla)(address . bstrazzull@hotmail.fr)(address . 52027-done@debbugs.gnu.org)
87v90ktrm0.fsf@nicolasgoaziou.fr
Hello,

Baptiste Strazzulla <bstrazzull@hotmail.fr> writes:

Toggle quote (2 lines)
> Here is the revised version.

Thank you. I added a copyright line for you in gnuzilla.scm and applied
your patch, with the minor tweaks below.

Toggle quote (2 lines)
> Subject: [PATCH] gnu: Add lz4json

I added a final full stop to the line.

Toggle quote (3 lines)
> * gnu/packages/gnuzilla.scm (lz4json)
> New variable

I wrote:

* gnu/packages/gnuzilla.scm (lz4json): New variable.

Regards,
--
Nicolas Goaziou
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 52027@debbugs.gnu.org