Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Dec 2001 00:02:34 -0800 (PST)
From:      KATO Tsuguru <tkato@prontomail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/32854: Update port: graphics/gd (fix ports/31451)
Message-ID:  <200112150802.fBF82Yl90462@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         32854
>Category:       ports
>Synopsis:       Update port: graphics/gd (fix ports/31451)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 15 00:10:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     KATO Tsuguru
>Release:        4.4-RELEASE i386
>Organization:
>Environment:
>Description:
- Support CFLAGS properly
- Fix compilation error when both FreeType and FreeType2 exist
- Fix Xpm support
- Use freetype-config to find include path and library path

This PR supersedes ports/31451.
ports/26104 shoule also be closed with this PR.

>How-To-Repeat:

>Fix:
diff -urN /usr/ports/graphics/gd/Makefile graphics/gd/Makefile
--- /usr/ports/graphics/gd/Makefile	Fri Oct 26 23:11:28 2001
+++ graphics/gd/Makefile	Mon Dec 10 21:51:09 2001
@@ -7,7 +7,7 @@
 
 PORTNAME=	gd
 PORTVERSION=	1.8.4
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES+=	graphics
 MASTER_SITES=	http://www.boutell.com/gd/http/ \
 		ftp://ftp.boutell.com/pub/boutell/gd/ \
@@ -19,37 +19,42 @@
 
 MAINTAINER?=	ports@FreeBSD.org
 
+BUILD_DEPENDS=	freetype-config:${PORTSDIR}/print/freetype2     # XXX
+LIB_DEPENDS=	jpeg.9:${PORTSDIR}/graphics/jpeg \
+		png.5:${PORTSDIR}/graphics/png \
+		freetype.7:${PORTSDIR}/print/freetype2
 .if !exists(/usr/bin/bzip2)
 BUILD_DEPENDS+=	bzip2:${PORTSDIR}/archivers/bzip2
 .endif
-LIB_DEPENDS=	png.5:${PORTSDIR}/graphics/png \
-		jpeg.9:${PORTSDIR}/graphics/jpeg \
-		freetype:${PORTSDIR}/print/freetype2
 
-USE_FREETYPE2=	yes
+FREETYPE_CONFIG?=       ${LOCALBASE}/bin/freetype-config
+
+MAKE_ENV=	FREETYPE_CONFIG="${FREETYPE_CONFIG}"
+INSTALLS_SHLIB=	yes
 
 .if defined(WITH_X11)
-USE_XLIB=	yes
 USE_XPM=	yes
 .endif
 
-INSTALLS_SHLIB=	yes
-
-DOCS=		index.html
+pre-everything::
+.if !defined(WITH_X11)
+	@${ECHO_MSG}
+	@${ECHO_MSG} "If you want to compile with Xpm support,"
+	@${ECHO_MSG} "hst Ctrl-C right now and use \"make WITH_X11=yes\""
+	@${ECHO_MSG}
+.endif
 
 post-extract:
-	bzip2 -d < ${_DISTDIR}/gd_gif_in.c.bz2 > ${WRKSRC}/gd_gif_in.c
+	@bzip2 -dc ${DISTDIR}/${DIST_SUBDIR}/gd_gif_in.c.bz2 \
+		> ${WRKSRC}/gd_gif_in.c
 
-pre-everything:
-.if !defined(WITH_X11)
-	@${ECHO_MSG} "If you want to compile in X support use "
-	@${ECHO_MSG} "'make -DWITH_X11' instead"
-.endif
+post-patch:
+	@${PERL} -pi -e 's|<malloc.h>|<stdlib.h>|g' ${WRKSRC}/gdcache.h
 
 post-install:
 .if !defined(NOPORTDOCS)
