Patchwork [1/1] webp: new package

login
register
mail settings
Submitter gilles.talis@gmail.com
Date Jan. 16, 2013, 10:14 p.m.
Message ID <1358374472-11291-1-git-send-email-gilles.talis@gmail.com>
Download mbox | patch
Permalink /patch/213084/
State Superseded
Headers show

Comments

gilles.talis@gmail.com - Jan. 16, 2013, 10:14 p.m.
From: Gilles Talis <gilles.talis@gmail.com>

WebP is a new image format that provides lossless
and lossy compression for images on the web

Signed-off-by: Gilles Talis <gilles.talis@gmail.com>
---
 package/Config.in      |    1 +
 package/webp/Config.in |    7 +++++++
 package/webp/webp.mk   |   22 ++++++++++++++++++++++
 3 files changed, 30 insertions(+), 0 deletions(-)
 create mode 100644 package/webp/Config.in
 create mode 100644 package/webp/webp.mk
Peter Korsgaard - Jan. 20, 2013, 8:56 p.m.
>>>>> "gilles" == gilles talis <gilles.talis@gmail.com> writes:

 gilles> From: Gilles Talis <gilles.talis@gmail.com>
 gilles> WebP is a new image format that provides lossless
 gilles> and lossy compression for images on the web

 gilles> +#####################################################################
 gilles> +#
 gilles> +# webp
 gilles> +#
 gilles> +#####################################################################
 gilles> +
 gilles> +WEBP_VERSION = 0.2.1
 gilles> +WEBP_SOURCE = libwebp-$(WEBP_VERSION).tar.gz
 gilles> +WEBP_SITE = https://webp.googlecode.com/files
 gilles> +WEBP_LICENSE = BSD-3c
 gilles> +WEBP_LICENSE_FILES = COPYING
 gilles> +WEBP_INSTALL_STAGING = YES
 gilles> +
 gilles> +ifeq ($(BR2_PACKAGE_LIBPNG),y)
 gilles> +WEBP_DEPENDENCIES += libpng
 gilles> +WEBP_CONF_ENV += ac_cv_path_LIBPNG_CONFIG=$(STAGING_DIR)/usr/bin/libpng-config
 gilles> +endif

So what happens when you don't have libpng enabled but do have
libpng-config on the host? Is there no explicit configure options to
turn off png support (alternatively, point LIBPNG_CONFIG to /bin/false
or similar).

 gilles> +
 gilles> +WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_JPEG),jpeg)
 gilles> +WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_TIFF),tiff)

Same here. You don't depend on host-pkgconf, so it presumably doesn't
use that to figure out availability of jpeg/tiff.
gilles.talis@gmail.com - Jan. 21, 2013, 11:45 p.m.
Dear Peter,


On Jan 20, 2013 12:56 PM, "Peter Korsgaard" <jacmet@uclibc.org> wrote:
>
> >>>>> "gilles" == gilles talis <gilles.talis@gmail.com> writes:
>
>  gilles> From: Gilles Talis <gilles.talis@gmail.com>
>  gilles> WebP is a new image format that provides lossless
>  gilles> and lossy compression for images on the web
>
>  gilles>
+#####################################################################
>  gilles> +#
>  gilles> +# webp
>  gilles> +#
>  gilles>
+#####################################################################
>  gilles> +
>  gilles> +WEBP_VERSION = 0.2.1
>  gilles> +WEBP_SOURCE = libwebp-$(WEBP_VERSION).tar.gz
>  gilles> +WEBP_SITE = https://webp.googlecode.com/files
>  gilles> +WEBP_LICENSE = BSD-3c
>  gilles> +WEBP_LICENSE_FILES = COPYING
>  gilles> +WEBP_INSTALL_STAGING = YES
>  gilles> +
>  gilles> +ifeq ($(BR2_PACKAGE_LIBPNG),y)
>  gilles> +WEBP_DEPENDENCIES += libpng
>  gilles> +WEBP_CONF_ENV +=
ac_cv_path_LIBPNG_CONFIG=$(STAGING_DIR)/usr/bin/libpng-config
>  gilles> +endif
>
> So what happens when you don't have libpng enabled but do have
> libpng-config on the host? Is there no explicit configure options to
> turn off png support (alternatively, point LIBPNG_CONFIG to /bin/false
> or similar).

