unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add optipng.
@ 2016-09-25  1:58 Arun Isaac
  2016-09-25  7:25 ` Arun Isaac
  0 siblings, 1 reply; 11+ messages in thread
From: Arun Isaac @ 2016-09-25  1:58 UTC (permalink / raw)
  To: guix-devel

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

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 931cad1..b998f45 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -932,3 +932,35 @@ statistical tests.")
 all included libraries only the image loading and decoding library is
 installed as @code{stb_image}.")
       (license license:public-domain))))
+
+(define-public optipng
+  (package
+    (name "optipng")
+    (version "0.7.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "105yk5qykvhiahzag67gm36s2kplxf6qn5hay02md0nkrcgn6w28"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("zlib" ,zlib)))
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         ;; configure script does not accept arguments CONFIG_SHELL and SHELL
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (zero? (system* "sh" "configure"
+                             (string-append "--prefix=" (assoc-ref outputs "out")))))))))
+    (synopsis "Optimizer that recompresses PNG image files to a
+smaller size")
+    (description "OptiPNG is a PNG optimizer that recompresses image
+files to a smaller size, without losing any information.  This program
+also converts external formats (BMP, GIF, PNM and TIFF) to optimized
+PNG, and performs PNG integrity checks and corrections.")
+    (home-page "http://optipng.sourceforge.net/")
+    (license license:zlib)))
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add optipng.
  2016-09-25  1:58 [PATCH] gnu: Add optipng Arun Isaac
@ 2016-09-25  7:25 ` Arun Isaac
  2016-09-25 16:20   ` Kei Kebreau
  0 siblings, 1 reply; 11+ messages in thread
From: Arun Isaac @ 2016-09-25  7:25 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 180 bytes --]


I just noticed that I forgot to add the copyright header. If someone
reviews the patch and everything else is fine, I'll send an updated
patch with the copyright header.

Thanks.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add optipng.
  2016-09-25  7:25 ` Arun Isaac
@ 2016-09-25 16:20   ` Kei Kebreau
  2016-09-25 16:52     ` Leo Famulari
  2016-09-25 20:28     ` Arun Isaac
  0 siblings, 2 replies; 11+ messages in thread
From: Kei Kebreau @ 2016-09-25 16:20 UTC (permalink / raw)
  To: Arun Isaac; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 278 bytes --]

Arun Isaac <arunisaac@systemreboot.net> writes:

> I just noticed that I forgot to add the copyright header. If someone
> reviews the patch and everything else is fine, I'll send an updated
> patch with the copyright header.
>
> Thanks.

Everything looks and works fine for me.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add optipng.
  2016-09-25 16:20   ` Kei Kebreau
@ 2016-09-25 16:52     ` Leo Famulari
  2016-09-25 20:28     ` Arun Isaac
  1 sibling, 0 replies; 11+ messages in thread
From: Leo Famulari @ 2016-09-25 16:52 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: guix-devel

On Sun, Sep 25, 2016 at 12:20:40PM -0400, Kei Kebreau wrote:
> Arun Isaac <arunisaac@systemreboot.net> writes:
> 
> > I just noticed that I forgot to add the copyright header. If someone
> > reviews the patch and everything else is fine, I'll send an updated
> > patch with the copyright header.
> >
> > Thanks.
> 
> Everything looks and works fine for me.

LGTM assuming that `guix lint` does not complain about anything :)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add optipng.
  2016-09-25 16:20   ` Kei Kebreau
  2016-09-25 16:52     ` Leo Famulari
@ 2016-09-25 20:28     ` Arun Isaac
  2016-09-25 20:28       ` Arun Isaac
  1 sibling, 1 reply; 11+ messages in thread
From: Arun Isaac @ 2016-09-25 20:28 UTC (permalink / raw)
  To: guix-devel


