aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonnie Berkholz <dberkholz@gentoo.org>2010-06-10 15:51:16 -0500
committerDonnie Berkholz <dberkholz@gentoo.org>2010-06-10 15:51:16 -0500
commit833c86db2be62ab89901eb89b71fd676131d8f89 (patch)
treecd9f59942c801b42200e185b8fed2bb9f57ab0cf /dev-python
parentagg: add a patch for aggdraw, which wants a private member. (diff)
downloaddberkholz-833c86db2be62ab89901eb89b71fd676131d8f89.tar.gz
dberkholz-833c86db2be62ab89901eb89b71fd676131d8f89.tar.bz2
dberkholz-833c86db2be62ab89901eb89b71fd676131d8f89.zip
Initial aggdraw ebuild; high-quality, antialiased, subpixel Python drawing.
Patched to build against system freetype and agg. The setup.py changes need more work to make them suitable for upstream; currently, things are hardcoded for /usr.
Diffstat (limited to 'dev-python')
-rw-r--r--dev-python/aggdraw/Manifest2
-rw-r--r--dev-python/aggdraw/aggdraw-1.2_alpha3.ebuild25
-rw-r--r--dev-python/aggdraw/files/build-against-external-agg-2.5-and-freetype.patch147
3 files changed, 174 insertions, 0 deletions
diff --git a/dev-python/aggdraw/Manifest b/dev-python/aggdraw/Manifest
new file mode 100644
index 0000000..2e27837
--- /dev/null
+++ b/dev-python/aggdraw/Manifest
@@ -0,0 +1,2 @@
+AUX build-against-external-agg-2.5-and-freetype.patch 4564 RMD160 c196a69f86b02733f6fe18abeb3fa305c667baa8 SHA1 5d6607b63a3e531bb0ce1cc722ab0e5c6b3f923d SHA256 660a184cdedd0adf1ea31d0fbb8f10df908ab361b29e92e25bdad8b9c3c5ace5
+EBUILD aggdraw-1.2_alpha3.ebuild 695 RMD160 f9a67fb9c92e6787022d385e596ace1ed38ab142 SHA1 7bd3ebd0b6bf51b9d3bca2c4ab774e59cfcaa980 SHA256 6c09d0e833fd556565f7d0269001d09870d71d4705c0b3b54ea0bef4de785397
diff --git a/dev-python/aggdraw/aggdraw-1.2_alpha3.ebuild b/dev-python/aggdraw/aggdraw-1.2_alpha3.ebuild
new file mode 100644
index 0000000..80e4a03
--- /dev/null
+++ b/dev-python/aggdraw/aggdraw-1.2_alpha3.ebuild
@@ -0,0 +1,25 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=2
+ESVN_REPO_URI="http://svn.effbot.org/public/tags/aggdraw-1.2a3-20060212"
+
+inherit eutils distutils subversion
+
+DESCRIPTION="Python library for high-quality drawing, with anti-aliasing and alpha compositing"
+HOMEPAGE="effbot.org/zone/aggdraw-index.htm"
+#SRC_URI=""
+LICENSE="ElementTree"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+RDEPEND="x11-libs/agg
+ media-libs/freetype:2"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ # clean out bundled x11-libs/agg copy to make sure we don't use it
+ rm -rf agg2/ || die
+ epatch "${FILESDIR}"/build-against-external-agg-2.5-and-freetype.patch
+}
diff --git a/dev-python/aggdraw/files/build-against-external-agg-2.5-and-freetype.patch b/dev-python/aggdraw/files/build-against-external-agg-2.5-and-freetype.patch
new file mode 100644
index 0000000..d2e3b3e
--- /dev/null
+++ b/dev-python/aggdraw/files/build-against-external-agg-2.5-and-freetype.patch
@@ -0,0 +1,147 @@
+Only in aggdraw-1.2a3-20060212.orig/: agg2
+diff -ur aggdraw-1.2a3-20060212.orig//aggdraw.cxx aggdraw-1.2a3-20060212//aggdraw.cxx
+--- aggdraw-1.2a3-20060212.orig//aggdraw.cxx 2010-06-10 15:34:22.460926514 -0500
++++ aggdraw-1.2a3-20060212//aggdraw.cxx 2010-06-10 15:29:40.743468594 -0500
+@@ -69,9 +69,9 @@
+ #include "agg_font_freetype.h"
+ #endif
+ #include "agg_path_storage.h"
+-#include "agg_pixfmt_gray8.h"
+-#include "agg_pixfmt_rgb24.h"
+-#include "agg_pixfmt_rgba32.h"
++#include "agg_pixfmt_gray.h"
++#include "agg_pixfmt_rgb.h"
++#include "agg_pixfmt_rgba.h"
+ #include "agg_rasterizer_scanline_aa.h"
+ #include "agg_renderer_scanline.h"
+ #include "agg_rendering_buffer.h"
+@@ -315,7 +315,7 @@
+ p = new agg::path_storage();
+ agg::conv_transform<agg::path_storage, agg::trans_affine>
+ tp(path, *self->transform);
+- p->add_path(tp, 0, false);
++ p->concat_path(tp, 0);
+ } else
+ p = &path;
+
+@@ -847,7 +847,7 @@
+ false
+ );
+ arc.approximation_scale(1);
+- path.add_path(arc);
++ path.concat_path(arc);
+
+ self->draw->draw(path, pen);
+
+@@ -873,7 +873,7 @@
+ false
+ );
+ arc.approximation_scale(1);
+- path.add_path(arc);
++ path.concat_path(arc);
+ path.close_polygon();
+
+ self->draw->draw(path, pen, brush);
+@@ -895,7 +895,7 @@
+ agg::path_storage path;
+ agg::ellipse ellipse((x1+x0)/2, (y1+y0)/2, (x1-x0)/2, (y1-y0)/2, 8);
+ ellipse.approximation_scale(1);
+- path.add_path(ellipse);
++ path.concat_path(ellipse);
+
+ self->draw->draw(path, pen, brush);
+
+@@ -951,7 +951,7 @@
+ false
+ );
+ arc.approximation_scale(1);
+- path.add_path(arc);
++ path.concat_path(arc);
+ path.line_to(x, y);
+ path.close_polygon();
+
+@@ -1034,7 +1034,7 @@
+ agg::conv_transform<agg::path_storage, agg::trans_affine>
+ tp(*symbol->path, transform);
+ agg::path_storage p;
+- p.add_path(tp, 0, false);
++ p.concat_path(tp, 0);
+ self->draw->draw(p, pen, brush);
+ }
+
+@@ -1699,7 +1699,7 @@
+ agg::path_storage* path = self->path;
+ agg::conv_curve<agg::path_storage> curve(*path);
+ self->path = new agg::path_storage();
+- self->path->add_path(curve, 0, false);
++ self->path->concat_path(curve, 0);
+ delete path;
+ }
+
+@@ -1822,7 +1822,7 @@
+ path.close_polygon();
+ delete xy;
+
+- self->path->add_path(path, 0, false);
++ self->path->concat_path(path, 0);
+
+ Py_INCREF(Py_None);
+ return Py_None;
+Only in aggdraw-1.2a3-20060212/: aggdraw.cxx.orig
+Only in aggdraw-1.2a3-20060212/: build
+diff -ur aggdraw-1.2a3-20060212.orig//setup.py aggdraw-1.2a3-20060212//setup.py
+--- aggdraw-1.2a3-20060212.orig//setup.py 2010-06-10 15:34:22.450961294 -0500
++++ aggdraw-1.2a3-20060212//setup.py 2010-06-10 15:45:57.903468873 -0500
+@@ -29,43 +29,29 @@
+ """
+
+ # pointer to freetype build directory (tweak as necessary)
+-FREETYPE_ROOT = "../../kits/freetype-2.1.10"
++#FREETYPE_ROOT = "../../kits/freetype-2.1.10"
++FREETYPE_ROOT = "/usr"
+
+ if not os.path.isdir(FREETYPE_ROOT):
+ print "===", "freetype not available (edit setup.py to enable)"
+ FREETYPE_ROOT = None
+
+-sources = [
+- # source code currently used by aggdraw
+- # FIXME: link against AGG library instead?
+- "agg2/src/agg_arc.cpp",
+- "agg2/src/agg_bezier_arc.cpp",
+- "agg2/src/agg_curves.cpp",
+- "agg2/src/agg_path_storage.cpp",
+- "agg2/src/agg_rasterizer_scanline_aa.cpp",
+- "agg2/src/agg_trans_affine.cpp",
+- "agg2/src/agg_vcgen_contour.cpp",
+- # "agg2/src/agg_vcgen_dash.cpp",
+- "agg2/src/agg_vcgen_stroke.cpp",
+- ]
++sources = []
+
+ defines = []
+
+-include_dirs = ["agg2/include"]
++include_dirs = ["/usr/include/agg2"]
+ library_dirs = []
+
+-libraries = []
++libraries = ["agg"]
+
+ if FREETYPE_ROOT:
+ defines.append(("HAVE_FREETYPE2", None))
+- sources.extend([
+- "agg2/font_freetype/agg_font_freetype.cpp",
+- ])
+- include_dirs.append("agg2/font_freetype")
++ include_dirs.append("/usr/include/agg2/font_freetype")
+ include_dirs.append(os.path.join(FREETYPE_ROOT, "include"))
+ include_dirs.append(os.path.join(FREETYPE_ROOT, "include/freetype2"))
+ library_dirs.append(os.path.join(FREETYPE_ROOT, "lib"))
+- libraries.append("freetype")
++ libraries.extend(["freetype", "aggfontfreetype"])
+
+ if sys.platform == "win32":
+ libraries.extend(["kernel32", "user32", "gdi32"])
+Only in aggdraw-1.2a3-20060212/: setup.py.orig
+Only in aggdraw-1.2a3-20060212.orig/: .svn