In Ubuntu, we've applied the attached patch to achieve the following:

  * debian/patches/06_fix_missing_includes.dpatch: Fix missing
    includes causes compilation problem. (LP: #393923, Closes: #575620)
  * debian/patches/05_fix_recursion_crash.dpatch: Update patch,
    it's necessary to fix compilation problem.

We thought you might be interested in doing the same. 
diff -u agg-2.5+dfsg1/debian/changelog agg-2.5+dfsg1/debian/changelog
--- agg-2.5+dfsg1/debian/changelog
+++ agg-2.5+dfsg1/debian/changelog
@@ -1,3 +1,13 @@
+agg (2.5+dfsg1-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * debian/patches/06_fix_missing_includes.dpatch: Fix missing
+    includes causes compilation problem. (LP: #393923, Closes: #575620)
+  * debian/patches/05_fix_recursion_crash.dpatch: Update patch,
+    it's necessary to fix compilation problem.
+
+ -- Artur Rona <ari-tc...@ubuntu.com>  Mon, 23 Aug 2010 13:09:57 +0200
+
 agg (2.5+dfsg1-3) unstable; urgency=low
 
   * debian/patches/05_fix_recursion_crash:
diff -u agg-2.5+dfsg1/debian/patches/05_fix_recursion_crash.dpatch agg-2.5+dfsg1/debian/patches/05_fix_recursion_crash.dpatch
--- agg-2.5+dfsg1/debian/patches/05_fix_recursion_crash.dpatch
+++ agg-2.5+dfsg1/debian/patches/05_fix_recursion_crash.dpatch
@@ -3,7 +3,7 @@
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
 ## DP: Ubuntu: http://launchpad.net/bugs/344849
-## DP: Patch: https://trac.mapnik.org/ticket/253
+## DP: Patch: https://trac.mapnik.org/ticket/253, http://trac.mapnik.org/changeset/1801
 ## DP: Description: Avoid a crash caused by an infinite recursion when drawing extremely long lines
 
 @DPATCH@
@@ -16,8 +16,8 @@
              int cy = (y1 + y2) >> 1;
 +
 +            // Bail if values are so large they are likely to wrap
-+            if ((abs(x1) >= INT_MAX/2) || (abs(y1) >= INT_MAX/2) ||
-+                (abs(x2) >= INT_MAX/2) || (abs(y2) >= INT_MAX/2))
++            if ((std::abs(x1) >= std::numeric_limits<int>::max()/2) || (std::abs(y1) >= std::numeric_limits<int>::max()/2) ||
++                (std::abs(x2) >= std::numeric_limits<int>::max()/2) || (std::abs(y2) >= std::numeric_limits<int>::max()/2))
 +                    return;
 +
              line(x1, y1, cx, cy);
diff -u agg-2.5+dfsg1/debian/patches/00list agg-2.5+dfsg1/debian/patches/00list
--- agg-2.5+dfsg1/debian/patches/00list
+++ agg-2.5+dfsg1/debian/patches/00list
@@ -5,0 +6 @@
+06_fix_missing_includes.dpatch
only in patch2:
unchanged:
--- agg-2.5+dfsg1.orig/debian/patches/06_fix_missing_includes.dpatch
+++ agg-2.5+dfsg1/debian/patches/06_fix_missing_includes.dpatch
@@ -0,0 +1,22 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## From: Artur Rona
+## Description: Add missing includes for fix compile.
+## Bug: https://launchpad.net/bugs/393923
+## Origin: upstream, https://trac.mapnik.org/changeset/1801
+## Author: Dane Springmeyer
+
+...@dpatch@
+
+diff -pruN -x '*~' agg-2.5+dfsg1.orig/include/agg_rasterizer_cells_aa.h agg-2.5+dfsg1/include/agg_rasterizer_cells_aa.h
+--- agg-2.5+dfsg1.orig/include/agg_rasterizer_cells_aa.h	2007-10-11 00:06:16.000000000 +0200
++++ agg-2.5+dfsg1/include/agg_rasterizer_cells_aa.h	2010-08-23 01:51:07.000000000 +0200
+@@ -40,7 +40,8 @@
+ #define AGG_RASTERIZER_CELLS_AA_INCLUDED
+ 
+ #include <string.h>
+-#include <math.h>
++#include <cstdlib>
++#include <limits>
+ #include "agg_math.h"
+ #include "agg_array.h"
+ 

Attachment: 05_fix_recursion_crash.dpatch
Description: application/shellscript

Attachment: 06_fix_missing_includes.dpatch
Description: application/shellscript

Reply via email to