`guix lint` reports no issues on my side. Somebody should probably check it on
their machine anyway. I am sending an updated patch with the copyright header
included.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH] gnu: Add optipng.
  2016-09-25 20:28     ` Arun Isaac
@ 2016-09-25 20:28       ` Arun Isaac
  2016-09-25 21:03         ` Kei Kebreau
  0 siblings, 1 reply; 11+ messages in thread
From: Arun Isaac @ 2016-09-25 20:28 UTC (permalink / raw)
  To: guix-devel

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

diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 931cad1..4039c1a 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -10,6 +10,7 @@
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -932,3 +933,35 @@ statistical tests.")
 all included libraries only the image loading and decoding library is
 installed as @code{stb_image}.")
       (license license:public-domain))))
+
+(define-public optipng
+  (package
+    (name "optipng")
+    (version "0.7.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
+                           version ".tar.gz"))
+       (sha256
+        (base32
+         "105yk5qykvhiahzag67gm36s2kplxf6qn5hay02md0nkrcgn6w28"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("zlib" ,zlib)))
+    (arguments
+     '(#:phases
+       (modify-phases %standard-phases
+         ;; configure script does not accept arguments CONFIG_SHELL and SHELL
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (zero? (system* "sh" "configure"
+                             (string-append "--prefix=" (assoc-ref outputs "out")))))))))
+    (synopsis "Optimizer that recompresses PNG image files to a
+smaller size")
+    (description "OptiPNG is a PNG optimizer that recompresses image
+files to a smaller size, without losing any information.  This program
+also converts external formats (BMP, GIF, PNM and TIFF) to optimized
+PNG, and performs PNG integrity checks and corrections.")
+    (home-page "http://optipng.sourceforge.net/")
+    (license license:zlib)))
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add optipng.
  2016-09-25 20:28       ` Arun Isaac
@ 2016-09-25 21:03         ` Kei Kebreau
  2016-09-26 17:59           ` Leo Famulari
  0 siblings, 1 reply; 11+ messages in thread
From: Kei Kebreau @ 2016-09-25 21:03 UTC (permalink / raw)
  To: Arun Isaac; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 2363 bytes --]

Arun Isaac <arunisaac@systemreboot.net> writes:

