[PATCH] gnu: Add pngcheck.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Artyom V. Poptsov
Owner
unassigned
Submitted by
Artyom V. Poptsov
Severity
normal

Debbugs page

Artyom V. Poptsov wrote 2 years ago
(address . guix-patches@gnu.org)
87h6sphhc6.fsf@gmail.com
Hello,

this patch adds "pngcheck":
From 3b672b4a728c950c861770ab0b5498730435da5b Mon Sep 17 00:00:00 2001
Message-Id: <3b672b4a728c950c861770ab0b5498730435da5b.1683369521.git.poptsov.artyom@gmail.com>
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sat, 6 May 2023 13:34:30 +0300
Subject: [PATCH] gnu: Add pngcheck.

* gnu/packages/image.scm (pngcheck): New variable.
---
gnu/packages/image.scm | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)

Toggle diff (62 lines)
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 2485bbb943..058afa1f39 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -37,6 +37,7 @@
;;; Copyright © 2022-2023 Bruno Victal <mirai@makinata.eu>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2023 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2023 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -322,6 +323,45 @@ (define-public pngcrush
images. It can further losslessly compress them by as much as 40%.")
(license license:zlib)))
+(define-public pngcheck
+ (package
+ (name "pngcheck")
+ (version "3.0.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://www.libpng.org/pub/png/src/pngcheck-" version
+ ".tar.gz"))
+ (sha256
+ (base32
+ "1rny14v57d2zvnqcqbh3m87mkya22qr2394fg7vm3xsacf8l8sn3"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:tests? #f ;no check target
+ #:phases (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke "make" "-f" "Makefile.unx")))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin/")))
+ (install-file "pngcheck" bin)))))))
+ (inputs (list zlib))
+ (home-page "http://www.libpng.org/pub/png/apps/pngcheck.html")
+ (synopsis "Print info and check PNG, JNG and MNG files")
+ (description
+ "@code{pngcheck} verifies the integrity of PNG, JNG and MNG files (by
+checking the internal 32-bit CRCs, a.k.a. checksums, and decompressing the image
+data); it can optionally dump almost all of the chunk-level information in the image
+in human-readable form. For example, it can be used to print the basic statistics
+about an image (dimensions, bit depth, etc.); to list the color and transparency info
+in its palette (assuming it has one); or to extract the embedded text annotations.
+This is a command-line program with batch capabilities (e.g. @code{pngcheck
+*.png}.)")
+ (license license:expat)))
+
(define-public pnglite
(let ((commit "11695c56f7d7db806920bd9229b69f230e6ffb38")
(revision "1"))

base-commit: 64086a4fa449a9f6d2f835fcdf5498222b309e3a
--
2.34.1
Thanks,

- Artyom

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQFNBAEBCgA3FiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmRWLvkZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRDpxaLZCJigL1duCACpJ9cvtjmBzN4OhOvISpUc
UBrd32zw4Cm2vqiPMzw5WyPoZ4orziBUQDmMLRsV8JQgmD5zx4vfkRuu0q0TFo3A
1cepzohgY37lUzdAH9nHtU7grfuGTZz9jk0wemwMDw3Ciwc3DvfIxNIHETtN9v3a
07zo95ndvUxudKzDLbBQyJj1qA1DjIs1MtKjZIIfkxvHkaqVOSwiyLZKnm//r3Pd
RsEGEvKSpP25vOlqpbYhddgM8RjDAESvPwloeOELAfQ497Djn3ApKVpUc7liGc5V
ajmOLs5KfsRDpa2SBfbvRMD3+ykD9yU3d+51sx9y4nET9mbVhoECub/AWkyU1yhY
=ZVBx
-----END PGP SIGNATURE-----

Artyom V. Poptsov wrote 2 years ago
(address . guix-patches@gnu.org)
87cz3dhbys.fsf@gmail.com
I found some inconsistencies in my patch so here's the fixed version.
From 139f4ae8e39ece3c8dc9aec009149bdff81d0589 Mon Sep 17 00:00:00 2001
Message-Id: <139f4ae8e39ece3c8dc9aec009149bdff81d0589.1683376614.git.poptsov.artyom@gmail.com>
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Sat, 6 May 2023 13:34:30 +0300
Subject: [PATCH] gnu: Add pngcheck.

* gnu/packages/image.scm (pngcheck): New variable.
---
gnu/packages/image.scm | 57 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)

Toggle diff (79 lines)
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 2485bbb943..dfe885a0d9 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -37,6 +37,7 @@
;;; Copyright © 2022-2023 Bruno Victal <mirai@makinata.eu>
;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2023 Nicolas Goaziou <mail@nicolasgoaziou.fr>
+;;; Copyright © 2023 Artyom V. Poptsov <poptsov.artyom@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -322,6 +323,62 @@ (define-public pngcrush
images. It can further losslessly compress them by as much as 40%.")
(license license:zlib)))
+(define-public pngcheck
+ (package
+ (name "pngcheck")
+ (version "3.0.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "http://www.libpng.org/pub/png/src/pngcheck-" version
+ ".tar.gz"))
+ (sha256
+ (base32
+ "1rny14v57d2zvnqcqbh3m87mkya22qr2394fg7vm3xsacf8l8sn3"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:tests? #f ;no check target
+ #:phases (modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'build
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke "make" "-f" "Makefile.unx")))
+ (add-after 'build 'compress-man-pages
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (invoke "gzip" "pngcheck.1")
+ (invoke "gzip" "gpl/pngsplit.1")
+ (invoke "gzip" "gpl/png-fix-IDAT-windowsize.1")))
+ (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 "pngcheck" bin)
+ (install-file "pngcheck.1.gz" man)
+ (install-file "pngsplit" bin)
+ (install-file "gpl/pngsplit.1.gz" man)
+ (install-file "png-fix-IDAT-windowsize" bin)
+ (install-file "gpl/png-fix-IDAT-windowsize.1.gz" man)))))))
+ (inputs (list zlib))
+ (home-page "http://www.libpng.org/pub/png/apps/pngcheck.html")
+ (synopsis "Print info and check PNG, JNG and MNG files")
+ (description
+ "@code{pngcheck} verifies the integrity of PNG, JNG and MNG files (by
+checking the internal 32-bit CRCs, a.k.a. checksums, and decompressing the image
+data); it can optionally dump almost all of the chunk-level information in the image
+in human-readable form. For example, it can be used to print the basic statistics
+about an image (dimensions, bit depth, etc.); to list the color and transparency info
+in its palette (assuming it has one); or to extract the embedded text annotations.
+This is a command-line program with batch capabilities (e.g. @code{pngcheck
+*.png}.)
+
+Also includes @code{pngsplit} which can split a PNG, MNG or JNG file into individual,
+numbered chunks, and @code{png-fix-IDAT-windowsize} that allow to reset first IDAT's
+zlib window-size bytes and fix up CRC to match.")
+ ;; "pngsplit" and "png-fix-IDAT-windowsize" are licensed under the terms of
+ ;; GNU GPL2+. See "gpl/COPYING" in the repository."
+ (license (list license:x11 license:gpl2+))))
+
(define-public pnglite
(let ((commit "11695c56f7d7db806920bd9229b69f230e6ffb38")
(revision "1"))

base-commit: 64086a4fa449a9f6d2f835fcdf5498222b309e3a
--
2.34.1
Changes:
- It seems that "pngcheck" has X11 license, according to FSF:
So I've added "license:gpl2+" to the package licenses.
- I've updated the patch to install "pngsplit" and
"png-fix-IDAT-windowsize" binaries as well.
- Now MAN pages for all three programs are installed too.

Thanks,

- Artyom

--
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE B57C E9C5 A2D9 0898 A02F
-----BEGIN PGP SIGNATURE-----

iQFNBAEBCgA3FiEE0MLqwTMQgi2Y3rV86cWi2QiYoC8FAmRWSisZHHBvcHRzb3Yu
YXJ0eW9tQGdtYWlsLmNvbQAKCRDpxaLZCJigL9qCB/4+DalPFzlX4oIC2DQ1yot6
VnQTaBU8IwupIXRHan+hBf+HufBgPNgStDB3MPA4RIxAjgm0yEkSGhw+xQ6h/OS4
Zfd27Wd7kavQejI2uuHWVShU2TndCSVOAm19uhmPznfatsLdAg90q4IAEsCi9aKZ
gy2+9iFaxkIVnf+jO4/IfJB9GSUeBagS+/C0qSCIHfaj/ulqRGt5bv59PyYsDZUb
8lecLkq5Sis6tvNKJ5tsX3kwXkwDV9B2bZmQO8Bk882OOe0rgyebOWPVu6iShylo
7T7Fo5TJUBEa8vUQJK7GtVBrsc9UwGU3Iz2mMHshUVdK67g45UeXxs91ObfOX5lS
=u5cJ
-----END PGP SIGNATURE-----

Ludovic Courtès wrote 2 years ago
Re: bug#63326: [PATCH] gnu: Add pngcheck.
(name . Artyom V. Poptsov)(address . poptsov.artyom@gmail.com)(address . 63326-done@debbugs.gnu.org)
878rclrbdp.fsf_-_@gnu.org
Hi,

"Artyom V. Poptsov" <poptsov.artyom@gmail.com> skribis:

Toggle quote (8 lines)
> From 139f4ae8e39ece3c8dc9aec009149bdff81d0589 Mon Sep 17 00:00:00 2001
> Message-Id: <139f4ae8e39ece3c8dc9aec009149bdff81d0589.1683376614.git.poptsov.artyom@gmail.com>
> From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
> Date: Sat, 6 May 2023 13:34:30 +0300
> Subject: [PATCH] gnu: Add pngcheck.
>
> * gnu/packages/image.scm (pngcheck): New variable.

Applied, thanks!
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 63326
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help