Subject: Re: pkg/34718: Patches for aterm
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: Christian Biere <christianbiere@gmx.de>
List: pkgsrc-bugs
Date: 10/05/2006 20:25:02
The following reply was made to PR pkg/34718; it has been noted by GNATS.

From: Christian Biere <christianbiere@gmx.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/34718: Patches for aterm
Date: Thu, 5 Oct 2006 22:24:12 +0200

 Joerg Sonnenberger wrote:
 >  On Thu, Oct 05, 2006 at 02:50:00AM +0000, Christian Biere wrote:
 >  >  - Support for JPEG/PNG/XPM which is used for --enable-background-image
 >  >    can be disabled individually.[1]
   
 >  I don't think this makes much sense since almost anyone with X11 has
 >  those three libs installed anyway.
 
 I don't agree because minimizing dependencies is always an advantage.
 You don't have to. You can compile it all in. I've noticed that "png"
 and "jpeg" are known pkgsrc options. Shouldn't these be respected
 by every package for which these are not mandatory? I thought that's
 the idea. Anyway, I've removed this individual configuration and added
 an option to enable all or nothing.
 
 These are only used if background image support is enabled
 which requires AfterStep. I've modified the patches to fix this
 i.e., I added an option "aterm-afterstep" which adds AfterStep
 as dependency and enables the background-image support.
 
 >  >  - I added the option "setuid-root" because this is unnecessary on
 >  >    most modern systems (even BSDs) and potentially dangerous.
   
 >  Well, at least on DragonFly and NetBSD before 3.0 it is still needed.
 
 If pkgsrc can detect the necessity of setuid-root itself, this doesn't
 have to be an option of course.
 
 I've fixed my patches so that pkglint doesn't complain anymore. I've
 also renamed the options to "aterm-suid" and "aterm-ptmx".
 
 
 Index: mk/defaults/options.description
 ===================================================================
 RCS file: /cvsroot/pkgsrc/mk/defaults/options.description,v
 retrieving revision 1.117
 diff -u -r1.117 options.description
 --- mk/defaults/options.description	24 Sep 2006 16:22:42 -0000	1.117
 +++ mk/defaults/options.description	5 Oct 2006 20:06:32 -0000
 @@ -15,7 +15,10 @@
  aspell	
  aterm-big5		Enable Chinese support.
  aterm-greek		Enable Greek keyboard support.
 +aterm-afterstep		Enable AfterStep integration.
  aterm-kanji		Enable kanji support.
 +aterm-ptmx		Use /dev/ptmx.
 +aterm-suid		Install aterm executable setuid root.
  aterm-xterm-scroll	Use xterm-scrollbar instead of a NeXT-like one.
  audiofile	
  authlib	
 Index: x11/aterm/Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/x11/aterm/Makefile,v
 retrieving revision 1.30
 diff -u -r1.30 Makefile
 --- x11/aterm/Makefile	4 Oct 2006 22:06:56 -0000	1.30
 +++ x11/aterm/Makefile	5 Oct 2006 20:06:06 -0000
 @@ -15,36 +15,14 @@
  
  GNU_CONFIGURE=	YES
  
 -CONFIGURE_ARGS+=--enable-background-image \
 -		--enable-transparency \
 +CONFIGURE_ARGS+=--enable-transparency \
  		--enable-fading \
 -		--enable-graphics \
 -		--with-xpm \
 -		--with-xpm-includes=${BUILDLINK_PREFIX.xpm}/include \
 -		--with-xpm-library=${BUILDLINK_PREFIX.xpm}/lib \
 -		--with-jpeg \
 -		--with-jpeg-includes=${BUILDLINK_PREFIX.jpeg}/include \
 -		--with-jpeg-library=${BUILDLINK_PREFIX.jpeg}/lib \
 -		--with-png \
 -		--with-png-library=${BUILDLINK_PREFIX.png}/lib \
 -		--with-png-includes=${BUILDLINK_PREFIX.png}/include \
  		--enable-utmp \
  		--enable-wtmp
  
 -.include "options.mk"
 -
  .include "../../mk/bsd.prefs.mk"
  
 -.if ${OPSYS:M*BSD} || ${OPSYS} == "Darwin"
 -# Make aterm setuid root so that tty ownership setting and utmp logging
 -# function correctly.
 -#
 -CONFIGURE_ARGS+=	--enable-ttygid
 -SPECIAL_PERMS=		${PREFIX}/bin/aterm ${SETUID_ROOT_PERMS}
 -.endif
 -
 -.include "../../graphics/jpeg/buildlink3.mk"
 -.include "../../graphics/png/buildlink3.mk"
 -.include "../../graphics/xpm/buildlink3.mk"
 +.include "options.mk"
  
 +.include "../../mk/x11.buildlink3.mk"
  .include "../../mk/bsd.pkg.mk"
 Index: x11/aterm/options.mk
 ===================================================================
 RCS file: /cvsroot/pkgsrc/x11/aterm/options.mk,v
 retrieving revision 1.2
 diff -u -r1.2 options.mk
 --- x11/aterm/options.mk	5 Oct 2005 13:29:49 -0000	1.2
 +++ x11/aterm/options.mk	5 Oct 2006 20:06:06 -0000
 @@ -2,6 +2,12 @@
  
  PKG_OPTIONS_VAR=	PKG_OPTIONS.aterm
  PKG_SUPPORTED_OPTIONS=	aterm-big5 aterm-greek aterm-kanji aterm-xterm-scroll
 +PKG_SUPPORTED_OPTIONS+=	aterm-afterstep aterm-suid aterm-ptmx
 +PKG_SUGGESTED_OPTIONS=
 +
 +.if ${OPSYS:M*BSD} || ${OPSYS} == "Darwin"
 +PKG_SUGGESTED_OPTIONS+=	aterm-suid
 +.endif
  
  .include "../../mk/bsd.options.mk"
  
 @@ -20,3 +26,42 @@
  .if !empty(PKG_OPTIONS:Materm-xterm-scroll)
  CONFIGURE_ARGS+=--enable-xterm-scroll
  .endif
 +
 +.if !empty(PKG_OPTIONS:Materm-afterstep)
 +CONFIGURE_ARGS+=--with-afterimage-config=${BUILDLINK_PREFIX.afterstep}/bin \
 +		--with-afterstep-config=${BUILDLINK_PREFIX.afterstep}/bin \
 +		--enable-background-image \
 +		--enable-jpeg \
 +		--with-jpeg-includes=${BUILDLINK_PREFIX.jpeg}/include \
 +		--with-jpeg-library=${BUILDLINK_PREFIX.jpeg}/lib \
 +		--enable-png \
 +		--with-png-library=${BUILDLINK_PREFIX.png}/lib \
 +		--with-png-includes=${BUILDLINK_PREFIX.png}/include \
 +		--enable-xpm \
 +		--with-xpm-includes=${BUILDLINK_PREFIX.xpm}/include \
 +		--with-xpm-library=${BUILDLINK_PREFIX.xpm}/lib
 +
 +.include "../../graphics/jpeg/buildlink3.mk"
 +.include "../../graphics/png/buildlink3.mk"
 +.include "../../graphics/xpm/buildlink3.mk"
 +.include "../../wm/afterstep/buildlink3.mk"
 +.else
 +CONFIGURE_ARGS+=--without-afterstep-config \
 +		--without-afterimage-config \
 +		--disable-background-image \
 +		--disable-jpeg \
 +		--disable-png \
 +		--disable-xpm
 +.endif
 +
 +.if !empty(PKG_OPTIONS:Materm-ptmx)
 +CPPFLAGS+=	-DATERM_USE_DEV_PTMX
 +.endif
 +
 +.if !empty(PKG_OPTIONS:Materm-suid)
 +# Make aterm setuid root so that tty ownership setting and utmp logging
 +# function correctly.
 +#
 +CONFIGURE_ARGS+=	--enable-ttygid
 +SPECIAL_PERMS=		${PREFIX}/bin/aterm ${SETUID_ROOT_PERMS}
 +.endif
 --- /dev/null	2006-10-05 22:04:35.000000000 +0200
 +++ wm/afterstep/buildlink3.mk	2006-10-05 21:10:23.000000000 +0200
 @@ -0,0 +1,22 @@
 +# $NetBSD: buildlink3.mk,v 1.16 2006/07/08 23:10:53 jlam Exp $
 +
 +BUILDLINK_DEPTH:=	${BUILDLINK_DEPTH}+
 +AFTERSTEP_BUILDLINK3_MK:=	${AFTERSTEP_BUILDLINK3_MK}+
 +
 +.if !empty(BUILDLINK_DEPTH:M+)
 +BUILDLINK_DEPENDS+=	afterstep
 +.endif
 +
 +BUILDLINK_PACKAGES:=	${BUILDLINK_PACKAGES:Nafterstep}
 +BUILDLINK_PACKAGES+=	afterstep
 +BUILDLINK_ORDER:=	${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}afterstep
 +
 +.if !empty(AFTERSTEP_BUILDLINK3_MK:M+)
 +BUILDLINK_API_DEPENDS.afterstep+=	afterstep-[0-9]*
 +BUILDLINK_API_DEPENDS.afterstep?=	afterstep-[0-9]*
 +BUILDLINK_PKGSRCDIR.afterstep?=	../../wm/afterstep
 +.endif	# AFTERSTEP_BUILDLINK3_MK
 +
 +.include "../../graphics/tiff/buildlink3.mk"
 +
 +BUILDLINK_DEPTH:=	${BUILDLINK_DEPTH:S/+$//}