diff options
author | tv <tv> | 1999-05-05 21:01:46 +0000 |
---|---|---|
committer | tv <tv> | 1999-05-05 21:01:46 +0000 |
commit | b811520ea20a88e99dc5d11929851e105d05fd10 (patch) | |
tree | 5151664ddaf2b68746451f708c878a73d78f8d3a | |
parent | 045eee6a9db1ac0960dfc0bb0f201267fcf52ad6 (diff) | |
download | pkgsrc-b811520ea20a88e99dc5d11929851e105d05fd10.tar.gz |
Add a C version of pdb_self_doc so that this does not require Emacs
in order to build with docs.
-rw-r--r-- | graphics/gimp/Makefile | 61 | ||||
-rw-r--r-- | graphics/gimp/files/pdb_self_doc.c | 180 | ||||
-rw-r--r-- | graphics/gimp/patches/patch-ac | 16 |
3 files changed, 226 insertions, 31 deletions
diff --git a/graphics/gimp/Makefile b/graphics/gimp/Makefile index 23c120a2156..c355a01296d 100644 --- a/graphics/gimp/Makefile +++ b/graphics/gimp/Makefile @@ -1,26 +1,25 @@ -# $NetBSD: Makefile,v 1.37 1999/05/04 22:47:21 tron Exp $ - -DISTNAME= gimp-1.0.4 -CATEGORIES= graphics -MASTER_SITES= ftp://ftp.gimp.org/pub/gimp/v1.0/v1.0.4/ \ - ftp://infosoc.uni-koeln.de/pub/ftp.gimp.org/pub/gimp/v1.0/v1.0.4/ \ - ftp://ftp.cs.umn.edu/pub/gimp/gimp/v1.0/v1.0.4/ -EXTRACT_SUFX= .tar.bz2 -DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ - ${GIMP_DATA}${EXTRACT_SUFX} - -MAINTAINER= bsieker@techfak.uni-bielefeld.de -HOMEPAGE= http://www.gimp.org/ - -BUILD_DEPENDS= emacs:../../editors/emacs -DEPENDS+= jpeg-6b:../../graphics/jpeg -DEPENDS+= gtk+-1.2.2:../../x11/gtk -DEPENDS+= mpeg-1.2.1:../../graphics/mpeg-lib -DEPENDS+= png-1.0.3:../../graphics/png -DEPENDS+= tiff-3.4:../../graphics/tiff -DEPENDS+= xpm-3.4k:../../graphics/xpm - -GIMP_DATA= gimp-data-extras-1.0.0 +# $NetBSD: Makefile,v 1.38 1999/05/05 21:01:46 tv Exp $ + +DISTNAME= gimp-1.0.4 +CATEGORIES= graphics +MASTER_SITES= ftp://ftp.gimp.org/pub/gimp/v1.0/v1.0.4/ \ + ftp://infosoc.uni-koeln.de/pub/ftp.gimp.org/pub/gimp/v1.0/v1.0.4/ \ + ftp://ftp.cs.umn.edu/pub/gimp/gimp/v1.0/v1.0.4/ +EXTRACT_SUFX= .tar.bz2 +DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ + ${GIMP_DATA}${EXTRACT_SUFX} + +MAINTAINER= bsieker@techfak.uni-bielefeld.de +HOMEPAGE= http://www.gimp.org/ + +DEPENDS+= jpeg-6b:../../graphics/jpeg +DEPENDS+= gtk+-1.2.2:../../x11/gtk +DEPENDS+= mpeg-1.2.1:../../graphics/mpeg-lib +DEPENDS+= png-1.0.3:../../graphics/png +DEPENDS+= tiff-3.4:../../graphics/tiff +DEPENDS+= xpm-3.4k:../../graphics/xpm + +GIMP_DATA= gimp-data-extras-1.0.0 .ifndef DISPLAY IS_INTERACTIVE= yes @@ -39,19 +38,19 @@ INFO_FILES= pdb.info post-configure: @${ECHO_MSG} "--> now configuring in ${GIMP_DATA}" @(cd ${WRKDIR}/${GIMP_DATA} && ${SETENV} ${CONFIGURE_ENV} \ - ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}) + ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS}) pre-build: - @if [ "$$DISPLAY" = "" ]; then \ - ${ECHO} "${DISTNAME} can only be built under X11."; \ - exit 1; \ - fi + @if [ "$$DISPLAY" = "1" ]; then \ + ${ECHO} "${DISTNAME} can only be built under X11."; \ + exit 1; \ + fi + ${LINK.c} -o ${WRKSRC}/docs/pdb_self_doc ${FILESDIR}/pdb_self_doc.c post-install: @(cd ${WRKSRC}/docs && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKEFILE} ${ALL_TARGET}) @(cd ${WRKSRC}/docs && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} ${MAKE_FLAGS} -f ${MAKEFILE} ${INSTALL_TARGET}) - @${ECHO_MSG} "--> now installing in ${GIMP_DATA}" @(cd ${WRKDIR}/${GIMP_DATA} && ${SETENV} ${MAKE_ENV} ${MAKE_PROGRAM} \ - ${MAKE_FLAGS} -f ${MAKEFILE} ${INSTALL_TARGET}) + ${MAKE_FLAGS} -f ${MAKEFILE} ${INSTALL_TARGET}) -.include <../../mk/bsd.pkg.mk> +.include "../../mk/bsd.pkg.mk" diff --git a/graphics/gimp/files/pdb_self_doc.c b/graphics/gimp/files/pdb_self_doc.c new file mode 100644 index 00000000000..beed65a7422 --- /dev/null +++ b/graphics/gimp/files/pdb_self_doc.c @@ -0,0 +1,180 @@ +/* $NetBSD: pdb_self_doc.c,v 1.1 1999/05/05 21:01:48 tv Exp $ */ + +/* + * C version of pdb_self_doc.el, makes some assumptions about the structure + * of the pdb_dump file. + * + * Author: Todd Vierling <tv@pobox.com> + * Copyright: Do whatever you want with this code. I offer no guarantee or + * warranty of any kind. + */ + +#include <ctype.h> +#ifdef __NetBSD__ +#include <err.h> +#endif +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#ifndef __NetBSD__ +#include <stdarg.h> +void errx (int rc, char *fmt,...) +{ + va_list ap; + + va_start (ap, fmt); + fputs ("pdb_self_doc: ", stderr); + vfprintf (stderr, fmt, ap); + exit (rc); +} +#endif + +int depth, line; + +static struct ioarg { + struct ioarg *next; + char *hlist[3]; +} **curioargs, *curioarg; + +static struct procedure { + char *hlist[7]; + struct ioarg *iargs; + struct ioarg *oargs; +} procs[800], *curproc; + +static char **hlist; + +int hnum, hmax, inum, onum, iomode; +int nprocs; + +#define wsspan(p) strspn(p, " \t\r\n") + +static char *strndup(const char *x, int len) { + char *p = malloc(len + 1); + strncpy(p, x, len); + p[len] = 0; + return p; +} + +static int proccompar(const void *a, const void *b) { + return strcmp(((struct procedure *)a)->hlist[0], + ((struct procedure *)b)->hlist[0]); +} + +int main(int argc, char **argv) { + char buf[65536], *p; + int i; + + while (fgets(buf, 65536, stdin)) { + line++; + p = buf + wsspan(buf); + + while (*p) { + if (*p == '(') { + depth++; + p++; + if (!curproc && depth > 1) + errx(1, "depth > 1 without register-procedure on line %d\n", line); + if (depth > 3) + errx(1, "depth > 3 on line %d\n", line); + if (depth == 1) { + hnum = 0; + hmax = 7; + } else if (depth == 2) { + hmax = 3; + if (++iomode > 1) + curioargs = &curproc->oargs; + else + curioargs = &curproc->iargs; + } else if (depth == 3) { + struct ioarg *arg = calloc(1, sizeof(*arg)); + *curioargs = curioarg = arg; + curioargs = &arg->next; + hnum = 0; + hlist = arg->hlist; + } + } else if (*p == ')') { + depth--; + p++; + if (depth == 0) { + hnum = hmax = inum = onum = iomode = 0; + curproc = NULL; + hlist = NULL; + } else if (depth == 1) { + curioargs = NULL; + } else if (depth == 2) { + curioarg = NULL; + } + } else if (*p == '\"') { + char *eq = ++p, *neq; + + if ((depth != 1) && (depth != 3)) + errx(1, "string with depth != 1 or 3 on line %d: %s\n", line, --p); + if (!curproc) + errx(1, "string without register-procedure on line %d\n", line); + if (hnum >= hmax) + errx(1, "too many strings on line %d\n", line); + + while ((neq = strchr(eq, '\"')) && (neq > p) && (neq[-1] == '\\')) { + strcpy(neq - 1, neq); + eq = neq; + } + if (!neq) { + --p; + if (!fgets(buf + strlen(buf), 65536 - strlen(buf), stdin)) + errx(1, "EOF in string at line %d\n", line); + continue; + } + + hlist[hnum++] = strndup(p, neq - p); + p = ++neq; + } else if (!strncmp(p, "register-procedure", 18)) { + if (depth != 1) + errx(1, "register-procedure at depth %d, line %d\n", depth, line); + p += 18; + curproc = &procs[nprocs++]; + hlist = curproc->hlist; + } else { + errx(1, "unknown token on line: %s\n", line, p); + } + p += wsspan(p); + } + } + + qsort(procs, nprocs, sizeof(procs[0]), proccompar); + + for (i = 0; i < nprocs; i++) { + struct ioarg *arg; + + printf("@defun %s ", procs[i].hlist[0]); + for (arg = procs[i].iargs; arg; arg = arg->next) { + if (arg->next) + printf("%s, ", arg->hlist[0]); + else + printf("%s", arg->hlist[0]); + } + printf("\n%s--@strong{%s}", procs[i].hlist[2], procs[i].hlist[6]); + if (procs[i].iargs) { + puts("\n\n@strong{Inputs}\n@itemize @bullet"); + for (arg = procs[i].iargs; arg; arg = arg->next) { + arg->hlist[2][0] = toupper(arg->hlist[2][0]); + printf("@item @emph{%s} (%s)--%s\n", arg->hlist[0], + arg->hlist[1], arg->hlist[2]); + } + puts("@end itemize"); + } + if (procs[i].oargs) { + puts("\n\n@strong{Outputs}\n@itemize @bullet"); + for (arg = procs[i].oargs; arg; arg = arg->next) { + arg->hlist[2][0] = toupper(arg->hlist[2][0]); + printf("@item @emph{%s} (%s)--%s\n", arg->hlist[0], + arg->hlist[1], arg->hlist[2]); + } + puts("@end itemize"); + } + printf("@end defun\n@emph{%s}\n\n", procs[i].hlist[3]); + } + + return 0; +} diff --git a/graphics/gimp/patches/patch-ac b/graphics/gimp/patches/patch-ac new file mode 100644 index 00000000000..c2f7a34d9a3 --- /dev/null +++ b/graphics/gimp/patches/patch-ac @@ -0,0 +1,16 @@ +$NetBSD: patch-ac,v 1.8 1999/05/05 21:01:49 tv Exp $ + +--- docs/Makefile.in.orig Wed May 5 16:11:26 1999 ++++ docs/Makefile.in Wed May 5 16:12:09 1999 +@@ -463,9 +463,8 @@ + maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +-pdb_dump.texi: $(srcdir)/pdb_self_doc.el $(srcdir)/pdb_dump +- cd $(srcdir) && \ +- @EMACS@ --batch -l pdb_self_doc.el -f make-docs-noargs ++pdb_dump.texi: $(srcdir)/pdb_self_doc $(srcdir)/pdb_dump ++ $(srcdir)/pdb_self_doc <$(srcdir)/pdb_dump >pdb_dump.texi + + $(srcdir)/pdb_dump: $(top_srcdir)/app/*.c + $(top_builddir)/app/gimp --no-interface --batch '(gimp-procedural-db-dump "pdb_dump.tmp")' '(gimp-quit 0)' |