1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-27 00:57:50 +00:00

- Add freetype2 support

- Use distutils when building for Python-2.x

PR:		55399
Submitted by:	Geoffrey Mainland <mainland@apeiron.net>
This commit is contained in:
Thomas Gellekum 2003-08-11 13:46:37 +00:00
parent c2f1fae07c
commit 0167a113cf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=86757
5 changed files with 89 additions and 8 deletions

View File

@ -8,7 +8,9 @@
PORTNAME= imaging
PORTVERSION= 1.1.4
CATEGORIES= graphics python
MASTER_SITES= http://effbot.org/downloads/
MASTER_SITES= http://www.pythonware.com/downloads/ \
ftp://www.python.org/pub/python/src/ \
ftp://ftp.cwi.nl/pub/python/src/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
DISTNAME= Imaging-${PORTVERSION}
@ -16,7 +18,8 @@ MAINTAINER= tg@FreeBSD.org
COMMENT= The Python Imaging Library
BUILD_DEPENDS= ${PYTHON_SITELIBDIR}/_tkinter.so:${PORTSDIR}/x11-toolkits/py-tkinter
LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg
LIB_DEPENDS= jpeg.9:${PORTSDIR}/graphics/jpeg \
freetype.9:${PORTSDIR}/print/freetype2
RUN_DEPENDS= ${PYTHON_SITELIBDIR}/_tkinter.so:${PORTSDIR}/x11-toolkits/py-tkinter
DIST_SUBDIR= python
@ -27,11 +30,27 @@ CONFIGURE_ARGS= --with-jpeg=${PREFIX}/lib
CONFIGURE_ENV= PYTHON=${PYTHON_CMD}
MAKE_FLAGS= OPT="${CFLAGS}"
.include <bsd.port.pre.mk>
PILDIR= ${PYTHON_SITELIBDIR}/PIL
PILDOCDIR= ${PREFIX}/share/doc/PIL
PILEXDIR= ${PREFIX}/share/examples/PIL
PILINCDIR= ${PREFIX}/include/${PYTHON_VERSION}
.if ${PYTHON_REL} > 200
post-build:
@(cd ${WRKSRC}/..; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYSETUP} build ${PYDISTUTILS_BUILDARGS})
do-install:
@(cd ${WRKSRC}/..; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} ${PYSETUP} install ${PYDISTUTILS_INSTALLARGS})
@${MKDIR} ${PILDOCDIR}
${INSTALL_DATA} ${WRKSRC}/../README ${PILDOCDIR}
@${MKDIR} ${PILEXDIR}
${INSTALL_DATA} ${WRKSRC}/../Scripts/* ${PILEXDIR}
.for file in ImConfig.h ImPlatform.h Imaging.h
${INSTALL_DATA} ${WRKSRC}/${file} ${PILINCDIR}
.endfor
.else
post-extract:
@${CP} ${FILESDIR}/Setup ${WRKSRC}/..
@ -55,5 +74,5 @@ do-install:
.for file in ImConfig.h ImPlatform.h Imaging.h
${INSTALL_DATA} ${WRKSRC}/${file} ${PILINCDIR}
.endfor
.include <bsd.port.mk>
.endif
.include <bsd.port.post.mk>

View File

@ -1,4 +1,5 @@
*shared*
_imaging _imaging.c decode.c encode.c map.c display.c outline.c path.c -IlibImaging libImaging/libImaging.a -I${PREFIX}/include -L${PREFIX}/lib -ljpeg -lz
_imagingft _imagingft.c -IlibImaging -I${PREFIX}/include -I${PREFIX}/include/freetype2 -L${PREFIX}/lib -lfreetype
_imagingtk _imagingtk.c Tk/tkImaging.c -IlibImaging -I${X11BASE}/include -I${PREFIX}/include/tcl8.4 -I${PREFIX}/include/tk8.4 -L${PREFIX}/lib -ltk84 -ltcl84 -L${X11BASE}/lib -lX11

View File

@ -1,5 +1,5 @@
--- ../Makefile.pre.in.orig Wed Apr 23 00:11:24 2003
+++ ../Makefile.pre.in Sat Aug 2 13:56:42 2003
--- ../Makefile.pre.in.orig Tue Apr 22 09:11:24 2003
+++ ../Makefile.pre.in Fri Aug 8 12:08:07 2003
@@ -92,7 +92,7 @@
TARGET= python
@ -18,3 +18,12 @@
LIBS= @LIBS@
LIBM= @LIBM@
LIBC= @LIBC@
@@ -153,7 +153,7 @@
INCLUDEPY= $(INCLUDEDIR)/python$(VERSION)
EXECINCLUDEPY= $(exec_installdir)/include/python$(VERSION)
LIBP= $(exec_installdir)/lib/python$(VERSION)
-DESTSHARED= $(BINLIBDEST)/site-packages
+DESTSHARED= $(BINLIBDEST)/site-packages/PIL
LIBPL= $(LIBP)/config

View File

@ -0,0 +1,51 @@
--- ../setup.py.orig Fri May 9 05:00:56 2003
+++ ../setup.py Wed Aug 6 10:40:45 2003
@@ -51,6 +51,9 @@
if os.path.exists('/sw/lib'):
LIBRARY_DIRS.append('/sw/lib')
+INCLUDE_DIRS.append(os.path.join(os.getenv("PREFIX"), "include"))
+LIBRARY_DIRS.append(os.path.join(os.getenv("PREFIX"), "lib"))
+
HAVE_LIBJPEG = 0
HAVE_LIBTIFF = 0
HAVE_LIBZ = 0
@@ -126,7 +129,13 @@
pass
else:
INCLUDE_DIRS = ["libImaging"]
+ INCLUDE_DIRS.append(os.path.join(os.getenv("X11BASE"), "include"))
+ INCLUDE_DIRS.append(os.path.join(os.getenv("PREFIX"),
+ "include/tcl%s" % TCL_VERSION))
+ INCLUDE_DIRS.append(os.path.join(os.getenv("PREFIX"),
+ "include/tk%s" % TCL_VERSION))
LIBRARY_DIRS = ["libImaging"]
+ LIBRARY_DIRS.append(os.path.join(os.getenv("PREFIX"), "lib"))
LIBRARIES = ["Imaging"]
EXTRA_COMPILE_ARGS = None
EXTRA_LINK_ARGS = None
@@ -206,7 +215,8 @@
if not tk_framework_found:
# assume the libraries are installed in the default location
- LIBRARIES.extend(["tk" + TCL_VERSION, "tcl" + TCL_VERSION])
+ version = TCL_VERSION[0] + TCL_VERSION[2]
+ LIBRARIES.extend(["tk" + version, "tcl" + version])
HAVE_TCLTK = 1
if HAVE_TCLTK:
@@ -266,6 +276,14 @@
# FIXME: search for libraries
LIBRARIES.append("freetype")
INCLUDE_DIRS.append("/usr/include/freetype2")
+ elif os.path.isdir("/usr/local/include/freetype2"):
+ # assume that the freetype library is installed in a
+ # standard location
+ # FIXME: search for libraries
+ LIBRARIES.append("freetype")
+ INCLUDE_DIRS.append("/usr/local/include")
+ INCLUDE_DIRS.append("/usr/local/include/freetype2")
+ LIBRARY_DIRS.append("/usr/local/lib")
elif os.path.isdir("/sw/include/freetype2"):
# assume that the freetype library is installed in a
# standard location

View File

@ -199,12 +199,13 @@ lib/%%PYTHON_VERSION%%/site-packages/PIL/XbmImagePlugin.pyo
lib/%%PYTHON_VERSION%%/site-packages/PIL/XpmImagePlugin.py
lib/%%PYTHON_VERSION%%/site-packages/PIL/XpmImagePlugin.pyc
lib/%%PYTHON_VERSION%%/site-packages/PIL/XpmImagePlugin.pyo
lib/%%PYTHON_VERSION%%/site-packages/PIL/_imaging.so
lib/%%PYTHON_VERSION%%/site-packages/PIL/_imagingft.so
lib/%%PYTHON_VERSION%%/site-packages/PIL/_imagingtk.so
lib/%%PYTHON_VERSION%%/site-packages/PIL/__init__.py
lib/%%PYTHON_VERSION%%/site-packages/PIL/__init__.pyc
lib/%%PYTHON_VERSION%%/site-packages/PIL/__init__.pyo
lib/%%PYTHON_VERSION%%/site-packages/PIL.pth
lib/%%PYTHON_VERSION%%/site-packages/_imaging.so
lib/%%PYTHON_VERSION%%/site-packages/_imagingtk.so
share/doc/PIL/README
share/examples/PIL/README
share/examples/PIL/bdf2pil.py