> * gnu/packages/image.scm (optipng): New variable.
> ---
>  gnu/packages/image.scm | 33 +++++++++++++++++++++++++++++++++
>  1 file changed, 33 insertions(+)
>
> diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
> index 931cad1..4039c1a 100644
> --- a/gnu/packages/image.scm
> +++ b/gnu/packages/image.scm
> @@ -10,6 +10,7 @@
>  ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
>  ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
>  ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
> +;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -932,3 +933,35 @@ statistical tests.")
>  all included libraries only the image loading and decoding library is
>  installed as @code{stb_image}.")
>        (license license:public-domain))))
> +
> +(define-public optipng
> +  (package
> +    (name "optipng")
> +    (version "0.7.6")
> +    (source
> +     (origin
> +       (method url-fetch)
> +       (uri (string-append "http://prdownloads.sourceforge.net/optipng/optipng-"
> +                           version ".tar.gz"))
> +       (sha256
> +        (base32
> +         "105yk5qykvhiahzag67gm36s2kplxf6qn5hay02md0nkrcgn6w28"))))
> +    (build-system gnu-build-system)
> +    (inputs
> +     `(("zlib" ,zlib)))
> +    (arguments
> +     '(#:phases
> +       (modify-phases %standard-phases
> +         ;; configure script does not accept arguments CONFIG_SHELL and SHELL
> +         (replace 'configure
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (zero? (system* "sh" "configure"
> +                             (string-append "--prefix=" (assoc-ref outputs "out")))))))))
> +    (synopsis "Optimizer that recompresses PNG image files to a
> +smaller size")
> +    (description "OptiPNG is a PNG optimizer that recompresses image
> +files to a smaller size, without losing any information.  This program
> +also converts external formats (BMP, GIF, PNM and TIFF) to optimized
> +PNG, and performs PNG integrity checks and corrections.")
> +    (home-page "http://optipng.sourceforge.net/")
> +    (license license:zlib)))

Linting and reproducibility are clean here!

Pushed as 93117227034666db18c8b0c7fd89cca72a3eeca8.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add optipng.
  2016-09-25 21:03         ` Kei Kebreau
@ 2016-09-26 17:59           ` Leo Famulari
  2016-09-26 19:21             ` Arun Isaac
  2016-09-26 19:34             ` Danny Milosavljevic
  0 siblings, 2 replies; 11+ messages in thread
From: Leo Famulari @ 2016-09-26 17:59 UTC (permalink / raw)
  To: Kei Kebreau; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1181 bytes --]

On Sun, Sep 25, 2016 at 05:03:43PM -0400, Kei Kebreau wrote:
> Arun Isaac <arunisaac@systemreboot.net> writes:
> 
> > * gnu/packages/image.scm (optipng): New variable.

It failed to build on armhf:
https://hydra.gnu.org/build/1479396

Log excerpt:

make[2]: Leaving directory '/tmp/nix-build-optipng-0.7.6.drv-0/optipng-0.7.6/src/pngxtern'
gcc -c  -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../opngreduc -I../pngxtern -o optipng.o optipng.c
gcc -c  -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../opngreduc -I../pngxtern -o optim.o optim.c
gcc -s -o optipng optipng.o optim.o bitset.o ratio.o osys.o wildargs.o ../opngreduc/libopngreduc.a ../pngxtern/libpngxtern.a ../libpng/libpng.a ../zlib/libz.a ../gifread/libgifread.a ../pnmio/libpnmio.a ../minitiff/libminitiff.a   -lm 
../libpng/libpng.a(pngrutil.o): In function `png_read_filter_row':
pngrutil.c:(.text+0x13bc): undefined reference to `png_init_filter_functions_neon'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:99: optipng] Error 1
make[1]: Leaving directory '/tmp/nix-build-optipng-0.7.6.drv-0/optipng-0.7.6/src/optipng'
make: *** [Makefile:2: all] Error 2

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add optipng.
  2016-09-26 17:59           ` Leo Famulari
@ 2016-09-26 19:21             ` Arun Isaac
  2016-09-26 21:22               ` Leo Famulari
  2016-09-26 19:34             ` Danny Milosavljevic
  1 sibling, 1 reply; 11+ messages in thread
From: Arun Isaac @ 2016-09-26 19:21 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 3033 bytes --]


> make[2]: Leaving directory '/tmp/nix-build-optipng-0.7.6.drv-0/optipng-0.7.6/src/pngxtern'
> gcc -c  -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../opngreduc -I../pngxtern -o optipng.o optipng.c
> gcc -c  -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../opngreduc -I../pngxtern -o optim.o optim.c
> gcc -s -o optipng optipng.o optim.o bitset.o ratio.o osys.o wildargs.o ../opngreduc/libopngreduc.a ../pngxtern/libpngxtern.a ../libpng/libpng.a ../zlib/libz.a ../gifread/libgifread.a ../pnmio/libpnmio.a ../minitiff/libminitiff.a   -lm 
> ../libpng/libpng.a(pngrutil.o): In function `png_read_filter_row':
> pngrutil.c:(.text+0x13bc): undefined reference to `png_init_filter_functions_neon'
> collect2: error: ld returned 1 exit status
> make[1]: *** [Makefile:99: optipng] Error 1
> make[1]: Leaving directory '/tmp/nix-build-optipng-0.7.6.drv-0/optipng-0.7.6/src/optipng'
> make: *** [Makefile:2: all] Error 2

This seems related: https://sourceforge.net/p/libpng/bugs/230/
The bug was apparently fixed in libpng-1.6.15, and guix is still on
1.5.26. Could this be the issue?

How do I reproduce the armhf-linux build on my x86_64 system? I tried
`guix build --fallback --target=armhf-linux optipng`, but it failed with
the following error message while building binutils. Am I missing
something?

starting phase `configure'
source directory: "/tmp/guix-build-binutils-cross-armhf-linux-2.25.1.drv-0/binutils-2.25.1" (relative from build: ".")
build directory: "/tmp/guix-build-binutils-cross-armhf-linux-2.25.1.drv-0/binutils-2.25.1"
configure flags: ("CONFIG_SHELL=/gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42/bin/bash" "SHELL=/gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42/bin/bash" "--prefix=/gnu/store/cmk97w8d9hzab406g70b33kh3zbgllnh-binutils-cross-armhf-linux-2.25.1" "--enable-fast-install" "--build=x86_64-unknown-linux-gnu" "--target=armhf-linux" "--with-sysroot=/" "LDFLAGS=-static-libgcc" "--with-lib-path=/no-ld-lib-path" "--disable-werror" "--enable-install-libbfd" "--enable-deterministic-archives")
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... Invalid configuration `armhf-linux': machine `armhf' not recognized
configure: error: /gnu/store/ykzwykkvr2c80rw4l1qh3mvfdkl7jibi-bash-4.3.42/bin/bash ./config.sub armhf-linux failed
phase `configure' failed after 0.4 seconds
builder for `/gnu/store/zrr3b4gz2gh4m4fzpilj6zw7aw8r8c1h-binutils-cross-armhf-linux-2.25.1.drv' failed with exit code 1
@ build-failed /gnu/store/zrr3b4gz2gh4m4fzpilj6zw7aw8r8c1h-binutils-cross-armhf-linux-2.25.1.drv - 1 builder for `/gnu/store/zrr3b4gz2gh4m4fzpilj6zw7aw8r8c1h-binutils-cross-armhf-linux-2.25.1.drv' failed with exit code 1
cannot build derivation `/gnu/store/10r60df8navx9fprmlzvvv55zws8xj1x-optipng-0.7.6.drv': 1 dependencies couldn't be built
guix build: error: build failed: build of `/gnu/store/10r60df8navx9fprmlzvvv55zws8xj1x-optipng-0.7.6.drv' failed

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add optipng.
  2016-09-26 17:59           ` Leo Famulari
  2016-09-26 19:21             ` Arun Isaac
@ 2016-09-26 19:34             ` Danny Milosavljevic
  1 sibling, 0 replies; 11+ messages in thread
From: Danny Milosavljevic @ 2016-09-26 19:34 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Hi Leo,

On Mon, 26 Sep 2016 13:59:58 -0400
Leo Famulari <leo@famulari.name> wrote:

> gcc -s -o optipng optipng.o optim.o bitset.o ratio.o osys.o wildargs.o ../opngreduc/libopngreduc.a ../pngxtern/libpngxtern.a ../libpng/libpng.a ../zlib/libz.a ../gifread/libgifread.a ../pnmio/libpnmio.a ../minitiff/libminitiff.a   -lm 
> ../libpng/libpng.a(pngrutil.o): In function `png_read_filter_row':
> pngrutil.c:(.text+0x13bc): undefined reference to `png_init_filter_functions_neon'
> collect2: error: ld returned 1 exit status
> make[1]: *** [Makefile:99: optipng] Error 1
> make[1]: Leaving directory '/tmp/nix-build-optipng-0.7.6.drv-0/optipng-0.7.6/src/optipng'
> make: *** [Makefile:2: all] Error 2

Looks like a problem internal to libpng.

There's a configure option '--enable-arm-neon=api' in libpng. If we supported only ARM with NEON SIMD extension then we could build libpng with it. Do we?

Debian says on their https://wiki.debian.org/ArmHardFloatPort#NEON that one shouldn't require NEON since Marvell Dove and NVidia Tegra2 (?!?!?!) don't implement it.

There's also a configure option '--enable-arm-neon=check' which would check whether NEON works at runtime - but according to configure, it's not well-supported. What does this mean?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] gnu: Add optipng.
  2016-09-26 19:21             ` Arun Isaac
@ 2016-09-26 21:22               ` Leo Famulari
  0 siblings, 0 replies; 11+ messages in thread
From: Leo Famulari @ 2016-09-26 21:22 UTC (permalink / raw)
  To: Arun Isaac; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

On Tue, Sep 27, 2016 at 12:51:59AM +0530, Arun Isaac wrote:
> 
> > make[2]: Leaving directory '/tmp/nix-build-optipng-0.7.6.drv-0/optipng-0.7.6/src/pngxtern'
> > gcc -c  -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../opngreduc -I../pngxtern -o optipng.o optipng.c
> > gcc -c  -O2 -Wall -Wextra -I../cexcept -I../zlib -I../libpng -I../opngreduc -I../pngxtern -o optim.o optim.c
> > gcc -s -o optipng optipng.o optim.o bitset.o ratio.o osys.o wildargs.o ../opngreduc/libopngreduc.a ../pngxtern/libpngxtern.a ../libpng/libpng.a ../zlib/libz.a ../gifread/libgifread.a ../pnmio/libpnmio.a ../minitiff/libminitiff.a   -lm 
> > ../libpng/libpng.a(pngrutil.o): In function `png_read_filter_row':
> > pngrutil.c:(.text+0x13bc): undefined reference to `png_init_filter_functions_neon'
> > collect2: error: ld returned 1 exit status
> > make[1]: *** [Makefile:99: optipng] Error 1
> > make[1]: Leaving directory '/tmp/nix-build-optipng-0.7.6.drv-0/optipng-0.7.6/src/optipng'
> > make: *** [Makefile:2: all] Error 2
> 
> This seems related: https://sourceforge.net/p/libpng/bugs/230/
> The bug was apparently fixed in libpng-1.6.15, and guix is still on
> 1.5.26. Could this be the issue?

We have libpng 1.6.25 on core-updates. So this question will be answered
eventually.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-09-26 21:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-25  1:58 [PATCH] gnu: Add optipng Arun Isaac
2016-09-25  7:25 ` Arun Isaac
2016-09-25 16:20   ` Kei Kebreau
2016-09-25 16:52     ` Leo Famulari
2016-09-25 20:28     ` Arun Isaac
2016-09-25 20:28       ` Arun Isaac
2016-09-25 21:03         ` Kei Kebreau
2016-09-26 17:59           ` Leo Famulari
2016-09-26 19:21             ` Arun Isaac
2016-09-26 21:22               ` Leo Famulari
2016-09-26 19:34             ` Danny Milosavljevic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).