Subject: pkg/26003: piewm not respecting/using GNU_PROGRAM_PREFIX (patch included)
To: None <>
From: None <>
List: pkgsrc-bugs
Date: 06/21/2004 22:12:14
>Number:         26003
>Category:       pkg
>Synopsis:       piewm not respecting/using GNU_PROGRAM_PREFIX (patch included)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 21 22:13:00 UTC 2004
>Originator:     Noud de Brouwer
>Release:        2.0_BETA
NetBSD 2.0_BETA NetBSD 2.0_BETA (ME_LAPTOP) #0: Thu Apr 22 09:25:13 CEST 2004  root@host006:/usr/src/sys/arch/i386/compile/ME_LAPTOP i386

piewm doesn't use our GNU_PROGRAM_PREFIX environment variable.
worst..piewm uses /usr/bin/m4 w/ unknown option..thus failing.
build piewm .. see it failing to read system.twmrc

(piewm 2>>/tmp/X.log) &

/tmp/X.log containing:

m4: unknown option -- s
m4: unknown option -- s
usage: m4 [-Pg] [-Dname[=val]] [-I dirname] [-Uname]
        [-d flags] [-o trfile] [-t macro]

using /usr/bin/m4 w/ unknown option -s
add this patch:


--- parse.c	1998-06-03 15:41:45.000000000 +0000
+++	2004-06-15 21:52:35.000000000 +0000
@@ -1376,7 +1376,7 @@
 		dup2(fids[1], 1);	/* stdout = pipe to parent */
 		/* get_defs("m4", dpy, display_name) */
 		tmp_file = m4_defs(dpy, display_name);
-		execlp("m4", "m4", "-s", tmp_file, "-", NULL); 
+		execlp("@GNU_PROGRAM_PREFIX@m4", "@GNU_PROGRAM_PREFIX@m4", "-s", tmp_file, "-", NULL); 
 		/* If we get here we are screwed... */
 		perror("Can't execlp() m4");

and this to Makefile:

	@${CP} ${WRKSRC}/parse.c ${WRKSRC}/parse.c.BK
	@${SED} -e "s|@GNU_PROGRAM_PREFIX@|${GNU_PROGRAM_PREFIX}|g" < ${WRKSRC}/parse.c.BK > ${WRKSRC}/parse.c
	@${SED} -e "s|@GNU_PROGRAM_PREFIX@|g|g" < ${WRKSRC}/parse.c.BK > ${WRKSRC}/parse.c

piewm now respects and uses GNU_PROGRAM_PREFIX.