package/libsvg: new package
PATCH v2 1/1 package/libsvg: new package
From: Carsten Schoenert <[email protected]>
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.
---
Changes v2:
- reworking the whole patch after suggestions from Peter and Thomas
- adding patch to preventing compiler errors while linking against libexpat
package/Config.in | 1 + package/libsvg/Config.in | 23 ++++++++++++++ .../libsvg-fix-expat-static-declaration.patch | 33 ++++++++++++++++++++ package/libsvg/libsvg.mk | 23 ++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 package/libsvg/Config.in create mode 100644 package/libsvg/libsvg-fix-expat-static-declaration.patch create mode 100644 package/libsvg/libsvg.mk
package/Config.in +1 -0
@@ -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"
package/libsvg/Config.in new file +23 -0
@@ -0,0 +1,23 @@ +config BR2_PACKAGE_LIBSVG + bool "libsvg" + select BR2_PACKAGE_LIBXML2 if !BR2_PACKAGE_LIBSVG_EXPAT + 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://cairographics.org/snapshots/ + +if BR2_PACKAGE_LIBSVG + +config BR2_PACKAGE_LIBSVG_EXPAT + bool "use expat XML parser library" + select BR2_PACKAGE_EXPAT + default y + help + Libsvg needs a XML parsing library! + Select expat if you want to use the Expat XML Parser library, + otherwhise the libxml2 library will be used. + +endif # BR2_PACKAGE_LIBSVG
package/libsvg/libsvg-fix-expat-static-declaration.patch new file +33 -0
@@ -0,0 +1,33 @@ +Newer expat versions use different declarations of the following functions: + +static void _svg_parser_sax_start_element (); +static void _svg_parser_sax_end_element (); +static void _svg_parser_sax_characters (); + +We need to patch the libsvg source to not follow into a build error like + "static declaration of 'foo' follows non-static declaration" +and use the functions from the expat library instead from the libsvg source. + +Patch based on +http://oe-lite.org/redmine/projects/xorg/repository/revisions/c4df7951e846e1be718f37f2455696a1d0861f3d/entry/recipes/cairo/libsvg-0.1.4/gcc4_and_expat.patch + +Signed-off-by: Carsten Schoenert <[email protected]> + +diff -bur libsvg-0.1.4~orig/src/svg_parser_expat.c libsvg-0.1.4/src/svg_parser_expat.c +--- libsvg-0.1.4~orig/src/svg_parser_expat.c 2005-02-14 11:26:26.000000000 -0600 ++++ libsvg-0.1.4/src/svg_parser_expat.c 2006-02-10 21:58:20.000000000 -0600 +@@ -30,6 +30,7 @@ + #include "svgint.h" + #include "svg_hash.h" + ++#ifndef LIBSVG_EXPAT + static void + _svg_parser_sax_start_element (void *closure, + const XML_Char *name, +@@ -43,6 +44,7 @@ + _svg_parser_sax_characters (void *closure, + const XML_Char *ch, + int len); ++#endif + + static void
+ _svg_parser_sax_warning (void *closure,
package/libsvg/libsvg.mk new file +23 -0
@@ -0,0 +1,23 @@ +################################################################################ +# +# libsvg +# +################################################################################ + +LIBSVG_VERSION = 0.1.4 +LIBSVG_SITE = http://cairographics.org/snapshots/ +LIBSVG_DEPENDENCIES = host-pkgconf libpng libjpeg +LIBSVG_INSTALL_STAGING = YES +LIBSVG_LICENSE = LGPLv2+ +LIBSVG_LICENSE_FILES = COPYING + +# libsvg needs at last a XML parser +ifeq ($(BR2_PACKAGE_LIBSVG_EXPAT),y) +LIBSVG_CONF_OPT += --with-expat +LIBSVG_DEPENDENCIES += expat +else ifeq ($(BR2_PACKAGE_LIBXML2),y) +LIBSVG_CONF_OPT += --with-libxml2 +LIBSVG_DEPENDENCIES += libxml2 +endif + +$(eval $(autotools-package))
Signature · 1 line
1.7.10.4
PATCH v2 1/1 package/libsvg: new package
Dear Carsten Schoenert,
package/libsvg/Config.in line 3
Quoted 3 lines · Carsten Schoenert
package/libsvg/Config.in new file +3
-0+config BR2_PACKAGE_LIBSVG + bool "libsvg" + select BR2_PACKAGE_LIBXML2 if !BR2_PACKAGE_LIBSVG_EXPAT
I don't think we want the BR2_PACKAGE_LIBSVG_EXPAT option. Just make this:
select BR2_PACKAGE_LIBXML2 if !BR2_PACKAGE_EXPAT
Quoted 8 lines
package/libsvg/Config.in new file +8
-0+ 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://cairographics.org/snapshots/ +
package/libsvg/Config.in line 21
Quoted 10 lines
package/libsvg/Config.in new file +10
-0+if BR2_PACKAGE_LIBSVG + +config BR2_PACKAGE_LIBSVG_EXPAT + bool "use expat XML parser library" + select BR2_PACKAGE_EXPAT + default y + help + Libsvg needs a XML parsing library! + Select expat if you want to use the Expat XML Parser library, + otherwhise the libxml2 library will be used.
Remove this option.
package/libsvg/libsvg.mk line 15
Quoted 9 lines
package/libsvg/libsvg.mk new file +9
-0+LIBSVG_VERSION = 0.1.4 +LIBSVG_SITE = http://cairographics.org/snapshots/ +LIBSVG_DEPENDENCIES = host-pkgconf libpng libjpeg +LIBSVG_INSTALL_STAGING = YES +LIBSVG_LICENSE = LGPLv2+ +LIBSVG_LICENSE_FILES = COPYING + +# libsvg needs at last a XML parser +ifeq ($(BR2_PACKAGE_LIBSVG_EXPAT),y)
ifeq ($(BR2_PACKAGE_EXPAT),y)
package/libsvg/libsvg.mk line 23
Quoted 8 lines
package/libsvg/libsvg.mk new file +8
-0+LIBSVG_CONF_OPT += --with-expat +LIBSVG_DEPENDENCIES += expat +else ifeq ($(BR2_PACKAGE_LIBXML2),y) +LIBSVG_CONF_OPT += --with-libxml2 +LIBSVG_DEPENDENCIES += libxml2 +endif + +$(eval $(autotools-package))
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 1/1 package/libsvg: new package
In reply to Carsten SchoenertQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carsten" == Carsten Schoenert <[email protected]> writes:
Carsten> From: Carsten Schoenert <[email protected]>
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> +++ b/package/libsvg/Config.in
Carsten> @@ -0,0 +1,23 @@
Carsten> +config BR2_PACKAGE_LIBSVG
Carsten> + bool "libsvg"
Carsten> + select BR2_PACKAGE_LIBXML2 if !BR2_PACKAGE_LIBSVG_EXPAT
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://cairographics.org/snapshots/ Carsten> + Carsten> +if BR2_PACKAGE_LIBSVG Carsten> + Carsten> +config BR2_PACKAGE_LIBSVG_EXPAT Carsten> + bool "use expat XML parser library" Carsten> + select BR2_PACKAGE_EXPAT Carsten> + default y Carsten> + help Carsten> + Libsvg needs a XML parsing library! Carsten> + Select expat if you want to use the Expat XML Parser library, Carsten> + otherwhise the libxml2 library will be used.
Carsten> +
Carsten> +endif # BR2_PACKAGE_LIBSVG
My idea was to simply automatically use the expat backend if BR2_PACKAGE_EXPAT is enabled, and not have an explicit option for it, so
you can drop this suboption.
Carsten> +++ b/package/libsvg/libsvg.mk
Carsten> @@ -0,0 +1,23 @@
Carsten> +################################################################################ Carsten> +#
Carsten> +# libsvg
Carsten> +#
Carsten> +################################################################################ Carsten> +
Carsten> +LIBSVG_VERSION = 0.1.4 Carsten> +LIBSVG_SITE = http://cairographics.org/snapshots/ Carsten> +LIBSVG_DEPENDENCIES = host-pkgconf libpng libjpeg
Ohh? You didn't have libpng/libjpeg as dependencies in v1? Are they needed? If so, you need to select them in Config.in as well.
Carsten> +LIBSVG_INSTALL_STAGING = YES
Carsten> +LIBSVG_LICENSE = LGPLv2+
Carsten> +LIBSVG_LICENSE_FILES = COPYING
Carsten> +
Carsten> +# libsvg needs at last a XML parser
Carsten> +ifeq ($(BR2_PACKAGE_LIBSVG_EXPAT),y)
This then becomes:
ifeq ($(BR2_PACKAGE_EXPAT),y)
Carsten> +LIBSVG_CONF_OPT += --with-expat
Carsten> +LIBSVG_DEPENDENCIES += expat
Carsten> +else ifeq ($(BR2_PACKAGE_LIBXML2),y)
Carsten> +LIBSVG_CONF_OPT += --with-libxml2
Carsten> +LIBSVG_DEPENDENCIES += libxml2
Carsten> +endif
Carsten> +
Carsten> +$(eval $(autotools-package))
Carsten> --
Carsten> 1.7.10.4
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 1/1 package/libsvg: new package
Hello Peter and Thomas,
Am 01.07.2013 09:56, schrieb Peter Korsgaard:
Quoted 4 lines
My idea was to simply automatically use the expat backend if
BR2_PACKAGE_EXPATis enabled, and not have an explicit option for it, so you can drop this suboption.
My intention was to give the user the choice if he want to use expat regularly on the system but use libxml2 for building the libsvg package. But in the end this makes not really sense and the proposal of you both is of course a little bit more simplify. Sometime I'm thinking to "complicated".
Quoted 3 lines
Carsten> +LIBSVG_DEPENDENCIES = host-pkgconf libpng libjpeg
Ohh? You didn't have libpng/libjpeg as dependencies in v1?
Yes, in v1 there wasn't this dependencies. As I must see the configure.in lacks the need for both packages. But while testing after a cleanup of the build environment I saw build errors because of missed header png.h and jpeglib.h, jerror.h.
Quoted 2 lines
Are they
needed? If so, you need to select them in Config.in as well.
Will set the packages in the Config.in and rework the patch again.
Thanks for patience with me!
Regards
Carsten