summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2010-12-06 15:53:25 +0000
committerJustin Lecher <jlec@gentoo.org>2010-12-06 15:53:25 +0000
commitb894e3d9401c2b67e4d51a076f0f7579bb06f5eb (patch)
tree82346f11b6090d67d304645a85b1f474297b136b /dev-python/gdmodule
parentalpha stable wrt #342829 (diff)
downloadgentoo-2-b894e3d9401c2b67e4d51a076f0f7579bb06f5eb.tar.gz
gentoo-2-b894e3d9401c2b67e4d51a076f0f7579bb06f5eb.tar.bz2
gentoo-2-b894e3d9401c2b67e4d51a076f0f7579bb06f5eb.zip
Correct handling of image type support, thanks cschwan for providing the patches, #347722
(Portage version: 2.2.0_alpha7/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/gdmodule')
-rw-r--r--dev-python/gdmodule/ChangeLog9
-rw-r--r--dev-python/gdmodule/files/gdmodule-0.56-fix-libs.patch116
-rw-r--r--dev-python/gdmodule/gdmodule-0.56-r1.ebuild30
-rw-r--r--dev-python/gdmodule/gdmodule-0.56-r2.ebuild46
4 files changed, 170 insertions, 31 deletions
diff --git a/dev-python/gdmodule/ChangeLog b/dev-python/gdmodule/ChangeLog
index 3dd89e33c15d..6a631b4e7a4b 100644
--- a/dev-python/gdmodule/ChangeLog
+++ b/dev-python/gdmodule/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for dev-python/gdmodule
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/gdmodule/ChangeLog,v 1.3 2010/11/25 14:14:40 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/gdmodule/ChangeLog,v 1.4 2010/12/06 15:53:25 jlec Exp $
+
+*gdmodule-0.56-r2 (06 Dec 2010)
+
+ 06 Dec 2010; Justin Lecher <jlec@gentoo.org> -gdmodule-0.56-r1.ebuild,
+ +gdmodule-0.56-r2.ebuild, +files/gdmodule-0.56-fix-libs.patch:
+ Correct handling of image type support, thanks cschwan for providing the
+ patches, #347722
*gdmodule-0.56-r1 (25 Nov 2010)
diff --git a/dev-python/gdmodule/files/gdmodule-0.56-fix-libs.patch b/dev-python/gdmodule/files/gdmodule-0.56-fix-libs.patch
new file mode 100644
index 000000000000..bb46490986a9
--- /dev/null
+++ b/dev-python/gdmodule/files/gdmodule-0.56-fix-libs.patch
@@ -0,0 +1,116 @@
+--- Setup.py.orig 2005-03-11 04:29:59.000000000 +0000
++++ Setup.py 2010-12-06 07:15:26.332707178 +0000
+@@ -1,102 +1,11 @@
+ # Setup for gdmodule 0.50 and later
+
+ from distutils.core import setup, Extension
+-import os, glob, sys, string
+
+ # version of this gdmodule package
+ this_version = "0.56"
+
+-# directory existence tester
+-
+-def dirtest(lst):
+- rlst = []
+- for d in lst:
+- try:
+- if os.listdir(d):
+- rlst.append(d)
+- except:
+- pass
+- return rlst
+-
+-def filetest(path, names):
+- rlst = []
+- for d in path:
+- for i in range(len(names)):
+- found = glob.glob(os.path.join(d, "lib%s.*" % names[i]))
+- if found:
+- rlst.append(names[i])
+- names[i] = None
+- names = filter(None, names)
+- return rlst
+-
+-def remove(itm, lst):
+- r = range(len(lst))
+- r.reverse()
+- for i in r:
+- if lst[i] == itm:
+- del lst[i]
+-
+-# library_dirs option is rather non-portable, but since I am targetting
+-# Unixoid OS's I will just look for the usual suspects.
+-
+-libdirs = dirtest([
+- "/usr/local/lib", "/sw/lib", "/usr/lib",
+- "/usr/lib/X11", "/usr/X11R6/lib",
+- "/opt/gnome/lib",
+-])
+-
+-# include_dirs are also non-portable; same trick here.
+-
+-incdirs = dirtest([
+- "/usr/local/include", "/sw/include", "/usr/include",
+- "/usr/include/X11", "/usr/X11R6/include",
+- "/opt/gnome/include",
+-])
+-
+-# Try to identify our libraries
+-
+-want_libs = [
+- "gd",
+- "jpeg", "png", "gif", "z",
+- "X11", "Xpm",
+- "ttf", "freetype",
+-]
+-
+-libs = filetest(libdirs, want_libs)
+-
+-missing = []
+-
+-for l in want_libs:
+- if l and l not in libs:
+- missing.append(l)
+-
+-if missing:
+- print "WARNING: Missing", string.join(missing, ", "), "Libraries"
+-
+-# hand-clean the libs
+-
+-if "gd" not in libs:
+- print "Can't find GD library."
+- sys.exit(0)
+-
+-if "ttf" in libs and "freetype" in libs:
+- remove("ttf", libs)
+-
+-if "Xpm" in libs and "X11" not in libs:
+- remove("Xpm", libs)
+-
+-if "png" in libs and "z" not in libs:
+- remove("png", libs)
+-
+-if "z" in libs and "png" not in libs:
+- remove("png", libs)
+-
+-# build the macro list
+-
+-macros = []
+-
+-for l in libs:
+- macros.append(( "HAVE_LIB%s" % l.upper(), None ))
++libs = [ "gd" ]
+
+ # OK, now do it!
+
+@@ -111,8 +20,7 @@
+ py_modules=["gd"],
+ ext_modules=[
+ Extension("_gd", ["_gdmodule.c"],
+- include_dirs=incdirs, library_dirs=libdirs,
+- libraries=libs, define_macros=macros)],
++ libraries=libs)],
+ )
+
+ # end of file... I guess we're done.
diff --git a/dev-python/gdmodule/gdmodule-0.56-r1.ebuild b/dev-python/gdmodule/gdmodule-0.56-r1.ebuild
deleted file mode 100644
index 30524bff7e41..000000000000
--- a/dev-python/gdmodule/gdmodule-0.56-r1.ebuild
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 1999-2010 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/gdmodule/gdmodule-0.56-r1.ebuild,v 1.1 2010/11/25 14:14:40 jlec Exp $
-
-EAPI="3"
-
-PYTHON_DEPEND="2"
-SUPPORT_PYTHON_ABIS="1"
-
-inherit distutils eutils
-
-DESCRIPTION="Python extensions for gd"
-HOMEPAGE="http://newcenturycomputers.net/projects/gdmodule.html"
-SRC_URI="http://newcenturycomputers.net/projects/download.cgi/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-linux ~ppc-macos"
-IUSE=""
-
-RDEPEND="media-libs/gd"
-DEPEND="${RDEPEND}"
-
-RESTRICT_PYTHON_ABIS="3.*"
-
-src_prepare() {
- epatch "${FILESDIR}"/${PV}-libs.patch
- mv Setup.py setup.py
- distutils_src_prepare
-}
diff --git a/dev-python/gdmodule/gdmodule-0.56-r2.ebuild b/dev-python/gdmodule/gdmodule-0.56-r2.ebuild
new file mode 100644
index 000000000000..fba512d4e46a
--- /dev/null
+++ b/dev-python/gdmodule/gdmodule-0.56-r2.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/gdmodule/gdmodule-0.56-r2.ebuild,v 1.1 2010/12/06 15:53:25 jlec Exp $
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+SUPPORT_PYTHON_ABIS="1"
+
+inherit distutils eutils flag-o-matic
+
+DESCRIPTION="Python extensions for gd"
+HOMEPAGE="http://newcenturycomputers.net/projects/gdmodule.html"
+SRC_URI="http://newcenturycomputers.net/projects/download.cgi/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-linux ~ppc-macos"
+IUSE="jpeg png truetype xpm"
+
+RDEPEND="
+ media-libs/gd[jpeg?,png?,truetype?,xpm?]
+ media-libs/giflib
+ jpeg? ( virtual/jpeg )
+ png? ( media-libs/libpng )
+ truetype? ( media-libs/freetype:2 )
+ xpm? ( x11-libs/libXpm )"
+DEPEND="${RDEPEND}"
+
+RESTRICT_PYTHON_ABIS="3.*"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-fix-libs.patch
+
+ # append unconditionally because it is enabled id media-libs/gd by default
+ append-cppflags -DHAVE_LIBGIF
+
+ use jpeg && append-cppflags -DHAVE_LIBJPEG
+ use png && append-cppflags -DHAVE_LIBPNG
+ use truetype && append-cppflags -DHAVE_LIBFREETYPE
+ use xpm && append-cppflags -DHAVE_LIBXPM
+
+ mv Setup.py setup.py
+
+ distutils_src_prepare
+}