-	${MKDIR} ${DOCSDIR}
-	${INSTALL_DATA} ${DOCS:S,^,${WRKSRC}/,} ${DOCSDIR}
+	@${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/index.html ${DOCSDIR}
 .endif
 
 .include <bsd.port.mk>
diff -urN /usr/ports/graphics/gd/files/patch-ac graphics/gd/files/patch-ac
--- /usr/ports/graphics/gd/files/patch-ac	Tue Aug 21 10:30:32 2001
+++ graphics/gd/files/patch-ac	Tue Oct 23 20:08:09 2001
@@ -1,6 +1,6 @@
---- Makefile.orig	Thu Feb 22 09:03:43 2001
-+++ Makefile	Sat Feb 24 16:25:23 2001
-@@ -3,11 +3,11 @@
+--- Makefile.orig	Fri Feb 23 02:03:43 2001
++++ Makefile	Tue Oct 23 19:47:37 2001
+@@ -3,21 +3,28 @@
  #If you do not have gcc, change the setting for COMPILER, but you must
  #use an ANSI standard C compiler (NOT the old SunOS 4.1.3 cc
  #compiler; get gcc if you are still using it). 
@@ -14,15 +14,18 @@
  
  #If you don't have FreeType, libjpeg and/or Xpm installed, including the
  #header files, uncomment this (default). You really must install
-@@ -16,8 +16,14 @@
+ #libpng and zlib to get anywhere if you wish to create PNG images.
+-CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG
++#CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG
  
  #If you do have FreeType, libjpeg and/or Xpm fully installed, uncomment a
  #variation of this and comment out the line above. See also LIBS below.
 -#CFLAGS=-O -DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG \
 -#	-DHAVE_LIBFREETYPE -DHAVE_LIBTTF 
-+CFLAGS=-O -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE
++CFLAGS+=-DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_LIBFREETYPE
++
 +.if defined(WITH_X11)
-+CFLAGS+=-DHAVE_LIBXPM 
++CFLAGS+=-DHAVE_XPM 
 +.endif
 +
 +.if defined(JISX0208)
@@ -31,12 +34,12 @@
  
  #To use the old FreeType 1.x library, add this additional #define
  #to the line above
-@@ -30,13 +36,15 @@
+@@ -30,13 +37,15 @@
  #Some systems are very picky about link order. They don't all agree
  #on the right order, either.
  
 -LIBS=-lgd -lpng -lz -lm
-+LIBS=-lgd -lpng -lz -ljpeg -lfreetype -lm
++LIBS=-lgd -lpng -lz -ljpeg -lm `$(FREETYPE_CONFIG) --libs`
  
  #If you do have FreeType, JPEG and/or Xpm fully installed, uncomment a 
  #variation of this and comment out the line above. Note that
@@ -49,23 +52,29 @@
  
  #Note: for Freetype 1.x, use DHAVE_LIBTTF and -lttf instead.
  
-@@ -45,7 +53,8 @@
+@@ -45,7 +54,11 @@
  #ensure that the version of gd you are installing is used, and not an 
  #older release in your directory tree somewhere.
  
 -INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include 
-+INCLUDEDIRS=-I. -I${LOCALBASE}/include/freetype2 -I${LOCALBASE}/include
-+INCLUDEDIRS+=-I${X11BASE}/include/X11 -I${X11BASE}/include/freetype2 -I${X11BASE}/include
++INCLUDEDIRS=-I. `$(FREETYPE_CONFIG) --cflags` -I${LOCALBASE}/include
++
++.if defined(WITH_X11)
++INCLUDEDIRS+=-I${X11BASE}/include/X11 -I${X11BASE}/include
++.endif
  
  #Typical install locations for freetype, zlib, xpm and libpng libraries.
  #If yours are somewhere else, other than a standard location
-@@ -55,16 +66,17 @@
+@@ -55,16 +68,20 @@
  #on your system can't cause conflicts while building a new one.
  #This line shouldn't hurt if you don't actually have some of the
  #optional libraries and directories.
 -LIBDIRS=-L. -L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib
 +LIBDIRS=-L. -L${LOCALBASE}/lib -Wl,--rpath,${LOCALBASE}/lib
++
++.if defined(WITH_X11)
 +LIBDIRS+=-L${X11BASE}/lib -Wl,--rpath,${X11BASE}/lib
++.endif
  
  #Location where libgd.a should be installed by "make install".
 -INSTALL_LIB=/usr/local/lib
@@ -81,13 +90,13 @@
  
  #
  #
-@@ -74,34 +88,44 @@
+@@ -74,34 +91,44 @@
  
  VERSION=1.8.4
  
 -CC=$(COMPILER) $(INCLUDEDIRS)
 -LINK=$(CC) $(LIBDIRS) $(LIBS)
-+CC+=$(INCLUDEDIRS)
++CFLAGS+=$(INCLUDEDIRS)
 +#LINK=$(CC) $(LIBDIRS) $(LIBS)
  
  PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS)
@@ -97,6 +106,8 @@
  
 -all: libgd.a $(PROGRAMS)
 +SOVER=2
++
++.SUFFIXES: .c .so .o
  
 -install: libgd.a $(BIN_PROGRAMS)
 -	sh ./install-item 644 libgd.a $(INSTALL_LIB)/libgd.a
@@ -116,8 +127,6 @@
 -	sh ./install-item 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
 -	sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
 -	sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h
-+.SUFFIXES: .c .so .o
-+
 +.c.so:
 +	$(CC) -fpic -DPIC $(CFLAGS) -o $@ -c $<
 +
@@ -147,7 +156,7 @@
  
  gddemo: gddemo.o libgd.a
  	$(CC) gddemo.o -o gddemo	$(LIBDIRS) $(LIBS)
-@@ -138,18 +162,21 @@
+@@ -138,18 +165,21 @@
  gdtestttf: gdtestttf.o libgd.a
  	$(CC) --verbose gdtestttf.o -o gdtestttf $(LIBDIRS) $(LIBS)
  
diff -urN /usr/ports/graphics/gd/files/patch-malloc graphics/gd/files/patch-malloc
--- /usr/ports/graphics/gd/files/patch-malloc	Fri Aug 24 21:17:08 2001
+++ graphics/gd/files/patch-malloc	Thu Jan  1 09:00:00 1970
@@ -1,5 +0,0 @@
---- gdcache.h	Tue Feb  6 14:44:02 2001
-+++ gdcache.h	Fri Aug 24 08:10:41 2001
-@@ -43 +43 @@
--#include <malloc.h>
-+#include <stdlib.h>

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112150802.fBF82Yl90462>