[97326] trunk/dports/graphics/gegl
jeremyhu at macports.org
jeremyhu at macports.org
Mon Sep 3 15:01:52 PDT 2012
Revision: 97326
https://trac.macports.org/changeset/97326
Author: jeremyhu at macports.org
Date: 2012-09-03 15:01:51 -0700 (Mon, 03 Sep 2012)
Log Message:
-----------
gegl: Make some strides to cleaning up the source for altivec, but in the end just giving up and using -fno-altivec. If someone wants to finish the work, this is a good starting point...
Modified Paths:
--------------
trunk/dports/graphics/gegl/Portfile
Added Paths:
-----------
trunk/dports/graphics/gegl/files/rename-for-altivec.patch
Modified: trunk/dports/graphics/gegl/Portfile
===================================================================
--- trunk/dports/graphics/gegl/Portfile 2012-09-03 21:59:30 UTC (rev 97325)
+++ trunk/dports/graphics/gegl/Portfile 2012-09-03 22:01:51 UTC (rev 97326)
@@ -46,7 +46,7 @@
port:libspiro \
port:lensfun
-patchfiles patch-configure.diff opencl.patch
+patchfiles patch-configure.diff opencl.patch rename-for-altivec.patch
configure.args --disable-docs \
--disable-silent-rules \
@@ -61,11 +61,6 @@
post-patch {
# http://trac.macports.org/ticket/35148
if {${os.major} < 10} {
- foreach header [glob ${worksrcpath}/{,*/,*/*/}*.h] {
- reinplace "s|__MAC_10_6|__MAC_NA|g" ${header}
- reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_\\(.\\)_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6|AVAILABLE_MAC_OS_X_VERSION_10_\\1_AND_LATER|" ${header}
- reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER|__attribute__((unavailable))|g" ${header}
- }
reinplace "s|OpenGL/CGLDevice.h|OpenGL/CGLTypes.h|" ${worksrcpath}/gegl/opencl/cl_gl.h
}
}
@@ -74,6 +69,11 @@
if {[variant_isset universal]} {
# In order to build universal on Leopard, you need MacPorts 2.1
set merger_configure_args(x86_64) --build=${build_arch}-apple-${os.platform}${os.version}
+ set merger_configure_cflags(ppc) -fno-altivec
+ set merger_configure_cxxflags(ppc) -fno-altivec
+ } elseif {${build_arch} == "ppc"} {
+ configure.cflags-append -fno-altivec
+ configure.cxxflags-append -fno-altivec
} elseif {${build_arch} == "x86_64"} {
configure.args-append --build=${build_arch}-apple-${os.platform}${os.version}
}
Added: trunk/dports/graphics/gegl/files/rename-for-altivec.patch
===================================================================
--- trunk/dports/graphics/gegl/files/rename-for-altivec.patch (rev 0)
+++ trunk/dports/graphics/gegl/files/rename-for-altivec.patch 2012-09-03 22:01:51 UTC (rev 97326)
@@ -0,0 +1,152 @@
+--- gegl/property-types/gegl-color.h.orig 2012-09-03 14:04:13.000000000 -0700
++++ gegl/property-types/gegl-color.h 2012-09-03 14:04:28.000000000 -0700
+@@ -107,7 +107,7 @@ void gegl_color_set_rgba
+ */
+ void gegl_color_set_pixel (GeglColor *color,
+ const Babl *format,
+- const void *pixel);
++ const void *pixelp);
+ /**
+ * gegl_color_get_pixel:
+ * @color: a #GeglColor
+@@ -118,7 +118,7 @@ void gegl_color_set_pixel
+ */
+ void gegl_color_get_pixel (GeglColor *color,
+ const Babl *format,
+- void *pixel);
++ void *pixelp);
+
+ /***
+ */
+--- operations/common/envelopes.h.orig 2012-09-03 14:29:05.000000000 -0700
++++ operations/common/envelopes.h 2012-09-03 14:31:00.000000000 -0700
+@@ -59,12 +59,12 @@ sample (gfloat *buf,
+ gint y,
+ gfloat *dst)
+ {
+- gfloat *pixel = (buf + ((width * y) + x) * 4);
++ gfloat *pixelp = (buf + ((width * y) + x) * 4);
+ gint c;
+
+ for (c=0;c<4;c++)
+ {
+- dst[c] = pixel[c];
++ dst[c] = pixelp[c];
+ }
+ }
+
+@@ -119,17 +119,17 @@ retry: /* if we've
+ goto retry;
+
+ {
+- gfloat *pixel = (buf + ((width * v) + u) * 4);
++ gfloat *pixelp = (buf + ((width * v) + u) * 4);
+
+- if (pixel[3]>0.0) /* ignore fully transparent pixels */
++ if (pixelp[3]>0.0) /* ignore fully transparent pixels */
+ {
+ for (c=0;c<3;c++)
+ {
+- if (pixel[c]<best_min[c])
+- best_min[c]=pixel[c];
++ if (pixelp[c]<best_min[c])
++ best_min[c]=pixelp[c];
+
+- if (pixel[c]>best_max[c])
+- best_max[c]=pixel[c];
++ if (pixelp[c]>best_max[c])
++ best_max[c]=pixelp[c];
+ }
+ }
+ else
+@@ -162,7 +162,7 @@ static inline void compute_envelopes (gf
+ gint c;
+ gfloat range_sum[4] = {0,0,0,0};
+ gfloat relative_brightness_sum[4] = {0,0,0,0};
+- gfloat *pixel = buf + (width*y+x)*4;
++ gfloat *pixelp = buf + (width*y+x)*4;
+
+ /* compute lookuptables for the gamma, currently not used/exposed
+ * as a tweakable property */
+@@ -193,7 +193,7 @@ static inline void compute_envelopes (gf
+
+ if (range>0.0)
+ {
+- relative_brightness = (pixel[c] - min[c]) / range;
++ relative_brightness = (pixelp[c] - min[c]) / range;
+ }
+ else
+ {
+@@ -211,8 +211,8 @@ static inline void compute_envelopes (gf
+ gfloat range = range_sum[c] / iterations;
+
+ if (max_envelope)
+- max_envelope[c] = pixel[c] + (1.0 - relative_brightness) * range;
++ max_envelope[c] = pixelp[c] + (1.0 - relative_brightness) * range;
+ if (min_envelope)
+- min_envelope[c] = pixel[c] - relative_brightness * range;
++ min_envelope[c] = pixelp[c] - relative_brightness * range;
+ }
+ }
+--- operations/common/c2g.c.orig 2012-09-03 14:31:40.000000000 -0700
++++ operations/common/c2g.c 2012-09-03 14:33:21.000000000 -0700
+@@ -75,7 +75,7 @@ static void c2g (GeglBuffer *sr
+ gint src_offset = (inw*y+radius)*4;
+ for (x=radius; x<outw+radius; x++)
+ {
+- gfloat *pixel= src_buf + src_offset;
++ gfloat *pixelp= src_buf + src_offset;
+ gfloat min[4];
+ gfloat max[4];
+
+@@ -99,8 +99,8 @@ static void c2g (GeglBuffer *sr
+ gint c;
+ for (c=0; c<3; c++)
+ {
+- nominator += (pixel[c] - min[c]) * (pixel[c] - min[c]);
+- denominator += (pixel[c] - max[c]) * (pixel[c] - max[c]);
++ nominator += (pixelp[c] - min[c]) * (pixelp[c] - min[c]);
++ denominator += (pixelp[c] - max[c]) * (pixelp[c] - max[c]);
+ }
+
+ nominator = sqrt (nominator);
+--- ./operations/external/path.c.orig 2012-09-03 14:37:58.000000000 -0700
++++ ./operations/external/path.c 2012-09-03 14:38:23.000000000 -0700
+@@ -75,7 +75,7 @@ typedef struct StampStatic {
+
+ static void gegl_path_stroke (GeglBuffer *buffer,
+ const GeglRectangle *clip_rect,
+- GeglPath *vector,
++ GeglPath *vectorp,
+ GeglColor *color,
+ gdouble linewidth,
+ gdouble hardness,
+@@ -93,7 +93,7 @@ static void gegl_path_stamp (GeglBuffe
+ static void
+ gegl_path_stroke (GeglBuffer *buffer,
+ const GeglRectangle *clip_rect,
+- GeglPath *vector,
++ GeglPath *vectorp,
+ GeglColor *color,
+ gdouble linewidth,
+ gdouble hardness,
+@@ -106,7 +106,7 @@ gegl_path_stroke (GeglBuffer *buffer,
+ gdouble xmin, xmax, ymin, ymax;
+ GeglRectangle extent;
+
+- if (!vector)
++ if (!vectorp)
+ return;
+
+ if (!clip_rect)
+@@ -115,8 +115,8 @@ gegl_path_stroke (GeglBuffer *buffer,
+ clip_rect = gegl_buffer_get_extent (buffer);
+ }
+
+- iter = gegl_path_get_flat_path (vector);
+- gegl_path_get_bounds (vector, &xmin, &xmax, &ymin, &ymax);
++ iter = gegl_path_get_flat_path (vectorp);
++ gegl_path_get_bounds (vectorp, &xmin, &xmax, &ymin, &ymax);
+ extent.x = floor (xmin);
+ extent.y = floor (ymin);
+ extent.width = ceil (xmax) - extent.x;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120903/fbfb51e0/attachment.html>
More information about the macports-changes
mailing list