There's no way to disable any of the options mentioned in that patch (PNG,
JPEG, TIFF).

in my setup, the "configure" step returns cross-compilation errors, thus
removes PNG from the available options.

I hesitated quite a bit before embedding LIBPNG_CONFIG within
BR2_PACKAGE_LIBPNG flag. My first intention was to force this config to
always point to the staging dir. Is that what you are suggesting?

>
>  gilles> +
>  gilles> +WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_JPEG),jpeg)
>  gilles> +WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_TIFF),tiff)
>
> Same here. You don't depend on host-pkgconf, so it presumably doesn't
> use that to figure out availability of jpeg/tiff.

Same here. I can force the paths to JPEG and TIFF include and lib to always
point to staging dir. Was my first intention, but it seemed to work out
fine without doing that. Do you think it would be preferrable to force
these paths?


thanks
Gilles.
Peter Korsgaard - Jan. 22, 2013, 9:48 a.m.
>>>>> "Gilles" == Gilles Talis <gilles.talis@gmail.com> writes:

Hi,

 >>  gilles> +WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_JPEG),jpeg)
 >>  gilles> +WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_TIFF),tiff)
 >> 
 >> Same here. You don't depend on host-pkgconf, so it presumably doesn't
 >> use that to figure out availability of jpeg/tiff.

 Gilles> Same here. I can force the paths to JPEG and TIFF include and
 Gilles> lib to always point to staging dir. Was my first intention, but
 Gilles> it seemed to work out fine without doing that. Do you think it
 Gilles> would be preferrable to force these paths?

I'm concerned it will fail if you build for the same architecture as
your host (E.G. for a PC), haven't enabled png/tiff/jpeg in buildroot
but DO have the development libraries installed on the host.

I'll give it a test later today.

Patch

diff --git a/package/Config.in b/package/Config.in
index ba03b3c..1e8c4da 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -433,6 +433,7 @@  source "package/pango/Config.in"
 source "package/pixman/Config.in"
 source "package/tiff/Config.in"
 source "package/webkit/Config.in"
+source "package/webp/Config.in"
 source "package/zxing/Config.in"
 endmenu
 
diff --git a/package/webp/Config.in b/package/webp/Config.in
new file mode 100644
index 0000000..a2acdff
--- /dev/null
+++ b/package/webp/Config.in
@@ -0,0 +1,7 @@ 
+config BR2_PACKAGE_WEBP
+	bool "webp"
+	help
+	  WebP is a new image format that provides lossless and
+	  lossy compression for images on the web
+
+	  https://developers.google.com/speed/webp/
diff --git a/package/webp/webp.mk b/package/webp/webp.mk
new file mode 100644
index 0000000..3dcb13c
--- /dev/null
+++ b/package/webp/webp.mk
@@ -0,0 +1,22 @@ 
+#####################################################################
+#
+# webp
+#
+#####################################################################
+
+WEBP_VERSION = 0.2.1
+WEBP_SOURCE = libwebp-$(WEBP_VERSION).tar.gz
+WEBP_SITE = https://webp.googlecode.com/files
+WEBP_LICENSE = BSD-3c
+WEBP_LICENSE_FILES = COPYING
+WEBP_INSTALL_STAGING = YES
+
+ifeq ($(BR2_PACKAGE_LIBPNG),y)
+WEBP_DEPENDENCIES += libpng
+WEBP_CONF_ENV += ac_cv_path_LIBPNG_CONFIG=$(STAGING_DIR)/usr/bin/libpng-config
+endif
+
+WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_JPEG),jpeg)
+WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_TIFF),tiff)
+
+$(eval $(autotools-package))