ports/110221: [PATCH] graphics/libimg
Martin Matuska
martin at matuska.org
Mon Mar 12 14:40:06 UTC 2007
>Number: 110221
>Category: ports
>Synopsis: [PATCH] graphics/libimg
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Mar 12 14:40:05 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Martin Matuska
>Release: FreeBSD 6.2-RELEASE
>Organization:
>Environment:
FreeBSD 6.2-RELEASE i386/amd64
>Description:
This patch makes graphics/libimg ready for its slave ports:
graphics/libimg-tkstep80
graphics/libimg-tk83
The slave ports will be required for the following existing
ports which are currently broken:
archivers/deepforest
editors/muggy
graphics/jgv
mail/postilion
misc/seizedesktop
x11-fm/binder
Renamed files:
"patch-tk84-Tk_PhotoPutBlock" renamed to "tk84-Tk_PhotoPutBlock"
"patch-warnings" renamed to "tk84-warnings"
Tested via portlint -A and tinderbox.
>How-To-Repeat:
>Fix:
diff -Nbur graphics/libimg.orig/Makefile graphics/libimg/Makefile
--- graphics/libimg.orig/Makefile Tue Aug 15 01:06:35 2006
+++ graphics/libimg/Makefile Mon Mar 12 15:28:31 2007
@@ -7,17 +7,40 @@
PORTNAME= libimg
PORTVERSION= 1.2.4
-PORTREVISION= 2
-CATEGORIES= graphics tk84
-MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
+PORTREVISION= 3
+CATEGORIES?= graphics tk84
+MASTER_SITES= ${MASTER_SITE_SOURiCEFORGE}
MASTER_SITE_SUBDIR= tkimg
DISTNAME= img${PORTVERSION}
-MAINTAINER= ports at FreeBSD.org
+MAINTAINER= martin at matuska.org
COMMENT= A library of image format handlers for Tk4.1 and later
-LIB_DEPENDS= tk84:${PORTSDIR}/x11-toolkits/tk84 \
- png:${PORTSDIR}/graphics/png \
+MAKEFILE= ${FILESDIR}/Makefile.bsd
+
+.if defined(USE_TKSTEP80)
+PKGNAMESUFFIX= -tkstep80
+MAKEFILE= ${FILESDIR}/Makefile.tkstep80
+MAKE_ENV+= TCL_VER=8.0
+EXTRA_PATCHES= ${FILESDIR}/pre-tk84-warnings
+BUILD_DEPENDS= ${LOCALBASE}/lib/tkstep8.0/tkstep.tcl:${PORTSDIR}/x11-toolkits/tkstep80
+RUN_DEPENDS+= ${BUILD_DEPENDS}
+CONFLICTS= libimg-1.* libimg-tk83-1.*
+.elif defined(USE_TK) && ${USE_TK} == 83
+PKGNAMESUFFIX= -tk83
+USE_TK= 83
+USE_TK_BUILD= 83
+MAKE_ENV+= TCL_VER=8.3
+EXTRA_PATCHES= ${FILESDIR}/pre-tk84-warnings
+CONFLICTS= libimg-1.* libimg-tkstep-1.*
+.else
+USE_TK= 84
+USE_TK_BUILD= 84
+EXTRA_PATCHES= ${FILESDIR}/tk84-Tk_PhotoPutBlock ${FILESDIR}/tk84-warnings
+CONFLICTS= libimg-tk83-1.* libimg-tkstep-1.*
+.endif
+
+LIB_DEPENDS= png:${PORTSDIR}/graphics/png \
jpeg:${PORTSDIR}/graphics/jpeg \
tiff:${PORTSDIR}/graphics/tiff
@@ -27,8 +50,6 @@
EXTRACT_AFTER_ARGS= | ${TAR} -xf - --exclude '*/libz/*' \
--exclude '*/compat/*' --exclude '*/libtiff/*' \
--exclude '*/libjpeg/*' --exclude '*/libpng/*'
-
-MAKEFILE= ${FILESDIR}/Makefile.bsd
MAKE_ARGS= PORTVERSION="${PORTVERSION}" LOCALBASE="${LOCALBASE}" \
MKDIR="${MKDIR}" INSTALL_DATA="${INSTALL_DATA}"
diff -Nbur graphics/libimg.orig/files/Makefile.tkstep80 graphics/libimg/files/Makefile.tkstep80
--- graphics/libimg.orig/files/Makefile.tkstep80 Thu Jan 1 01:00:00 1970
+++ graphics/libimg/files/Makefile.tkstep80 Mon Mar 12 15:10:55 2007
@@ -0,0 +1,68 @@
+SHLIB_NAME= libimg.so.1
+
+PORTVERSION?= 1.2.4
+LOCALBASE?= /usr/local
+X11BASE?= /usr/X11R6
+TCL_VER= 8.0
+
+.if exists(${LOCALBASE}/lib/tkstep${TCL_VER}/tkStepConfig.sh)
+# If for some reason the file does not exist -- make the best guess. In
+# reality, it will exist by the time we are actually doing the build, so
+# the quality of the guess does not matter. But we still try well. -mi
+TCL_STUB_LIB_SPEC!= . ${LOCALBASE}/lib/tcl${TCL_VER}/tclConfig.sh; \
+ echo $$TCL_STUB_LIB_SPEC
+TK_STUB_LIB_SPEC!= . ${LOCALBASE}/lib/tkstep${TCL_VER}/tkConfig.sh; \
+ echo $$TK_STUB_LIB_SPEC
+.else
+TCL_STUB_LIB_SPEC= -L${LOCALBASE}/lib -ltcl${TCL_VER:S/.//}
+TK_STUB_LIB_SPEC= -L${LOCALBASE}/lib -ltk${TCL_VER:S/.//}
+.endif
+
+LDADD= -lm -lz -L${LOCALBASE}/lib -lpng -ljpeg -ltiff \
+ -L${X11BASE}/lib -lX11
+
+CFLAGS+= -I${LOCALBASE}/include/tcl${TCL_VER}
+CFLAGS+= -I${LOCALBASE}/include/tcl${TCL_VER}/generic
+CFLAGS+= -D__X11__ -I${X11BASE}/include -DALLOW_B64
+CFLAGS+= -I${LOCALBASE}/include/tkstep${TCL_VER}
+CFLAGS+= -DNDEBUG -Wall -I.
+CFLAGS+= -DVERSION=\"${PORTVERSION}\" -I${LOCALBASE}/include
+CFLAGS+= -DHAVE_JPEGLIB_H -DHAVE_TIFF_H -DHAVE_DLFCN_H -DHAVE_IMG_H
+
+all: pkgIndex.tcl
+
+pkgIndex.tcl: pkgIndex.tcl.in
+ sed -e 's, at IMG_PATCH_LEVEL@,${PORTVERSION},g' \
+ -e 's, at IMG_SHARED_LIB_FILE@,../${SHLIB_NAME},g' \
+ < pkgIndex.tcl.in > pkgIndex.tcl
+
+DIR = lib/Img1.2
+INSTDIR = ${LOCALBASE}/${DIR}
+LIBDIR = ${LOCALBASE}/lib
+
+${INSTDIR} ${INSTDIR}/msgs:
+ ${MKDIR} $@
+
+beforeinstall: ${INSTDIR} ${INSTDIR}/msgs
+ ${INSTALL_DATA} pkgIndex.tcl ${.CURDIR}/demo.tcl ${.CURDIR}/tkv.tcl \
+ ${.CURDIR}/imgmsg.tcl ${INSTDIR}
+ ${INSTALL_DATA} ${.CURDIR}/msgs/* ${INSTDIR}/msgs/
+
+environ:
+ @${ECHO} SHLIB_NAME=${SHLIB_NAME} SHLIB_LINK=${SHLIB_LINK} DIR=${DIR}
+
+# fundamentals of this library
+SRCS = imgInit.c imgObj.c imgUtil.c imgPmap.c imgUnixPmap.c \
+ imgBMP.c imgGIF.c imgJPEG.c imgPNG.c imgPS.c \
+ imgTIFF.c \
+ imgWindow.c imgXBM.c imgXPM.c
+
+test: $(SHLIB_NAME)
+ PATH=${TK_BIN_DIR}:${PATH}; export PATH; \
+ TCLLIBPATH=`pwd`; export TCLLIBPATH; \
+ export SHLIB_PATH; \
+ LD_LIBRARY_PATH=`pwd`; \
+ export LD_LIBRARY_PATH; \
+ wishstep${TCL_VER} demo.tcl
+
+.include <bsd.lib.mk>
diff -Nbur graphics/libimg.orig/files/patch-tk84_Tk_PhotoPutBlock graphics/libimg/files/patch-tk84_Tk_PhotoPutBlock
--- graphics/libimg.orig/files/patch-tk84_Tk_PhotoPutBlock Fri Jun 10 03:21:05 2005
+++ graphics/libimg/files/patch-tk84_Tk_PhotoPutBlock Thu Jan 1 01:00:00 1970
@@ -1,145 +0,0 @@
---- imgBMP.c.orig Sun Aug 13 06:08:30 2000
-+++ imgBMP.c Mon Dec 1 12:49:07 2003
-@@ -256,7 +256,7 @@
- for( y = height-1; y>=0; y--) {
- ImgRead(handle, line, bytesPerLine);
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
-- width,1);
-+ width,1,TK_PHOTO_COMPOSITE_SET);
- }
- break;
- case 8:
-@@ -268,7 +268,7 @@
- expline += 3;
- }
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
-- width,1);
-+ width,1,TK_PHOTO_COMPOSITE_SET);
- expline = block.pixelPtr;
- }
- break;
-@@ -287,7 +287,7 @@
- expline += 3;
- }
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
-- width,1);
-+ width,1,TK_PHOTO_COMPOSITE_SET);
- expline = block.pixelPtr;
- }
- break;
-@@ -302,7 +302,7 @@
- expline += 3;
- }
- Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
-- width,1);
-+ width,1,TK_PHOTO_COMPOSITE_SET);
- expline = block.pixelPtr;
- }
- break;
---- imgGIF.c.orig Sun Aug 13 06:09:39 2000
-+++ imgGIF.c Mon Dec 1 12:50:19 2003
-@@ -482,7 +482,7 @@
- }
-
- if (transparent == -1) {
-- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height);
-+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET);
- } else {
- ImgPhotoPutBlock(imageHandle, &block, destX, destY, width, height);
- }
---- imgJPEG.c.orig Sun Aug 13 06:10:22 2000
-+++ imgJPEG.c Mon Dec 1 12:50:53 2003
-@@ -1030,7 +1030,7 @@
- for (curY = 0; curY < stopY; curY++) {
- jpeg.read_scanlines(cinfo, buffer, 1);
- if (curY >= srcY) {
-- Tk_PhotoPutBlock(imageHandle, &block, destX, outY, outWidth, 1);
-+ Tk_PhotoPutBlock(imageHandle, &block, destX, outY, outWidth, 1, TK_PHOTO_COMPOSITE_SET);
- outY++;
- }
- }
---- imgPS.c.orig Sun Aug 13 06:06:53 2000
-+++ imgPS.c Mon Dec 1 12:51:42 2003
-@@ -395,7 +395,7 @@
- for (j = 0; j < width; j++) {
- line3[j] = ((line[(j+srcX)/8]>>(7-(j+srcX)%8) & 1)) ? 0 : 255;
- }
-- Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
-+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
- }
- break;
- case '5':
-@@ -413,7 +413,7 @@
- c++;
- }
- }
-- Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
-+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
- }
- break;
- case '6':
-@@ -435,7 +435,7 @@
- c++;
- }
- }
-- Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
-+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
- }
- break;
- }
---- imgUtil.c Tue Jan 15 15:59:59 2002
-+++ imgUtil.c Thu Jun 9 20:51:49 2005
-@@ -95,7 +95,7 @@
- }
- if (end > X) {
- blockPtr->pixelPtr = rowPtr + blockPtr->pixelSize * X;
-- Tk_PhotoPutBlock(handle, blockPtr, x+X, y+Y, end-X, 1);
-+ Tk_PhotoPutBlock(handle, blockPtr, x+X, y+Y, end-X, 1, TK_PHOTO_COMPOSITE_SET);
- }
- X = end;
- }
-@@ -103,12 +103,12 @@
- }
- blockPtr->pixelPtr = imagePtr;
- } else {
-- Tk_PhotoPutBlock(handle,blockPtr,x,y,width,height);
-+ Tk_PhotoPutBlock(handle,blockPtr,x,y,width,height,TK_PHOTO_COMPOSITE_SET);
- }
- return TCL_OK;
- }
-
--
-+#if 0 /* OS run-time linker is better suited for this job { */
- /*
- *----------------------------------------------------------------------
- *
-@@ -248,4 +248,5 @@
- dlclose(*handlePtr);
- }
- *handlePtr = IMG_FAILED;
--}
-\ No newline at end of file
-+}
-+#endif /* } */
---- imgWindow.c.orig Sat Jan 15 13:25:37 2000
-+++ imgWindow.c Mon Dec 1 12:52:11 2003
-@@ -378,7 +378,7 @@
- }
- }
-
-- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height);
-+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET);
-
- #ifndef __WIN32__
- XDestroyImage(ximage);
---- imgXPM.c.orig Sun Aug 13 06:41:31 2000
-+++ imgXPM.c Mon Dec 1 12:52:34 2003
-@@ -504,7 +504,7 @@
- col = (int)0;
- }
- } while ((i < width) && col);
-- Tk_PhotoPutBlock(imageHandle, &block.pub, destX+j, destY, len, 1);
-+ Tk_PhotoPutBlock(imageHandle, &block.pub, destX+j, destY, len, 1, TK_PHOTO_COMPOSITE_SET);
- } else {
- p += byteSize;
- i++;
diff -Nbur graphics/libimg.orig/files/patch-warnings graphics/libimg/files/patch-warnings
--- graphics/libimg.orig/files/patch-warnings Fri Jun 10 03:21:05 2005
+++ graphics/libimg/files/patch-warnings Thu Jan 1 01:00:00 1970
@@ -1,229 +0,0 @@
---- imgObj.c Tue Jan 15 16:00:08 2002
-+++ imgObj.c Thu Jun 9 05:28:23 2005
-@@ -33,5 +33,5 @@
- return (initialized = IMG_PERL|IMG_OBJS);
- #else
-- char *version;
-+ const char *version;
- initialized = IMG_TCL;
- if (!Tcl_GetCommandInfo(interp,"image", &cmdInfo)) {
---- imgInit.c Tue Jan 15 15:59:58 2002
-+++ imgInit.c Thu Jun 9 05:27:40 2005
-@@ -94,5 +94,5 @@
- {
- Tk_PhotoImageFormat **formatPtr = Formats;
-- char *version;
-+ const char *version;
-
- if ((version = Tcl_InitStubs(interp, "8.0", 0)) == NULL) {
---- imgPmap.h Tue Jan 15 15:59:58 2002
-+++ imgPmap.h Thu Jun 9 05:48:57 2005
-@@ -53,5 +53,5 @@
- int ncolors; /* number of colors */
- int cpp; /* characters per pixel */
-- char ** data; /* The data that defines this pixmap
-+ const char ** data; /* The data that defines this pixmap
- * image (array of strings). It is
- * converted into an X Pixmap when this
---- imgPmap.c Tue Jan 15 15:59:58 2002
-+++ imgPmap.c Thu Jun 9 05:52:31 2005
-@@ -49,6 +53,5 @@
- Display *display));
- static void ImgXpmDelete _ANSI_ARGS_((ClientData clientData));
--static int ImgXpmCmd _ANSI_ARGS_((ClientData clientData,
-- Tcl_Interp *interp, int argc, char **argv));
-+static Tcl_CmdProc ImgXpmCmd;
- static void ImgXpmCmdDeletedProc _ANSI_ARGS_((
- ClientData clientData));
-@@ -56,11 +59,11 @@
- PixmapInstance *instancePtr));
- static int ImgXpmConfigureMaster _ANSI_ARGS_((
-- PixmapMaster *masterPtr, int argc, char **argv,
-- int flags));
-+ PixmapMaster *masterPtr, int argc,
-+ const char **argv, int flags));
- static int ImgXpmGetData _ANSI_ARGS_((Tcl_Interp *interp,
- PixmapMaster *masterPtr));
--static char ** ImgXpmGetDataFromFile _ANSI_ARGS_((Tcl_Interp * interp,
-+static const char ** ImgXpmGetDataFromFile _ANSI_ARGS_((Tcl_Interp * interp,
- char * string, int * numLines_return));
--static char ** ImgXpmGetDataFromString _ANSI_ARGS_((Tcl_Interp*interp,
-+static const char ** ImgXpmGetDataFromString _ANSI_ARGS_((Tcl_Interp*interp,
- char * string, int * numLines_return));
- static void ImgXpmGetPixmapFromData _ANSI_ARGS_((
-@@ -68,7 +71,7 @@
- PixmapMaster *masterPtr,
- PixmapInstance *instancePtr));
--static char * GetType _ANSI_ARGS_((char * colorDefn,
-+static const char * GetType _ANSI_ARGS_((const char * colorDefn,
- int * type_ret));
--static char * GetColor _ANSI_ARGS_((char * colorDefn,
-+static const char * GetColor _ANSI_ARGS_((const char * colorDefn,
- char * colorName, int * type_ret));
-
-@@ -131,6 +134,6 @@
- PixmapMaster *masterPtr;
- int i;
-- char *argvbuf[10];
-- char **args = argvbuf;
-+ const char *argvbuf[10];
-+ const char **args = argvbuf;
-
- /*
-@@ -138,5 +141,5 @@
- */
- if (argc > 10) {
-- args = (char **) ckalloc(argc * sizeof(char *));
-+ args = (const char **)ckalloc(argc * sizeof(char *));
- }
- for (i = 0; i < argc; i++) {
-@@ -197,5 +200,5 @@
- * overall pixmap image to (reconfigure). */
- int argc; /* Number of entries in argv. */
-- char **argv; /* Pairs of configuration options for image. */
-+ const char **argv; /* Pairs of configuration options for image. */
- int flags; /* Flags to pass to Tk_ConfigureWidget,
- * such as TK_CONFIG_ARGV_ONLY. */
-@@ -280,8 +283,8 @@
- PixmapMaster *masterPtr;
- {
-- char ** data = NULL;
-+ const char ** data = NULL;
- int isAllocated = 0; /* do we need to free "data"? */
- int listArgc;
-- char ** listArgv = NULL;
-+ const char ** listArgv = NULL;
- int numLines;
- int size[2];
-@@ -371,5 +374,6 @@
- }
-
--static char ** ImgXpmGetDataFromString(interp, string, numLines_return)
-+static const char **
-+ImgXpmGetDataFromString(interp, string, numLines_return)
- Tcl_Interp * interp;
- char * string;
-@@ -379,5 +383,5 @@
- char * p, * list;
- int numLines;
-- char ** data;
-+ const char ** data;
-
- /* skip the leading blanks (leading blanks are not defined in the
-@@ -497,8 +501,9 @@
- error:
- Tcl_AppendResult(interp, "File format error", NULL);
-- return (char**) NULL;
-+ return NULL;
- }
-
--static char ** ImgXpmGetDataFromFile(interp, fileName, numLines_return)
-+static const char **
-+ImgXpmGetDataFromFile(interp, fileName, numLines_return)
- Tcl_Interp * interp;
- char * fileName;
-@@ -507,10 +512,10 @@
- Tcl_Channel chan;
- int size;
-- char ** data = (char **) NULL;
-+ const char ** data = NULL;
- char *cmdBuffer = NULL;
-
- chan = ImgOpenFileChannel(interp, fileName, 0);
- if (!chan) {
-- return (char **) NULL;
-+ return NULL;
- }
-
-@@ -540,10 +545,10 @@
-
-
--static char *
-+static const char *
- GetType(colorDefn, type_ret)
-- char * colorDefn;
-+ const char * colorDefn;
- int * type_ret;
- {
-- char * p = colorDefn;
-+ const char * p = colorDefn;
-
- /* skip white spaces */
-@@ -590,7 +595,7 @@
- * colorName is guaranteed to be big enough
- */
--static char *
-+static const char *
- GetColor(colorDefn, colorName, type_ret)
-- char * colorDefn;
-+ const char * colorDefn;
- char * colorName; /* if found, name is copied to this array */
- int * type_ret;
-@@ -699,5 +704,5 @@
-
- for (i=0; i<masterPtr->ncolors; i++) {
-- char * colorDefn; /* the color definition line */
-+ const char * colorDefn; /* the color definition line */
- char * colorName; /* temp place to hold the color name
- * defined for one type of visual */
-@@ -790,5 +795,5 @@
- */
- for (i=0; i<masterPtr->size[1]; i++) {
-- char * p = masterPtr->data[i+lOffset];
-+ const char * p = masterPtr->data[i+lOffset];
-
- for (j=0; j<masterPtr->size[0]; j++) {
-@@ -905,5 +910,5 @@
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
-- char **argv; /* Argument strings. */
-+ const char *argv[]; /* Argument strings. */
- {
- PixmapMaster *masterPtr = (PixmapMaster *) clientData;
---- imgPS.c Tue Jan 15 16:00:10 2002
-+++ imgPS.c Thu Jun 9 05:58:04 2005
-@@ -269,5 +269,5 @@
- {
- #ifndef MAC_TCL
-- char *argv[10];
-+ const char *argv[10];
- int len, i, j, fileWidth, fileHeight, maxintensity, index;
- char *p, type;
---- imgXPM.c Tue Jan 15 16:00:08 2002
-+++ imgXPM.c Thu Jun 9 20:33:32 2005
-@@ -287,6 +287,6 @@
- char buffer[MAX_BUFFER];
- int i, isMono;
-- int color1;
-- unsigned int data;
-+ intptr_t color1;
-+ uintptr_t data;
- Tcl_HashEntry *hPtr;
-
-@@ -466,5 +466,5 @@
-
- for (i = 0; i < width; ) {
-- unsigned int col;
-+ uintptr_t col;
-
- memcpy((char *) &color1, p, byteSize);
-@@ -476,7 +476,7 @@
- */
- if (hPtr != (Tcl_HashEntry *)NULL)
-- col = (int)Tcl_GetHashValue(hPtr);
-+ col = (uintptr_t)Tcl_GetHashValue(hPtr);
- else
-- col = (int)0;
-+ col = 0;
-
- /*
-@@ -500,7 +500,7 @@
- hPtr = Tcl_FindHashEntry(&colorTable, (char *) color1);
- if (hPtr != (Tcl_HashEntry *)NULL)
-- col = (int)Tcl_GetHashValue(hPtr);
-+ col = (uintptr_t)Tcl_GetHashValue(hPtr);
- else
-- col = (int)0;
-+ col = 0;
- }
- } while ((i < width) && col);
diff -Nbur graphics/libimg.orig/files/pre-tk84-warnings graphics/libimg/files/pre-tk84-warnings
--- graphics/libimg.orig/files/pre-tk84-warnings Thu Jan 1 01:00:00 1970
+++ graphics/libimg/files/pre-tk84-warnings Mon Mar 12 11:42:15 2007
@@ -0,0 +1,38 @@
+--- imgXPM.c Tue Jan 15 16:00:08 2002
++++ imgXPM.c Thu Jun 9 20:33:32 2005
+@@ -287,6 +287,6 @@
+ char buffer[MAX_BUFFER];
+ int i, isMono;
+- int color1;
+- unsigned int data;
++ intptr_t color1;
++ uintptr_t data;
+ Tcl_HashEntry *hPtr;
+
+@@ -466,5 +466,5 @@
+
+ for (i = 0; i < width; ) {
+- unsigned int col;
++ uintptr_t col;
+
+ memcpy((char *) &color1, p, byteSize);
+@@ -476,7 +476,7 @@
+ */
+ if (hPtr != (Tcl_HashEntry *)NULL)
+- col = (int)Tcl_GetHashValue(hPtr);
++ col = (uintptr_t)Tcl_GetHashValue(hPtr);
+ else
+- col = (int)0;
++ col = 0;
+
+ /*
+@@ -500,7 +500,7 @@
+ hPtr = Tcl_FindHashEntry(&colorTable, (char *) color1);
+ if (hPtr != (Tcl_HashEntry *)NULL)
+- col = (int)Tcl_GetHashValue(hPtr);
++ col = (uintptr_t)Tcl_GetHashValue(hPtr);
+ else
+- col = (int)0;
++ col = 0;
+ }
+ } while ((i < width) && col);
diff -Nbur graphics/libimg.orig/files/tk84-Tk_PhotoPutBlock graphics/libimg/files/tk84-Tk_PhotoPutBlock
--- graphics/libimg.orig/files/tk84-Tk_PhotoPutBlock Thu Jan 1 01:00:00 1970
+++ graphics/libimg/files/tk84-Tk_PhotoPutBlock Fri Jun 10 03:21:05 2005
@@ -0,0 +1,145 @@
+--- imgBMP.c.orig Sun Aug 13 06:08:30 2000
++++ imgBMP.c Mon Dec 1 12:49:07 2003
+@@ -256,7 +256,7 @@
+ for( y = height-1; y>=0; y--) {
+ ImgRead(handle, line, bytesPerLine);
+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
+- width,1);
++ width,1,TK_PHOTO_COMPOSITE_SET);
+ }
+ break;
+ case 8:
+@@ -268,7 +268,7 @@
+ expline += 3;
+ }
+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
+- width,1);
++ width,1,TK_PHOTO_COMPOSITE_SET);
+ expline = block.pixelPtr;
+ }
+ break;
+@@ -287,7 +287,7 @@
+ expline += 3;
+ }
+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
+- width,1);
++ width,1,TK_PHOTO_COMPOSITE_SET);
+ expline = block.pixelPtr;
+ }
+ break;
+@@ -302,7 +302,7 @@
+ expline += 3;
+ }
+ Tk_PhotoPutBlock(imageHandle, &block, destX, destY+y,
+- width,1);
++ width,1,TK_PHOTO_COMPOSITE_SET);
+ expline = block.pixelPtr;
+ }
+ break;
+--- imgGIF.c.orig Sun Aug 13 06:09:39 2000
++++ imgGIF.c Mon Dec 1 12:50:19 2003
+@@ -482,7 +482,7 @@
+ }
+
+ if (transparent == -1) {
+- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height);
++ Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET);
+ } else {
+ ImgPhotoPutBlock(imageHandle, &block, destX, destY, width, height);
+ }
+--- imgJPEG.c.orig Sun Aug 13 06:10:22 2000
++++ imgJPEG.c Mon Dec 1 12:50:53 2003
+@@ -1030,7 +1030,7 @@
+ for (curY = 0; curY < stopY; curY++) {
+ jpeg.read_scanlines(cinfo, buffer, 1);
+ if (curY >= srcY) {
+- Tk_PhotoPutBlock(imageHandle, &block, destX, outY, outWidth, 1);
++ Tk_PhotoPutBlock(imageHandle, &block, destX, outY, outWidth, 1, TK_PHOTO_COMPOSITE_SET);
+ outY++;
+ }
+ }
+--- imgPS.c.orig Sun Aug 13 06:06:53 2000
++++ imgPS.c Mon Dec 1 12:51:42 2003
+@@ -395,7 +395,7 @@
+ for (j = 0; j < width; j++) {
+ line3[j] = ((line[(j+srcX)/8]>>(7-(j+srcX)%8) & 1)) ? 0 : 255;
+ }
+- Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
++ Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
+ }
+ break;
+ case '5':
+@@ -413,7 +413,7 @@
+ c++;
+ }
+ }
+- Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
++ Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
+ }
+ break;
+ case '6':
+@@ -435,7 +435,7 @@
+ c++;
+ }
+ }
+- Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1);
++ Tk_PhotoPutBlock(imageHandle, &block, destX, destY++, width, 1, TK_PHOTO_COMPOSITE_SET);
+ }
+ break;
+ }
+--- imgUtil.c Tue Jan 15 15:59:59 2002
++++ imgUtil.c Thu Jun 9 20:51:49 2005
+@@ -95,7 +95,7 @@
+ }
+ if (end > X) {
+ blockPtr->pixelPtr = rowPtr + blockPtr->pixelSize * X;
+- Tk_PhotoPutBlock(handle, blockPtr, x+X, y+Y, end-X, 1);
++ Tk_PhotoPutBlock(handle, blockPtr, x+X, y+Y, end-X, 1, TK_PHOTO_COMPOSITE_SET);
+ }
+ X = end;
+ }
+@@ -103,12 +103,12 @@
+ }
+ blockPtr->pixelPtr = imagePtr;
+ } else {
+- Tk_PhotoPutBlock(handle,blockPtr,x,y,width,height);
++ Tk_PhotoPutBlock(handle,blockPtr,x,y,width,height,TK_PHOTO_COMPOSITE_SET);
+ }
+ return TCL_OK;
+ }
+
+-
++#if 0 /* OS run-time linker is better suited for this job { */
+ /*
+ *----------------------------------------------------------------------
+ *
+@@ -248,4 +248,5 @@
+ dlclose(*handlePtr);
+ }
+ *handlePtr = IMG_FAILED;
+-}
+\ No newline at end of file
++}
++#endif /* } */
+--- imgWindow.c.orig Sat Jan 15 13:25:37 2000
++++ imgWindow.c Mon Dec 1 12:52:11 2003
+@@ -378,7 +378,7 @@
+ }
+ }
+
+- Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height);
++ Tk_PhotoPutBlock(imageHandle, &block, destX, destY, width, height, TK_PHOTO_COMPOSITE_SET);
+
+ #ifndef __WIN32__
+ XDestroyImage(ximage);
+--- imgXPM.c.orig Sun Aug 13 06:41:31 2000
++++ imgXPM.c Mon Dec 1 12:52:34 2003
+@@ -504,7 +504,7 @@
+ col = (int)0;
+ }
+ } while ((i < width) && col);
+- Tk_PhotoPutBlock(imageHandle, &block.pub, destX+j, destY, len, 1);
++ Tk_PhotoPutBlock(imageHandle, &block.pub, destX+j, destY, len, 1, TK_PHOTO_COMPOSITE_SET);
+ } else {
+ p += byteSize;
+ i++;
diff -Nbur graphics/libimg.orig/files/tk84-warnings graphics/libimg/files/tk84-warnings
--- graphics/libimg.orig/files/tk84-warnings Thu Jan 1 01:00:00 1970
+++ graphics/libimg/files/tk84-warnings Fri Jun 10 03:21:05 2005
@@ -0,0 +1,229 @@
+--- imgObj.c Tue Jan 15 16:00:08 2002
++++ imgObj.c Thu Jun 9 05:28:23 2005
+@@ -33,5 +33,5 @@
+ return (initialized = IMG_PERL|IMG_OBJS);
+ #else
+- char *version;
++ const char *version;
+ initialized = IMG_TCL;
+ if (!Tcl_GetCommandInfo(interp,"image", &cmdInfo)) {
+--- imgInit.c Tue Jan 15 15:59:58 2002
++++ imgInit.c Thu Jun 9 05:27:40 2005
+@@ -94,5 +94,5 @@
+ {
+ Tk_PhotoImageFormat **formatPtr = Formats;
+- char *version;
++ const char *version;
+
+ if ((version = Tcl_InitStubs(interp, "8.0", 0)) == NULL) {
+--- imgPmap.h Tue Jan 15 15:59:58 2002
++++ imgPmap.h Thu Jun 9 05:48:57 2005
+@@ -53,5 +53,5 @@
+ int ncolors; /* number of colors */
+ int cpp; /* characters per pixel */
+- char ** data; /* The data that defines this pixmap
++ const char ** data; /* The data that defines this pixmap
+ * image (array of strings). It is
+ * converted into an X Pixmap when this
+--- imgPmap.c Tue Jan 15 15:59:58 2002
++++ imgPmap.c Thu Jun 9 05:52:31 2005
+@@ -49,6 +53,5 @@
+ Display *display));
+ static void ImgXpmDelete _ANSI_ARGS_((ClientData clientData));
+-static int ImgXpmCmd _ANSI_ARGS_((ClientData clientData,
+- Tcl_Interp *interp, int argc, char **argv));
++static Tcl_CmdProc ImgXpmCmd;
+ static void ImgXpmCmdDeletedProc _ANSI_ARGS_((
+ ClientData clientData));
+@@ -56,11 +59,11 @@
+ PixmapInstance *instancePtr));
+ static int ImgXpmConfigureMaster _ANSI_ARGS_((
+- PixmapMaster *masterPtr, int argc, char **argv,
+- int flags));
++ PixmapMaster *masterPtr, int argc,
++ const char **argv, int flags));
+ static int ImgXpmGetData _ANSI_ARGS_((Tcl_Interp *interp,
+ PixmapMaster *masterPtr));
+-static char ** ImgXpmGetDataFromFile _ANSI_ARGS_((Tcl_Interp * interp,
++static const char ** ImgXpmGetDataFromFile _ANSI_ARGS_((Tcl_Interp * interp,
+ char * string, int * numLines_return));
+-static char ** ImgXpmGetDataFromString _ANSI_ARGS_((Tcl_Interp*interp,
++static const char ** ImgXpmGetDataFromString _ANSI_ARGS_((Tcl_Interp*interp,
+ char * string, int * numLines_return));
+ static void ImgXpmGetPixmapFromData _ANSI_ARGS_((
+@@ -68,7 +71,7 @@
+ PixmapMaster *masterPtr,
+ PixmapInstance *instancePtr));
+-static char * GetType _ANSI_ARGS_((char * colorDefn,
++static const char * GetType _ANSI_ARGS_((const char * colorDefn,
+ int * type_ret));
+-static char * GetColor _ANSI_ARGS_((char * colorDefn,
++static const char * GetColor _ANSI_ARGS_((const char * colorDefn,
+ char * colorName, int * type_ret));
+
+@@ -131,6 +134,6 @@
+ PixmapMaster *masterPtr;
+ int i;
+- char *argvbuf[10];
+- char **args = argvbuf;
++ const char *argvbuf[10];
++ const char **args = argvbuf;
+
+ /*
+@@ -138,5 +141,5 @@
+ */
+ if (argc > 10) {
+- args = (char **) ckalloc(argc * sizeof(char *));
++ args = (const char **)ckalloc(argc * sizeof(char *));
+ }
+ for (i = 0; i < argc; i++) {
+@@ -197,5 +200,5 @@
+ * overall pixmap image to (reconfigure). */
+ int argc; /* Number of entries in argv. */
+- char **argv; /* Pairs of configuration options for image. */
++ const char **argv; /* Pairs of configuration options for image. */
+ int flags; /* Flags to pass to Tk_ConfigureWidget,
+ * such as TK_CONFIG_ARGV_ONLY. */
+@@ -280,8 +283,8 @@
+ PixmapMaster *masterPtr;
+ {
+- char ** data = NULL;
++ const char ** data = NULL;
+ int isAllocated = 0; /* do we need to free "data"? */
+ int listArgc;
+- char ** listArgv = NULL;
++ const char ** listArgv = NULL;
+ int numLines;
+ int size[2];
+@@ -371,5 +374,6 @@
+ }
+
+-static char ** ImgXpmGetDataFromString(interp, string, numLines_return)
++static const char **
++ImgXpmGetDataFromString(interp, string, numLines_return)
+ Tcl_Interp * interp;
+ char * string;
+@@ -379,5 +383,5 @@
+ char * p, * list;
+ int numLines;
+- char ** data;
++ const char ** data;
+
+ /* skip the leading blanks (leading blanks are not defined in the
+@@ -497,8 +501,9 @@
+ error:
+ Tcl_AppendResult(interp, "File format error", NULL);
+- return (char**) NULL;
++ return NULL;
+ }
+
+-static char ** ImgXpmGetDataFromFile(interp, fileName, numLines_return)
++static const char **
++ImgXpmGetDataFromFile(interp, fileName, numLines_return)
+ Tcl_Interp * interp;
+ char * fileName;
+@@ -507,10 +512,10 @@
+ Tcl_Channel chan;
+ int size;
+- char ** data = (char **) NULL;
++ const char ** data = NULL;
+ char *cmdBuffer = NULL;
+
+ chan = ImgOpenFileChannel(interp, fileName, 0);
+ if (!chan) {
+- return (char **) NULL;
++ return NULL;
+ }
+
+@@ -540,10 +545,10 @@
+
+
+-static char *
++static const char *
+ GetType(colorDefn, type_ret)
+- char * colorDefn;
++ const char * colorDefn;
+ int * type_ret;
+ {
+- char * p = colorDefn;
++ const char * p = colorDefn;
+
+ /* skip white spaces */
+@@ -590,7 +595,7 @@
+ * colorName is guaranteed to be big enough
+ */
+-static char *
++static const char *
+ GetColor(colorDefn, colorName, type_ret)
+- char * colorDefn;
++ const char * colorDefn;
+ char * colorName; /* if found, name is copied to this array */
+ int * type_ret;
+@@ -699,5 +704,5 @@
+
+ for (i=0; i<masterPtr->ncolors; i++) {
+- char * colorDefn; /* the color definition line */
++ const char * colorDefn; /* the color definition line */
+ char * colorName; /* temp place to hold the color name
+ * defined for one type of visual */
+@@ -790,5 +795,5 @@
+ */
+ for (i=0; i<masterPtr->size[1]; i++) {
+- char * p = masterPtr->data[i+lOffset];
++ const char * p = masterPtr->data[i+lOffset];
+
+ for (j=0; j<masterPtr->size[0]; j++) {
+@@ -905,5 +910,5 @@
+ Tcl_Interp *interp; /* Current interpreter. */
+ int argc; /* Number of arguments. */
+- char **argv; /* Argument strings. */
++ const char *argv[]; /* Argument strings. */
+ {
+ PixmapMaster *masterPtr = (PixmapMaster *) clientData;
+--- imgPS.c Tue Jan 15 16:00:10 2002
++++ imgPS.c Thu Jun 9 05:58:04 2005
+@@ -269,5 +269,5 @@
+ {
+ #ifndef MAC_TCL
+- char *argv[10];
++ const char *argv[10];
+ int len, i, j, fileWidth, fileHeight, maxintensity, index;
+ char *p, type;
+--- imgXPM.c Tue Jan 15 16:00:08 2002
++++ imgXPM.c Thu Jun 9 20:33:32 2005
+@@ -287,6 +287,6 @@
+ char buffer[MAX_BUFFER];
+ int i, isMono;
+- int color1;
+- unsigned int data;
++ intptr_t color1;
++ uintptr_t data;
+ Tcl_HashEntry *hPtr;
+
+@@ -466,5 +466,5 @@
+
+ for (i = 0; i < width; ) {
+- unsigned int col;
++ uintptr_t col;
+
+ memcpy((char *) &color1, p, byteSize);
+@@ -476,7 +476,7 @@
+ */
+ if (hPtr != (Tcl_HashEntry *)NULL)
+- col = (int)Tcl_GetHashValue(hPtr);
++ col = (uintptr_t)Tcl_GetHashValue(hPtr);
+ else
+- col = (int)0;
++ col = 0;
+
+ /*
+@@ -500,7 +500,7 @@
+ hPtr = Tcl_FindHashEntry(&colorTable, (char *) color1);
+ if (hPtr != (Tcl_HashEntry *)NULL)
+- col = (int)Tcl_GetHashValue(hPtr);
++ col = (uintptr_t)Tcl_GetHashValue(hPtr);
+ else
+- col = (int)0;
++ col = 0;
+ }
+ } while ((i < width) && col);
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list