[Pkg-e-devel] Bug#535768: evas: plop

Manuel Menal mmenal at hurdfr.org
Sat Jul 4 20:38:45 UTC 2009


Package: evas
Severity: important
Tags: patch
Justification: fails to build from source


Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Manuel Menal <mmenal at hurdfr.org>
To: Debian Bug Tracking System <submit at bugs.debian.org>
Subject: evas: FTBFS on hurd-i386 (and probably k*BSD)
Message-ID: <20090704202119.94208.70277.reportbug at Earendil.duckcorp.org>
X-Mailer: reportbug 4.4
Date: Sat, 04 Jul 2009 22:21:19 +0200

Package: evas
Severity: important
Tags: patch
Justification: fails to build from source

Hi,

evas uses the PATH_MAX constant, which is optional on POSIX and undefined on GNU/Hurd.
It also uses a linux-dependent FB interface (depending on linux/fb.h), which is unavailable
on GNU/Hurd, and probably on GNU/k*BSD.

Here is a patch that fixes these problems:

diff -urp evas-0.9.9.060/debian/libevas-engines-extras.install ../evas-0.9.9.060/debian/libevas-engines-extras.install
--- evas-0.9.9.060/debian/libevas-engines-extras.install	2009-07-04 21:39:24.000000000 +0200
+++ ../evas-0.9.9.060/debian/libevas-engines-extras.install	2009-07-04 21:52:34.000000000 +0200
@@ -1,2 +1 @@
-debian/tmp/usr/lib/evas/modules/engines/fb/*/module.so
 debian/tmp/usr/lib/evas/modules/engines/gl_x11/*/module.so
diff -Nurp evas-0.9.9.060/debian/libevas-engines-extras.install.linux ../evas-0.9.9.060/debian/libevas-engines-extras.install.linux
--- evas-0.9.9.060/debian/libevas-engines-extras.install.linux	1970-01-01 01:00:00.000000000 +0100
+++ ../evas-0.9.9.060/debian/libevas-engines-extras.install.linux	2009-07-04 21:51:46.000000000 +0200
@@ -0,0 +1,2 @@
+debian/tmp/usr/lib/evas/modules/engines/fb/*/module.so
+debian/tmp/usr/lib/evas/modules/engines/gl_x11/*/module.so
diff -urp evas-0.9.9.060/debian/rules ../evas-0.9.9.060/debian/rules
--- evas-0.9.9.060/debian/rules	2009-07-04 21:39:24.000000000 +0200
+++ ../evas-0.9.9.060/debian/rules	2009-07-04 21:49:40.000000000 +0200
@@ -21,10 +21,13 @@ else
 	arch_flags += --enable-pthreads
 endif
 
+ifeq (linux,$(DEB_HOST_ARCH_OS))
+	arch_flags += --enable-fb
+endif
+
 DEB_CONFIGURE_EXTRA_FLAGS := --enable-strict \
 	--enable-fontconfig \
 	--enable-software-x11 \
-	--enable-fb \
 	--enable-buffer \
 	--enable-gl-x11 \
 	--enable-xrender-x11 \
diff -urp evas-0.9.9.060/src/modules/loaders/svg/evas_image_load_svg.c ../evas-0.9.9.060/src/modules/loaders/svg/evas_image_load_svg.c
--- evas-0.9.9.060/src/modules/loaders/svg/evas_image_load_svg.c	2009-03-01 09:43:20.000000000 +0100
+++ ../evas-0.9.9.060/src/modules/loaders/svg/evas_image_load_svg.c	2009-06-22 10:33:04.000000000 +0200
@@ -38,7 +38,11 @@ svg_loader_unpremul_data(DATA32 *data, u
 int
 evas_image_load_file_head_svg(Image_Entry *ie, const char *file, const char *key __UNUSED__)
 {
+#if !defined(PATH_MAX) && defined(__GLIBC__)   
+   char              *cwd, *pcwd, *p;
+#else
    char               cwd[PATH_MAX], pcwd[PATH_MAX], *p;
+#endif
    
    RsvgHandle         *rsvg;
    RsvgDimensionData   dim;
@@ -68,9 +72,14 @@ evas_image_load_file_head_svg(Image_Entr
      }
    else if (strcasecmp(ext, ".svg")) return 0;
 
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+   pcwd = getcwd(NULL, 0);
+   cwd = strdup(pcwd);
+#else
    getcwd(pcwd, sizeof(pcwd));
    strncpy(cwd, file, sizeof(cwd) - 1);
    cwd[sizeof(cwd) - 1] = 0;
+#endif
    p = strrchr(cwd, '/');
    if (p) *p = 0;
    chdir(cwd);
@@ -127,6 +136,10 @@ evas_image_load_file_head_svg(Image_Entr
    g_object_unref(rsvg);
 //   rsvg_handle_free(rsvg);
    chdir(pcwd);
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+   free(cwd);
+   free(pcwd);
+#endif
    return 1;
 }
 
@@ -135,7 +148,11 @@ int
 evas_image_load_file_data_svg(Image_Entry *ie, const char *file, const char *key __UNUSED__)
 {
    DATA32             *pixels;
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+   char              *cwd, *pcwd, *p;
+#else
    char               cwd[PATH_MAX], pcwd[PATH_MAX], *p;
+#endif
    RsvgHandle         *rsvg;
    RsvgDimensionData   dim;
    int                 w, h;
@@ -166,9 +183,14 @@ evas_image_load_file_data_svg(Image_Entr
      }
    else if (strcasecmp(ext, ".svg")) return 0;
 
+#if !defined(PATH_MAX) && defined(__GLIBC__)
+   pcwd = getcwd(NULL, 0);
+   cwd = strdup(pcwd);
+#else
    getcwd(pcwd, sizeof(pcwd));
    strncpy(cwd, file, sizeof(cwd) - 1);
    cwd[sizeof(cwd) - 1] = 0;
+#endif
    p = strrchr(cwd, '/');
    if (p) *p = 0;
    chdir(cwd);
@@ -265,5 +287,9 @@ evas_image_load_file_data_svg(Image_Entr
 //   rsvg_handle_free(rsvg);
    chdir(pcwd);
    evas_common_image_set_alpha_sparse(ie);
+#if !defined(PATH_MAX) && defined(__GLIBC__)   
+   free(cwd);
+   free(pcwd);
+#endif
    return 1;
 }

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: hurd-i386 (i686-AT386)

Kernel: GNU-Mach 1.3.99/Hurd-0.3
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: hurd-i386 (i686-AT386)

Kernel: GNU-Mach 1.3.99/Hurd-0.3
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash





More information about the Pkg-e-devel mailing list