Package Details: libsvg 0.1.4-8

Git Clone URL: https://aur.archlinux.org/libsvg.git (read-only, click to copy)
Package Base: libsvg
Description: A library for rendering SVG documents
Upstream URL: https://cairographics.org/
Keywords: lib svg
Licenses: LGPL-2.1-only
Submitter: Snowman
Maintainer: zoorat
Last Packager: zoorat
Votes: 151
Popularity: 0.001018
First Submitted: 2007-12-12 05:30 (UTC)
Last Updated: 2025-01-10 06:29 (UTC)

Latest Comments

1 2 Next › Last »

ArArgyridis commented on 2025-09-10 09:33 (UTC)

For those having issues compiling libsvg, try to use the following patch, instead of libpng14.patch:

diff -ura libsvg-0.1.4/src/svg_image.c libsvg-0.1.4-new/src/svg_image.c
--- libsvg-0.1.4/src/svg_image.c    2005-04-11 18:45:32.000000000 +0300
+++ libsvg-0.1.4-new/src/svg_image.c    2025-09-10 12:28:43.412226854 +0300
@@ -228,7 +228,7 @@
    return SVG_STATUS_FILE_NOT_FOUND;

     sig_bytes = fread (png_sig, 1, PNG_SIG_SIZE, file);
-    if (png_check_sig (png_sig, sig_bytes) == 0) {
+    if (!png_sig_cmp (png_sig, 0, sig_bytes) == 0) {
    fclose (file);
    return SVGINT_STATUS_IMAGE_NOT_PNG;
     }
@@ -271,7 +271,7 @@

     /* expand gray bit depth if needed */
     if (color_type == PNG_COLOR_TYPE_GRAY && depth < 8)
-   png_set_gray_1_2_4_to_8 (png);
+   png_set_expand_gray_1_2_4_to_8 (png);

     /* transform transparency to alpha */
     if (png_get_valid(png, info, PNG_INFO_tRNS))
diff -ura libsvg-0.1.4/src/svgint.h libsvg-0.1.4-new/src/svgint.h
--- libsvg-0.1.4/src/svgint.h   2005-06-03 19:17:59.000000000 +0300
+++ libsvg-0.1.4-new/src/svgint.h   2025-09-10 12:29:07.153778195 +0300
@@ -36,6 +36,7 @@
 #include <libxml/SAX.h>
 #include <libxml/xmlmemory.h>
 #include <libxml/hash.h>
+#include <libxml/parser.h>

 typedef xmlParserCtxtPtr svg_xml_parser_context_t;
 typedef xmlHashTable svg_xml_hash_table_t;

zoorat commented on 2025-01-10 06:29 (UTC)

@dreieck Thanks a lot.

dreieck commented on 2025-01-08 19:17 (UTC)

You need to make the license identifier SPDX compliant:

libsvg E: LGPL is not a valid SPDX license identifier. See https://spdx.org/licenses/ for valid identifiers, or prefix the identifier with 'LicenseRef-', if it is custom.

Regards and thanks for the package!

dreieck commented on 2025-01-08 19:11 (UTC)

Build fails with svg_paint.c:42:31: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration] and a lot of similar errors:

[...]
 gcc -DHAVE_CONFIG_H -I. -I. -I.. -I/usr/include/libxml2 -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -march=native -mtune=native -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -fstack-clash-protection -fcf-protection -w -flto=auto -MT svg_style.lo -MD -MP -MF .deps/svg_style.Tpo -c svg_style.c  -fPIC -DPIC -o .libs/svg_style.o
svg_paint.c: In function '_svg_paint_init':
svg_paint.c:42:31: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   42 |         char            *id = malloc (length+1);
      |                               ^~~~~~
svg_paint.c:26:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
   25 | #include "svgint.h"
  +++ |+#include <stdlib.h>
   26 | 
svg_element.c: In function '_svg_element_create':
svg_element.c:33:16: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
   33 |     *element = malloc( sizeof (svg_element_t));
      |                ^~~~~~
svg_paint.c:50:9: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   50 |         free (id);
      |         ^~~~
svg_paint.c:50:9: note: include '<stdlib.h>' or provide a declaration of 'free'
svg_element.c:26:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
   25 | #include "svgint.h"
  +++ |+#include <stdlib.h>
   26 | 
[...]

Maybe you need to add some backwards compatibility compiler options to build this with up to date GCC.

Workaround:

Add to build():

    CFLAGS+=" -Wno-error=implicit-function-declaration -Wno-error=int-conversion"
    CXXFLAGS+="${_CFLAGS}"
    export CFLAGS
    export CXXFLAGS

Regards!

micwoj92 commented on 2021-05-02 22:16 (UTC)

Hello, could you update links to https?

haawda commented on 2016-03-02 19:03 (UTC)

Still works for me.

qs9rx commented on 2016-03-02 09:28 (UTC) (edited on 2016-03-02 09:29 (UTC) by qs9rx)

curl: (7) Failed to connect to cairographics.org port 80: Connection refused ==> ERROR: Failure while downloading http://cairographics.org/snapshots/libsvg-0.1.4.tar.gz http://pkgs.fedoraproject.org/repo/pkgs/libsvg/libsvg-0.1.4.tar.gz/ce0715e3013f78506795fba16e8455d3/libsvg-0.1.4.tar.gz is the same md5sum and works fine.

haawda commented on 2012-06-28 18:29 (UTC)

Not for me, maybe a temporary problem?

infoised commented on 2012-06-27 18:42 (UTC)

The source link appears to be broken.