summaryrefslogtreecommitdiff
path: root/recipes/librsvg
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@collabora.com>2014-03-06 18:36:39 +0100
committerThibault Saunier <tsaunier@gnome.org>2014-06-16 14:44:39 +0200
commita5b8c3a4b411c43e7fcaa083c1d98f9ea4c4643a (patch)
treefa67a2d83c3a2236dcbeb1d65949a96c62ba2db2 /recipes/librsvg
parentbe6c4931f99d04c1f0573a0cc5897d775a2371ce (diff)
recipes:librsvg: Update and the recipe
+ Update to 2.40.2 + Make it depend on Gtk3 rather than Gtk2 + Add the typelibs file + Make it compile on windows adding a path
Diffstat (limited to 'recipes/librsvg')
-rw-r--r--recipes/librsvg/0001-Add-an-implementation-of-realpath-for-windows-to-mak.patch175
1 files changed, 175 insertions, 0 deletions
diff --git a/recipes/librsvg/0001-Add-an-implementation-of-realpath-for-windows-to-mak.patch b/recipes/librsvg/0001-Add-an-implementation-of-realpath-for-windows-to-mak.patch
new file mode 100644
index 00000000..560c577d
--- /dev/null
+++ b/recipes/librsvg/0001-Add-an-implementation-of-realpath-for-windows-to-mak.patch
@@ -0,0 +1,175 @@
+From f2eeb40abaca5bf864c451f8f64b68b8358035a0 Mon Sep 17 00:00:00 2001
+From: Thibault Saunier <tsaunier@gnome.org>
+Date: Wed, 14 May 2014 11:34:48 +0200
+Subject: [PATCH] Add an implementation of realpath for windows to make it
+ compile
+
+Based on https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-librsvg
+---
+ realpath.c | 136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ rsvg-base.c | 6 +++
+ 2 files changed, 142 insertions(+)
+ create mode 100644 realpath.c
+
+diff --git a/realpath.c b/realpath.c
+new file mode 100644
+index 0000000..7db88c2
+--- /dev/null
++++ b/realpath.c
+@@ -0,0 +1,136 @@
++/*
++realpath() Win32 implementation
++By Nach M. S.
++Copyright (C) September 8, 2005
++
++I am placing this in the public domain for anyone to use or modify
++*/
++
++#include <windows.h>
++#include <stdlib.h>
++#include <limits.h>
++#include <errno.h>
++#include <sys/stat.h>
++
++char *realpath(const char *path, char resolved_path[PATH_MAX])
++{
++ char *return_path = 0;
++
++ if (path) //Else EINVAL
++ {
++ if (resolved_path)
++ {
++ return_path = resolved_path;
++ }
++ else
++ {
++ //Non standard extension that glibc uses
++ return_path = malloc(PATH_MAX);
++ }
++
++ if (return_path) //Else EINVAL
++ {
++ //This is a Win32 API function similar to what realpath() is supposed to do
++ size_t size = GetFullPathNameA(path, PATH_MAX, return_path, 0);
++
++ //GetFullPathNameA() returns a size larger than buffer if buffer is too small
++ if (size > PATH_MAX)
++ {
++ if (return_path != resolved_path) //Malloc'd buffer - Unstandard extension retry
++ {
++ size_t new_size;
++
++ free(return_path);
++ return_path = malloc(size);
++
++ if (return_path)
++ {
++ new_size = GetFullPathNameA(path, size, return_path, 0); //Try again
++
++ if (new_size > size) //If it's still too large, we have a problem, don't try again
++ {
++ free(return_path);
++ return_path = 0;
++ errno = ENAMETOOLONG;
++ }
++ else
++ {
++ size = new_size;
++ }
++ }
++ else
++ {
++ //I wasn't sure what to return here, but the standard does say to return EINVAL
++ //if resolved_path is null, and in this case we couldn't malloc large enough buffer
++ errno = EINVAL;
++ }
++ }
++ else //resolved_path buffer isn't big enough
++ {
++ return_path = 0;
++ errno = ENAMETOOLONG;
++ }
++ }
++
++ //GetFullPathNameA() returns 0 if some path resolve problem occured
++ if (!size)
++ {
++ if (return_path != resolved_path) //Malloc'd buffer
++ {
++ free(return_path);
++ }
++
++ return_path = 0;
++
++ //Convert MS errors into standard errors
++ switch (GetLastError())
++ {
++ case ERROR_FILE_NOT_FOUND:
++ errno = ENOENT;
++ break;
++
++ case ERROR_PATH_NOT_FOUND: case ERROR_INVALID_DRIVE:
++ errno = ENOTDIR;
++ break;
++
++ case ERROR_ACCESS_DENIED:
++ errno = EACCES;
++ break;
++
++ default: //Unknown Error
++ errno = EIO;
++ break;
++ }
++ }
++
++ //If we get to here with a valid return_path, we're still doing good
++ if (return_path)
++ {
++ struct stat stat_buffer;
++
++ //Make sure path exists, stat() returns 0 on success
++ if (stat(return_path, &stat_buffer))
++ {
++ if (return_path != resolved_path)
++ {
++ free(return_path);
++ }
++
++ return_path = 0;
++ //stat() will set the correct errno for us
++ }
++ //else we succeeded!
++ }
++ }
++ else
++ {
++ errno = EINVAL;
++ }
++ }
++ else
++ {
++ errno = EINVAL;
++ }
++
++ return return_path;
++}
+diff --git a/rsvg-base.c b/rsvg-base.c
+index fb829e7..b5a7a10 100644
+--- a/rsvg-base.c
++++ b/rsvg-base.c
+@@ -57,6 +57,12 @@
+ #include "rsvg-paint-server.h"
+ #include "rsvg-xml.h"
+
++#include <glib.h>
++
++#ifdef G_OS_WIN32
++#include "realpath.c"
++#endif
++
+ /*
+ * This is configurable at runtime
+ */
+--
+1.9.0
+