Patchwork [2/4] package/libsvg: new package

login
register
mail settings
Submitter Carsten Schoenert
Date June 28, 2013, 6:52 p.m.
Message ID <1372445557-15546-2-git-send-email-c.schoenert@gmail.com>
Download mbox | patch
Permalink /patch/255550/
State Superseded
Headers show

Comments

Carsten Schoenert - June 28, 2013, 6:52 p.m.
From: Carsten Schoenert <c.schoenert@gmail.com>

Libsvg provides a library for parsing SVG content in files or buffers.
Libsvg does not do any rendering, but instead provides a function-based
interface that can be used by various rendering engines.

Signed-off-by: Carsten Schoenert <c.schoenert@gmail.com>
---
 package/Config.in        |    1 +
 package/libsvg/Config.in |   10 ++++++++++
 package/libsvg/libsvg.mk |   15 +++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 package/libsvg/Config.in
 create mode 100644 package/libsvg/libsvg.mk
Peter Korsgaard - June 28, 2013, 7:14 p.m.
>>>>> "Carsten" == Carsten Schoenert <c.schoenert@gmail.com> writes:

 Carsten> From: Carsten Schoenert <c.schoenert@gmail.com>
 Carsten> Libsvg provides a library for parsing SVG content in files or buffers.
 Carsten> Libsvg does not do any rendering, but instead provides a function-based
 Carsten> interface that can be used by various rendering engines.

 Carsten> Signed-off-by: Carsten Schoenert <c.schoenert@gmail.com>
 Carsten> ---
 Carsten>  package/Config.in        |    1 +
 Carsten>  package/libsvg/Config.in |   10 ++++++++++
 Carsten>  package/libsvg/libsvg.mk |   15 +++++++++++++++
 Carsten>  3 files changed, 26 insertions(+)
 Carsten>  create mode 100644 package/libsvg/Config.in
 Carsten>  create mode 100644 package/libsvg/libsvg.mk

 Carsten> diff --git a/package/Config.in b/package/Config.in
 Carsten> index ebeabeb..7f5714d 100644
 Carsten> --- a/package/Config.in
 Carsten> +++ b/package/Config.in
 Carsten> @@ -461,6 +461,7 @@ source "package/libpng/Config.in"
 Carsten>  source "package/libqrencode/Config.in"
 Carsten>  source "package/libraw/Config.in"
 Carsten>  source "package/librsvg/Config.in"
 Carsten> +source "package/libsvg/Config.in"
 Carsten>  source "package/libsvgtiny/Config.in"
 Carsten>  source "package/libungif/Config.in"
 Carsten>  source "package/opencv/Config.in"
 Carsten> diff --git a/package/libsvg/Config.in b/package/libsvg/Config.in
 Carsten> new file mode 100644
 Carsten> index 0000000..0e372fe
 Carsten> --- /dev/null
 Carsten> +++ b/package/libsvg/Config.in
 Carsten> @@ -0,0 +1,10 @@
 Carsten> +config BR2_PACKAGE_LIBSVG
 Carsten> +	bool "libsvg"
 Carsten> +	select BR2_PACKAGE_LIBXML2
 Carsten> +	help
 Carsten> +	  Libsvg provides a parser for SVG content in files or buffers.
 Carsten> +	  Libsvg does not do any rendering, but instead provides a
 Carsten> +	  function-based interface that can be used by various rendering
 Carsten> +	  engines.
 Carsten> +
 Carsten> +	  http://www.t2-project.org/packages/libsvg.html

Are you sure that's the upstream URL? Isn't t2 yet another embedded
build system?

 Carsten> diff --git a/package/libsvg/libsvg.mk b/package/libsvg/libsvg.mk
 Carsten> new file mode 100644
 Carsten> index 0000000..069314d
 Carsten> --- /dev/null
 Carsten> +++ b/package/libsvg/libsvg.mk
 Carsten> @@ -0,0 +1,15 @@
 Carsten> +################################################################################
 Carsten> +#
 Carsten> +# libsvg
 Carsten> +#
 Carsten> +################################################################################
 Carsten> +
 Carsten> +LIBSVG_VERSION         = 0.1.4
 Carsten> +LIBSVG_SOURCE          = libsvg-$(LIBSVG_VERSION).tar.gz

This is the default, so you can drop this line.

Personally I prefer to not align the '=' signs, but I know we have a bit
of a mix in the tree.

 Carsten> +LIBSVG_SITE            = http://cairographics.org/snapshots/
 Carsten> +LIBSVG_DEPENDENCIES    = libxml2
 Carsten> +LIBSVG_INSTALL_STAGING = YES
 Carsten> +LIBSVG_LICENSE         = LGPLv2

