pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/graphics/pixmap
Module Name: pkgsrc
Committed By: nros
Date: Wed Dec 4 10:40:37 UTC 2024
Modified Files:
pkgsrc/graphics/pixmap: Makefile PLIST distinfo
pkgsrc/graphics/pixmap/patches: patch-Pixmap.c patch-ac
Added Files:
pkgsrc/graphics/pixmap/files: COPYRIGHT.rgb rgb.c rgb.h
Log Message:
graphics/pixmap: Fix build with newer libxpm
libXpm version 3.5.17 and above hides the
xpm* functions like xpmReadRgbNames that
pixmap uses. Solve this by compiling rgb.c
from libxpm with pixmap. The function names
have been altered to not conflict the the
functions in libxpm in versions where they
are not hidden.
To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 pkgsrc/graphics/pixmap/Makefile
cvs rdiff -u -r1.4 -r1.5 pkgsrc/graphics/pixmap/PLIST
cvs rdiff -u -r1.11 -r1.12 pkgsrc/graphics/pixmap/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/graphics/pixmap/files/COPYRIGHT.rgb \
pkgsrc/graphics/pixmap/files/rgb.c pkgsrc/graphics/pixmap/files/rgb.h
cvs rdiff -u -r1.1 -r1.2 pkgsrc/graphics/pixmap/patches/patch-Pixmap.c
cvs rdiff -u -r1.7 -r1.8 pkgsrc/graphics/pixmap/patches/patch-ac
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/graphics/pixmap/Makefile
diff -u pkgsrc/graphics/pixmap/Makefile:1.36 pkgsrc/graphics/pixmap/Makefile:1.37
--- pkgsrc/graphics/pixmap/Makefile:1.36 Tue Jan 2 20:41:47 2024
+++ pkgsrc/graphics/pixmap/Makefile Wed Dec 4 10:40:37 2024
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.36 2024/01/02 20:41:47 nros Exp $
+# $NetBSD: Makefile,v 1.37 2024/12/04 10:40:37 nros Exp $
DISTNAME= pixmap2.6
PKGNAME= pixmap-2.6.4
-PKGREVISION= 8
+PKGREVISION= 9
CATEGORIES= graphics
MASTER_SITES= ${MASTER_SITE_XCONTRIB:=applications/pixmap/}
LICENSE= x11
@@ -36,8 +36,18 @@ SUBST_STAGE.rgb= pre-configure
SUBST_FILES.rgb= Imakefile
SUBST_VARS.rgb= RGBTXT
+INSTALLATION_DIRS+= share/doc/${PKGBASE}
+
post-extract:
rm -rf ${WRKSRC}/X11
+ ${CP} ${FILESDIR}/rgb.h ${WRKSRC}
+ ${CP} ${FILESDIR}/rgb.c ${WRKSRC}
+
+post-install:
+ ${INSTALL_DATA} ${WRKSRC}/COPYRIGHT \
+ ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
+ ${INSTALL_DATA} ${FILESDIR}/COPYRIGHT.rgb \
+ ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}
.include "../../x11/libX11/buildlink3.mk"
.include "../../x11/libXmu/buildlink3.mk"
Index: pkgsrc/graphics/pixmap/PLIST
diff -u pkgsrc/graphics/pixmap/PLIST:1.4 pkgsrc/graphics/pixmap/PLIST:1.5
--- pkgsrc/graphics/pixmap/PLIST:1.4 Sun Nov 30 08:43:16 2008
+++ pkgsrc/graphics/pixmap/PLIST Wed Dec 4 10:40:37 2024
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.4 2008/11/30 08:43:16 obache Exp $
+@comment $NetBSD: PLIST,v 1.5 2024/12/04 10:40:37 nros Exp $
bin/pixmap
lib/X11/Pixmap/MDown
lib/X11/Pixmap/MFlipHoriz
@@ -12,3 +12,5 @@ lib/X11/Pixmap/MUp
lib/X11/Pixmap/Stipple
lib/X11/app-defaults/Pixmap
${IMAKE_MAN_DIR}/pixmap.${IMAKE_MAN_SUFFIX}
+share/doc/pixmap/COPYRIGHT
+share/doc/pixmap/COPYRIGHT.rgb
Index: pkgsrc/graphics/pixmap/distinfo
diff -u pkgsrc/graphics/pixmap/distinfo:1.11 pkgsrc/graphics/pixmap/distinfo:1.12
--- pkgsrc/graphics/pixmap/distinfo:1.11 Tue Jan 2 20:41:47 2024
+++ pkgsrc/graphics/pixmap/distinfo Wed Dec 4 10:40:37 2024
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.11 2024/01/02 20:41:47 nros Exp $
+$NetBSD: distinfo,v 1.12 2024/12/04 10:40:37 nros Exp $
BLAKE2s (pixmap2.6.tar.gz) = 191d681fd102a90f99369f8def34fc0dbfa5394a180db7eb25076f9dd2bf6a3f
SHA512 (pixmap2.6.tar.gz) = 2943c8f9fdab8fcb979711bbace95595fcccd4b498041016ba7b82fa20ad9fbbba68c7359b3bfe4eb05555b4913ff0316752640f40efe0ace31ff4b401bb008f
@@ -17,7 +17,7 @@ SHA512 (pixmap_2.6.patch4.gz) = f30cfe70
Size (pixmap_2.6.patch4.gz) = 1269 bytes
SHA1 (patch-Dialog.c) = a59038561837ff2377277821bcf841c965bab924
SHA1 (patch-PixEdit.c) = 96b9bddb9d4d597176f09527e12f9d6c5de0b748
-SHA1 (patch-Pixmap.c) = 7a30b060fb82c617c11e574088898cdec61473a7
+SHA1 (patch-Pixmap.c) = f1e492ca2d86ea45f662ce4eb461ee6e9bce8e97
SHA1 (patch-aa) = e0912b53bc09dcea4d233aa3a2c63997a53d5c50
SHA1 (patch-ab) = d7da0a7998bbac1e25763eea5a64afb79d98d1e6
-SHA1 (patch-ac) = 5872ddb3275e2939152df87596e4bbf0b2ff5e35
+SHA1 (patch-ac) = 79ee6f598d2cace44c51c373d6274ee9f5fd1a9f
Index: pkgsrc/graphics/pixmap/patches/patch-Pixmap.c
diff -u pkgsrc/graphics/pixmap/patches/patch-Pixmap.c:1.1 pkgsrc/graphics/pixmap/patches/patch-Pixmap.c:1.2
--- pkgsrc/graphics/pixmap/patches/patch-Pixmap.c:1.1 Tue Jan 2 20:41:47 2024
+++ pkgsrc/graphics/pixmap/patches/patch-Pixmap.c Wed Dec 4 10:40:37 2024
@@ -1,14 +1,67 @@
-$NetBSD: patch-Pixmap.c,v 1.1 2024/01/02 20:41:47 nros Exp $
+$NetBSD: patch-Pixmap.c,v 1.2 2024/12/04 10:40:37 nros Exp $
-Fix implicit funvtion declaration of exit
+Fix implicit function declaration of exit.
---- Pixmap.c.orig 2024-01-02 09:18:23.243143182 +0000
+Use bundled version of rgb.c since libxpm
+does make the xpm* function names visible
+anymore.
+
+--- Pixmap.c.orig 2024-12-02 10:40:36.762246945 +0000
+++ Pixmap.c
-@@ -67,6 +67,7 @@ static char rcsid[] = "$Id: Pixmap.c,v 1
+@@ -65,8 +65,10 @@ static char rcsid[] = "$Id: Pixmap.c,v 1
+ #include <X11/cursorfont.h>
+ #define AVOID /* Avoid some clashing prototyping in Pixmap.h */
#include "PixmapP.h"
++#include "rgb.h"
#include <stdio.h>
+#include <stdlib.h>
#include <math.h>
#define XtStrlen(s) ((s) ? strlen(s) : 0)
+@@ -84,17 +86,8 @@ static int max_ncolors = -1;
+
+ /* picked up from rgb.c of Xpm lib */
+ static char *rgb_fname = RGBF ;
+-#ifndef UNUSE_XPM
+-typedef struct { /* rgb values and ascii names (from rgb text file) */
+- int r, g, b; /* rgb values, range of 0 -> 65535 */
+- char *name; /* color mnemonic of rgb value */
+-} RgbName;
+-#define MAX_RGBNAMES 1024
+-#endif /* UNUSE_XPM */
+-static RgbName rgb_table[MAX_RGBNAMES];
++static xpmRgbName rgb_table[MAX_RGBNAMES];
+
+-extern int xpmReadRgbNames();
+-extern char *xpmGetRgbName();
+
+ #define DefaultGridTolerance 5
+ #define DefaultPixmapWidth 32
+@@ -1142,7 +1135,7 @@ static void Initialize(request, new, arg
+ depth = DefaultDepth(dpy,screen);
+
+ if (max_ncolors == -1)
+- max_ncolors = xpmReadRgbNames(rgb_fname, rgb_table);
++ max_ncolors = pm_xpmReadRgbNames(rgb_fname, rgb_table);
+
+ /* allocate max colors + 1 colorTable entries because 0 is transparent */
+ if (depth <= MAX_DEPTH) {
+@@ -1703,7 +1696,7 @@ void PWUpdateColorInTable(w, pixel, symb
+
+ xcolor.pixel = pixel;
+ XQueryColor(dpy, PW->core.colormap, &xcolor);
+- rgb_name = xpmGetRgbName(rgb_table, max_ncolors,
++ rgb_name = pm_xpmGetRgbName(rgb_table, max_ncolors,
+ (int) xcolor.red,
+ (int) xcolor.green,
+ (int) xcolor.blue);
+@@ -1722,7 +1715,7 @@ void PWUpdateColorInTable(w, pixel, symb
+ xcolor.pixel = pixel;
+ XQueryColor(dpy, PW->core.colormap, &xcolor);
+
+- if (!(rgb_name = xpmGetRgbName(rgb_table, max_ncolors,
++ if (!(rgb_name = pm_xpmGetRgbName(rgb_table, max_ncolors,
+ (int) xcolor.red,
+ (int) xcolor.green,
+ (int) xcolor.blue)))
Index: pkgsrc/graphics/pixmap/patches/patch-ac
diff -u pkgsrc/graphics/pixmap/patches/patch-ac:1.7 pkgsrc/graphics/pixmap/patches/patch-ac:1.8
--- pkgsrc/graphics/pixmap/patches/patch-ac:1.7 Tue Jan 2 20:41:47 2024
+++ pkgsrc/graphics/pixmap/patches/patch-ac Wed Dec 4 10:40:37 2024
@@ -1,8 +1,11 @@
-$NetBSD: patch-ac,v 1.7 2024/01/02 20:41:47 nros Exp $
+$NetBSD: patch-ac,v 1.8 2024/12/04 10:40:37 nros Exp $
Use Motif to build pixmap.
Use rgb.txt from x11/rgb.
Use pkgsrc libXpm.
+Use bundled version of rgb.c since libxpm
+does make the xpm* function names visible
+anymore.
--- Imakefile.orig 1994-05-13 11:04:38.000000000 +0000
+++ Imakefile
@@ -43,6 +46,17 @@ Use pkgsrc libXpm.
BITMAPS = MDown MFlipHoriz MFlipVert MFold MLeft MRight MRotateLeft \
MRotateRight Stipple MUp
#else
+@@ -56,8 +54,8 @@ LOCAL_LIBRARIES = -L$(XPM_LIBDIR) -lXpm
+ #endif
+
+ SYS_LIBRARIES = -lm
+- SRCS = PixEdit.c Pixmap.c Dialog.c
+- OBJS = PixEdit.o Pixmap.o Dialog.o
++ SRCS = PixEdit.c Pixmap.c Dialog.c rgb.c
++ OBJS = PixEdit.o Pixmap.o Dialog.o rgb.o
+
+ #if ProjectX < 5
+ DEFINES = $(LOCAL_DEFINES) -DXPointer="char *" \
@@ -70,8 +68,8 @@ LOCAL_LIBRARIES = -L$(XPM_LIBDIR) -lXpm
ComplexProgramTarget(pixmap)
Added files:
Index: pkgsrc/graphics/pixmap/files/COPYRIGHT.rgb
diff -u /dev/null pkgsrc/graphics/pixmap/files/COPYRIGHT.rgb:1.1
--- /dev/null Wed Dec 4 10:40:37 2024
+++ pkgsrc/graphics/pixmap/files/COPYRIGHT.rgb Wed Dec 4 10:40:37 2024
@@ -0,0 +1,25 @@
+$NetBSD: COPYRIGHT.rgb,v 1.1 2024/12/04 10:40:37 nros Exp $
+/*
+ * Copyright (C) 1989-95 GROUPE BULL
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of GROUPE BULL shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from GROUPE BULL.
+ */
Index: pkgsrc/graphics/pixmap/files/rgb.c
diff -u /dev/null pkgsrc/graphics/pixmap/files/rgb.c:1.1
--- /dev/null Wed Dec 4 10:40:37 2024
+++ pkgsrc/graphics/pixmap/files/rgb.c Wed Dec 4 10:40:37 2024
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 1989-95 GROUPE BULL
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of GROUPE BULL shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from GROUPE BULL.
+ */
+
+/*****************************************************************************\
+* rgb.c: *
+* *
+* XPM library *
+* Rgb file utilities *
+* *
+* Developed by Arnaud Le Hors *
+\*****************************************************************************/
+
+/*
+ * Part of this code has been taken from the ppmtoxpm.c file written by Mark
+ * W. Snitily but has been modified for my special need
+ */
+
+/* $NetBSD: rgb.c,v 1.1 2024/12/04 10:40:37 nros Exp $ */
+
+#include "rgb.h"
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * Read a rgb text file. It stores the rgb values (0->65535)
+ * and the rgb mnemonics (malloc'ed) into the "rgbn" array. Returns the
+ * number of entries stored.
+ */
+int
+pm_xpmReadRgbNames(
+ const char *rgb_fname,
+ xpmRgbName rgbn[])
+{
+ FILE *rgbf;
+ int n, items, red, green, blue;
+ char line[512], name[512], *rgbname, *s1, *s2;
+ xpmRgbName *rgb;
+
+ /* Open the rgb text file. Abort if error. */
+ if ((rgbf = fopen(rgb_fname, FOPEN_RES)) == NULL)
+ return 0;
+
+ /* Loop reading each line in the file. */
+ n = 0;
+ rgb = rgbn;
+ /* Quit if rgb text file has too many entries. */
+ while (fgets(line, sizeof(line), rgbf) && n < MAX_RGBNAMES) {
+
+ /* Skip silently if line is bad. */
+ items = sscanf(line, "%d %d %d %[^\n]\n", &red, &green, &blue, name);
+ if (items != 4)
+ continue;
+
+ /*
+ * Make sure rgb values are within 0->255 range. Skip silently if
+ * bad.
+ */
+ if (red < 0 || red > 0xFF ||
+ green < 0 || green > 0xFF ||
+ blue < 0 || blue > 0xFF)
+ continue;
+
+ /* Allocate memory for ascii name. If error give up here. */
+ if (!(rgbname = (char *) malloc(strlen(name) + 1)))
+ break;
+
+ /* Copy string to ascii name and lowercase it. */
+ for (s1 = name, s2 = rgbname; *s1; s1++)
+ *s2++ = tolower(*s1);
+ *s2 = '\0';
+
+ /* Save the rgb values and ascii name in the array. */
+ rgb->r = red * 257; /* 65535/255 = 257 */
+ rgb->g = green * 257;
+ rgb->b = blue * 257;
+ rgb->name = rgbname;
+ rgb++;
+ n++;
+ }
+
+ fclose(rgbf);
+
+ /* Return the number of read rgb names. */
+ return n < 0 ? 0 : n;
+}
+
+/*
+ * Return the color name corresponding to the given rgb values
+ */
+char *
+pm_xpmGetRgbName(
+ xpmRgbName rgbn[], /* rgb mnemonics from rgb text file */
+ int rgbn_max, /* number of rgb mnemonics in table */
+ int red, /* rgb values */
+ int green,
+ int blue)
+{
+ int i;
+ xpmRgbName *rgb;
+
+ /*
+ * Just perform a dumb linear search over the rgb values of the color
+ * mnemonics. One could speed things up by sorting the rgb values and
+ * using a binary search, or building a hash table, etc...
+ */
+ for (i = 0, rgb = rgbn; i < rgbn_max; i++, rgb++)
+ if (red == rgb->r && green == rgb->g && blue == rgb->b)
+ return rgb->name;
+
+ /* if not found return NULL */
+ return NULL;
+}
+
+/*
+ * Free the strings which have been malloc'ed in xpmReadRgbNames
+ */
+void
+pm_xpmFreeRgbNames(
+ xpmRgbName rgbn[],
+ int rgbn_max)
+{
+ int i;
+ xpmRgbName *rgb;
+
+ for (i = 0, rgb = rgbn; i < rgbn_max; i++, rgb++)
+ free(rgb->name);
+}
Index: pkgsrc/graphics/pixmap/files/rgb.h
diff -u /dev/null pkgsrc/graphics/pixmap/files/rgb.h:1.1
--- /dev/null Wed Dec 4 10:40:37 2024
+++ pkgsrc/graphics/pixmap/files/rgb.h Wed Dec 4 10:40:37 2024
@@ -0,0 +1,66 @@
+/* $NETBSD$ */
+/*
+ * Copyright (C) 1989-95 GROUPE BULL
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Except as contained in this notice, the name of GROUPE BULL shall not be
+ * used in advertising or otherwise to promote the sale, use or other dealings
+ * in this Software without prior written authorization from GROUPE BULL.
+ */
+
+/*****************************************************************************\
+* XpmI.h: *
+* *
+* XPM library *
+* Internal Include file *
+* *
+* ** Everything defined here is subject to changes any time. ** *
+* *
+* Developed by Arnaud Le Hors *
+\*****************************************************************************/
+
+#ifndef __PIXMAP_RGB_H__
+#define __PIXMAP_RGB_H__
+
+#include <fcntl.h>
+
+#ifdef O_CLOEXEC
+# define FOPEN_RES "re"
+#else
+# define FOPEN_RES "r"
+# define O_CLOEXEC 0
+#endif
+
+/*
+ * rgb values and ascii names (from rgb text file) rgb values,
+ * range of 0 -> 65535 color mnemonic of rgb value
+ */
+typedef struct {
+ int r, g, b;
+ char *name;
+} xpmRgbName;
+
+/* Maximum number of rgb mnemonics allowed in rgb text file. */
+#define MAX_RGBNAMES 1024
+
+int pm_xpmReadRgbNames(const char *rgb_fname, xpmRgbName *rgbn);
+char* pm_xpmGetRgbName(xpmRgbName *rgbn, int rgbn_max, int red, int green, int blue);
+void pm_xpmFreeRgbNames(xpmRgbName *rgbn, int rgbn_max);
+
+#endif
Home |
Main Index |
Thread Index |
Old Index