grep -rls 'any later version' src | wc -l
24

It looks to be LGPLv2+.


 Carsten> +LIBSVG_LICENSE_FILES   = COPYING
 Carsten> +
 Carsten> +$(eval $(autotools-package))

It looks good, but it doesn't work:

checking for ANSI C header files... (cached) yes
checking whether libexpat is requested... no
./configure: line 20639: /home/peko/source/buildroot/output/host/usr/bin/pkg-config: No such file or directory
*** Your version of pkg-config is too old. You need version 0.9.0 or newer.
*** See http://www.freedesktop.org/software/pkgconfig
configure: error: Library requirements (libxml-2.0 >= 2.4.7 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

So you atleast need host-pkgconf as a dependency. It looks like it can
work with expat instead, so you could drop the hard dependency on
libxml2, but that is not really critical.
Carsten Schoenert - June 29, 2013, 8:46 a.m.
Hello Peter,

Am 28.06.2013 21:14, schrieb Peter Korsgaard:
>  Carsten> +	  http://www.t2-project.org/packages/libsvg.html
> 
> Are you sure that's the upstream URL? Isn't t2 yet another embedded
> build system?

Yes, true. After a longer try to find a "official" project webpage I
couldn't find no one that fits into.
The source is placed under cairographics.org (but even without any
dedicated info for the package libsvg (and also for libsvg-cairo). So
just point to the main site of cairographics.org?

> This is the default, so you can drop this line.
> 
> Personally I prefer to not align the '=' signs, but I know we have a bit
> of a mix in the tree.

Ahh, o.k. I didn't ever realize that, will drop this line.

>  Carsten> +LIBSVG_LICENSE         = LGPLv2
> 
> grep -rls 'any later version' src | wc -l
> 24
> 
> It looks to be LGPLv2+.

You are right, it's later written in the COPYING file.

> It looks good, but it doesn't work:
> 
> checking for ANSI C header files... (cached) yes
> checking whether libexpat is requested... no
> ./configure: line 20639: /home/peko/source/buildroot/output/host/usr/bin/pkg-config: No such file or directory
> *** Your version of pkg-config is too old. You need version 0.9.0 or newer.
> *** See http://www.freedesktop.org/software/pkgconfig
> configure: error: Library requirements (libxml-2.0 >= 2.4.7 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
> 
> So you atleast need host-pkgconf as a dependency. It looks like it can
> work with expat instead, so you could drop the hard dependency on
> libxml2, but that is not really critical.

That's correct, it should working with expat too (as a deeper look into
configure.in is showing). I changed the the libsvg.mk to cover this

> ifeq ($(BR2_PACKAGE_EXPAT),y)
> LIBSVG_CONF_OPT += --with-expat
> else
> LIBSVG_DEPENDENCIES += libxml2
> endif

but it doesn't work with my external (crosstool-NG) toolchain which I
create at my self, the expat.h is missing.

> checking whether libexpat is requested... yes
> configure: creating ./config.status
> config.status: creating libsvg.spec
> config.status: creating libsvg.pc
> config.status: creating src/svg_version.h
> config.status: creating Makefile
> config.status: creating src/Makefile
> config.status: creating config.h
> config.status: executing depfiles commands
>>>> libsvg 0.1.4 Building
...
> In file included from svg.c:31:0:
> svgint.h:28:19: fatal error: expat.h: No such file or directory

The BR2_PACKAGE_EXPAT is set by BR2_INSTALL_LIBSTDCPP which is set by
BR2_TOOLCHAIN_EXTERNAL_CXX. But crosstool-NG didn't provide the expat
related files.

http://sourceware.org/ml/crossgcc/2013-03/msg00021.html

So I think there is a little problem, how to tell buildroot if there is
a real support for expat or not? Maybe the other external toolchains
provide the expat files, I don't have tested this.

So I would suggest to set up the dependency to libxml2 with a comment why.

Regards
Carsten
Peter Korsgaard - June 29, 2013, 3:09 p.m.
>>>>> "Carsten" == Carsten Schoenert <c.schoenert@gmail.com> writes:

 Carsten> Hello Peter,
 Carsten> Am 28.06.2013 21:14, schrieb Peter Korsgaard:
 Carsten> +	  http://www.t2-project.org/packages/libsvg.html
 >> 
 >> Are you sure that's the upstream URL? Isn't t2 yet another embedded
 >> build system?

 Carsten> Yes, true. After a longer try to find a "official" project webpage I
 Carsten> couldn't find no one that fits into.
 Carsten> The source is placed under cairographics.org (but even without any
 Carsten> dedicated info for the package libsvg (and also for libsvg-cairo). So
 Carsten> just point to the main site of cairographics.org?

Yes, just use http://cairographics.org

 >> It looks good, but it doesn't work:
 >> 
 >> checking for ANSI C header files... (cached) yes
 >> checking whether libexpat is requested... no
 >> ./configure: line 20639: /home/peko/source/buildroot/output/host/usr/bin/pkg-config: No such file or directory
 >> *** Your version of pkg-config is too old. You need version 0.9.0 or newer.
 >> *** See http://www.freedesktop.org/software/pkgconfig
 >> configure: error: Library requirements (libxml-2.0 >= 2.4.7 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
 >> 
 >> So you atleast need host-pkgconf as a dependency. It looks like it can
 >> work with expat instead, so you could drop the hard dependency on
 >> libxml2, but that is not really critical.

 Carsten> That's correct, it should working with expat too (as a deeper
 Carsten> look into configure.in is showing). I changed the the
 Carsten> libsvg.mk to cover this

 >> ifeq ($(BR2_PACKAGE_EXPAT),y)
 >> LIBSVG_CONF_OPT += --with-expat
 >> else
 >> LIBSVG_DEPENDENCIES += libxml2
 >> endif

You should also add expat to LIBSVG_DEPENDENCIES for the expat case, and
select the libxml2 package in Config.in if need (so Kconfig is in sync
with the makefile) - something like:

     select BR2_PACKAGE_LIBXML2 if !BR2_PACKAGE_EXPAT


 Carsten> but it doesn't work with my external (crosstool-NG) toolchain which I
 Carsten> create at my self, the expat.h is missing.

 >> checking whether libexpat is requested... yes
 >> configure: creating ./config.status
 >> config.status: creating libsvg.spec
 >> config.status: creating libsvg.pc
 >> config.status: creating src/svg_version.h
 >> config.status: creating Makefile
 >> config.status: creating src/Makefile
 >> config.status: creating config.h
 >> config.status: executing depfiles commands
 >>>>> libsvg 0.1.4 Building
 Carsten> ...
 >> In file included from svg.c:31:0:
 >> svgint.h:28:19: fatal error: expat.h: No such file or directory

Probably because you forgot to add expat to the dependencies, so it
isn't built yet by the time libsvg configure runs.

 Carsten> The BR2_PACKAGE_EXPAT is set by BR2_INSTALL_LIBSTDCPP which is set by
 Carsten> BR2_TOOLCHAIN_EXTERNAL_CXX. But crosstool-NG didn't provide the expat
 Carsten> related files.

Ehh, I don't quite follow. BR2_PACKAGE_EXPAT is about libexpat for the
TARGET. It doesn't have anything to do with the cross compiler needing
expat for the host.

Patch

diff --git a/package/Config.in b/package/Config.in
index ebeabeb..7f5714d 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -461,6 +461,7 @@  source "package/libpng/Config.in"
 source "package/libqrencode/Config.in"
 source "package/libraw/Config.in"
 source "package/librsvg/Config.in"
+source "package/libsvg/Config.in"
 source "package/libsvgtiny/Config.in"
 source "package/libungif/Config.in"
 source "package/opencv/Config.in"
diff --git a/package/libsvg/Config.in b/package/libsvg/Config.in
new file mode 100644
index 0000000..0e372fe
--- /dev/null
+++ b/package/libsvg/Config.in
@@ -0,0 +1,10 @@ 
+config BR2_PACKAGE_LIBSVG
+	bool "libsvg"
+	select BR2_PACKAGE_LIBXML2
+	help
+	  Libsvg provides a parser for SVG content in files or buffers.
+	  Libsvg does not do any rendering, but instead provides a
+	  function-based interface that can be used by various rendering
+	  engines.
+
+	  http://www.t2-project.org/packages/libsvg.html
diff --git a/package/libsvg/libsvg.mk b/package/libsvg/libsvg.mk
new file mode 100644
index 0000000..069314d
--- /dev/null
+++ b/package/libsvg/libsvg.mk
@@ -0,0 +1,15 @@ 
+################################################################################
+#
+# libsvg
+#
+################################################################################
+
+LIBSVG_VERSION         = 0.1.4
+LIBSVG_SOURCE          = libsvg-$(LIBSVG_VERSION).tar.gz
+LIBSVG_SITE            = http://cairographics.org/snapshots/
+LIBSVG_DEPENDENCIES    = libxml2
+LIBSVG_INSTALL_STAGING = YES
+LIBSVG_LICENSE         = LGPLv2
+LIBSVG_LICENSE_FILES   = COPYING
+
+$(eval $(autotools-package))