NetBSD Problem Report #34718
From christianbiere@gmx.de Thu Oct 5 02:48:30 2006
Return-Path: <christianbiere@gmx.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 3804D63B84E
for <gnats-bugs@gnats.NetBSD.org>; Thu, 5 Oct 2006 02:48:30 +0000 (UTC)
Message-Id: <20061005024804.GA1791@cyclonus>
Date: Thu, 5 Oct 2006 04:48:05 +0200
From: Christian Biere <christianbiere@gmx.de>
To: gnats-bugs@NetBSD.org
Subject: Patches for aterm
X-Send-Pr-Version: 3.95
>Number: 34718
>Category: pkg
>Synopsis: Patches for aterm
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Thu Oct 05 02:50:00 +0000 2006
>Last-Modified: Mon Oct 09 02:15:06 +0000 2006
>Originator: Christian Biere
>Release: NetBSD 4.99.3
>Environment:
System: NetBSD cyclonus 4.99.3 NetBSD 4.99.3 (STARSCREAM) #0: Mon Oct 2 23:04:22 CEST 2006 src@cyclonus:/o/NetBSD/obj/sys/arch/i386/compile/STARSCREAM i386
Architecture: i386
Machine: i386
>Description:
The following patches cause the following changes:
- The configure options --enable-graphics is remove, it had no effect.
- Support for JPEG/PNG/XPM which is used for --enable-background-image
can be disabled individually.[1]
- I added the option "setuid-root" because this is unnecessary on
most modern systems (even BSDs) and potentially dangerous.
- The option "ptmx" was added to indicate support of Unix98 PTYs
(/dev/ptmx). It would be better to patch the configure script
of course. aterm doesn't detect it but has it hardcoded to
certain systems. Without this aterm doesn't work properly on
NetBSD(-current) at least not with PTYFS because it runs out
ptys after 2-3 terminals.
[1] These are actually ineffective because there's a missing dependency:
<snip>
checking installed libAfterImage... afterimage-config: not found
NO: not found
afterimage-config not found - no AfterStep integration available.
AfterStep integration
To enable background image support you will need to download and install
libAfterImage from ftp://ftp.afterstep.org/stable/libAfterImage/ and then re-run this script.
<snip>
I just wanted to disable them anyway to keep aterm light-weight, so I
don't mind this issue. A dependency on wm/afterstep would probably
fix this but I don't think installing Afterstep is really desired
in general.
>How-To-Repeat:
>Fix:
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/aterm/Makefile,v
retrieving revision 1.30
diff -u -r1.30 Makefile
--- Makefile 4 Oct 2006 22:06:56 -0000 1.30
+++ Makefile 5 Oct 2006 02:23:17 -0000
@@ -18,33 +18,12 @@
CONFIGURE_ARGS+=--enable-background-image \
--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: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/x11/aterm/distinfo,v
retrieving revision 1.10
diff -u -r1.10 distinfo
--- distinfo 1 Jan 2006 12:58:00 -0000 1.10
+++ distinfo 5 Oct 2006 02:23:17 -0000
@@ -5,3 +5,5 @@
Size (aterm-1.0.0.tar.bz2) = 248708 bytes
SHA1 (patch-ac) = 28c79343079680251a013ec3fe364b01f5a5ccac
SHA1 (patch-ad) = 0c87ee69672e98189afa2cfdcdd9691a1571f354
+SHA1 (patch-ae) = b239ab1b285cec3da463d0aba37009a7d3c2d0bb
+SHA1 (patch-af) = e2533179edaf6ca2781b5cd41d94624ab3e9d3f9
Index: options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/x11/aterm/options.mk,v
retrieving revision 1.2
diff -u -r1.2 options.mk
--- options.mk 5 Oct 2005 13:29:49 -0000 1.2
+++ options.mk 5 Oct 2006 02:23:17 -0000
@@ -1,7 +1,12 @@
# $NetBSD: options.mk,v 1.2 2005/10/05 13:29:49 wiz Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.aterm
-PKG_SUPPORTED_OPTIONS= aterm-big5 aterm-greek aterm-kanji aterm-xterm-scroll
+PKG_SUPPORTED_OPTIONS= aterm-big5 aterm-greek aterm-kanji aterm-xterm-scroll jpeg png xpm setuid-root ptmx
+PKG_SUGGESTED_OPTIONS= jpeg png xpm
+
+.if ${OPSYS:M*BSD} || ${OPSYS} == "Darwin"
+PKG_SUGGESTED_OPTIONS+= setuid-root
+.endif
.include "../../mk/bsd.options.mk"
@@ -20,3 +25,36 @@
.if !empty(PKG_OPTIONS:Materm-xterm-scroll)
CONFIGURE_ARGS+=--enable-xterm-scroll
.endif
+
+.if !empty(PKG_OPTIONS:Mjpeg)
+.include "../../graphics/jpeg/buildlink3.mk"
+CONFIGURE_ARGS+=--enable-jpeg \
+ --with-jpeg-includes=${BUILDLINK_PREFIX.jpeg}/include \
+ --with-jpeg-library=${BUILDLINK_PREFIX.jpeg}/lib
+.endif
+
+.if !empty(PKG_OPTIONS:Mpng)
+.include "../../graphics/png/buildlink3.mk"
+CONFIGURE_ARGS+=--enable-png \
+ --with-png-library=${BUILDLINK_PREFIX.png}/lib \
+ --with-png-includes=${BUILDLINK_PREFIX.png}/include
+.endif
+
+.if !empty(PKG_OPTIONS:Mxpm)
+.include "../../graphics/xpm/buildlink3.mk"
+CONFIGURE_ARGS+=--enable-xpm \
+ --with-xpm-includes=${BUILDLINK_PREFIX.xpm}/include \
+ --with-xpm-library=${BUILDLINK_PREFIX.xpm}/lib
+.endif
+
+.if !empty(PKG_OPTIONS:Msetuid-root)
+# 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
+
+.if !empty(PKG_OPTIONS:Mptmx)
+CPPFLAGS+= -DATERM_USE_DEV_PTMX
+.endif
--- /dev/null 2006-10-05 04:22:41.000000000 +0200
+++ patches/patch-ae 2006-10-05 03:41:09.000000000 +0200
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- src/command.c 2005-06-21 22:08:16.000000000 +0200
++++ src/command.c 2006-10-05 02:38:03.000000000 +0200
+@@ -542,7 +542,8 @@
+ ptydev = ttydev = _getpty(&fd, O_RDWR | O_NDELAY, 0622, 0);
+ if (ptydev == NULL)
+ goto Failed;
+-#elif defined (__svr4__) || defined(__CYGWIN32__) || defined(__lnx21__)
++#elif defined (__svr4__) || defined(__CYGWIN32__) || defined(__lnx21__) || \
++ defined(ATERM_USE_DEV_PTMX)
+ {
+ extern char *ptsname();
+
--- /dev/null 2006-10-05 04:22:41.000000000 +0200
+++ patches/patch-af 2006-10-05 03:42:26.000000000 +0200
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- src/main.c 2005-06-20 18:10:19.000000000 +0200
++++ src/main.c 2006-10-05 03:36:49.000000000 +0200
+@@ -1037,12 +1037,16 @@
+ XConfigureEvent *xconf = &(ev->xconfigure);
+
+ while( XCheckTypedWindowEvent( Xdisplay, TermWin.parent, ConfigureNotify, ev ) );
++#if !defined(NO_DEBUG_OUTPUT)
+ fprintf( stderr, "config_geom = %dx%d\n", xconf->width, xconf->height );
++#endif
+ resize_window1(xconf->width, xconf->height);
+ #if 1
+ XTranslateCoordinates (Xdisplay, TermWin.parent, Xroot, 0, 0, &root_x, &root_y, &wdumm);
+
++#if !defined(NO_DEBUG_OUTPUT)
+ fprintf( stderr, "root_geom = %dx%d%+d%+d, root_size = %dx%d\n", xconf->width, xconf->height, root_x, root_y, XdisplayWidth, XdisplayHeight );
++#endif
+ TermWin.root_x = root_x ;
+ TermWin.root_y = root_y ;
+ TermWin.root_width = xconf->width ;
>Audit-Trail:
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/34718: Patches for aterm
Date: Thu, 05 Oct 2006 15:25:18 +0200
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 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.
> - The option "ptmx" was added to indicate support of Unix98 PTYs
> (/dev/ptmx). It would be better to patch the configure script
> of course. aterm doesn't detect it but has it hardcoded to
> certain systems. Without this aterm doesn't work properly on
> NetBSD(-current) at least not with PTYFS because it runs out
> ptys after 2-3 terminals.
This and setuid-root should most likely be an option group. What about
setgid utmp?
(and no, I don't want this PR :-))
Joerg
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/+$//}
From: Thomas Klausner <wiz@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/34718: Patches for aterm
Date: Fri, 6 Oct 2006 09:16:41 +0200
What's this?
On Thu, Oct 05, 2006 at 02:50:00AM +0000, Christian Biere wrote:
> --- /dev/null 2006-10-05 04:22:41.000000000 +0200
> +++ patches/patch-af 2006-10-05 03:42:26.000000000 +0200
> @@ -0,0 +1,21 @@
> +$NetBSD$
> +
> +--- src/main.c 2005-06-20 18:10:19.000000000 +0200
> ++++ src/main.c 2006-10-05 03:36:49.000000000 +0200
> +@@ -1037,12 +1037,16 @@
> + XConfigureEvent *xconf = &(ev->xconfigure);
> +
> + while( XCheckTypedWindowEvent( Xdisplay, TermWin.parent, ConfigureNotify, ev ) );
> ++#if !defined(NO_DEBUG_OUTPUT)
> + fprintf( stderr, "config_geom = %dx%d\n", xconf->width, xconf->height );
> ++#endif
> + resize_window1(xconf->width, xconf->height);
> + #if 1
> + XTranslateCoordinates (Xdisplay, TermWin.parent, Xroot, 0, 0, &root_x, &root_y, &wdumm);
> +
> ++#if !defined(NO_DEBUG_OUTPUT)
> + fprintf( stderr, "root_geom = %dx%d%+d%+d, root_size = %dx%d\n", xconf->width, xconf->height, root_x, root_y, XdisplayWidth, XdisplayHeight );
> ++#endif
> + TermWin.root_x = root_x ;
> + TermWin.root_y = root_y ;
> + TermWin.root_width = xconf->width ;
Thomas
From: Christian Biere <christianbiere@gmx.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/34718: Patches for aterm
Date: Fri, 6 Oct 2006 09:27:08 +0200
Thomas Klausner wrote:
> What's this?
It supresses what looks like noisy debug output to me. aterm spits two
lines whenever you resize the window. You would only notice this when
you start aterm from another terminal instead of a window manager menu.
> On Thu, Oct 05, 2006 at 02:50:00AM +0000, Christian Biere wrote:
> > --- /dev/null 2006-10-05 04:22:41.000000000 +0200
> > +++ patches/patch-af 2006-10-05 03:42:26.000000000 +0200
[...]
--
Christian
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/34718: Patches for aterm
Date: Fri, 06 Oct 2006 14:30:31 +0200
On Thu, Oct 05, 2006 at 08:25:02PM +0000, Christian Biere wrote:
> 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.
The point is every option adds maintaince overhead. E.g. for an update,
each and every should be tested. That's a hassle for often ~0 gain.
E.g. I think it is excessive for multimedia/mplayer and wm/jwm, the
examples I could find without grepping every Makefile in the tree.
> 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.
Yes, that's a much better idea. You got the idea now :-)
> > > - 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 don't think it is the job of pkgsrc to do that. The package should
check if it can use grantpt (just checking whether it exists is normally
enough), if that doesn't exist openpty (from libutil, needs setuid) and
fallback to manual pty manupulation. that's the realm of configure
though.
Joerg
From: Christian Biere <christianbiere@gmx.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/34718: Patches for aterm
Date: Fri, 6 Oct 2006 15:32:29 +0200
Joerg Sonnenberger wrote:
> > If pkgsrc can detect the necessity of setuid-root itself, this doesn't
> > have to be an option of course.
> I don't think it is the job of pkgsrc to do that. The package should
> check if it can use grantpt (just checking whether it exists is normally
> enough), if that doesn't exist openpty (from libutil, needs setuid) and
> fallback to manual pty manupulation. that's the realm of configure
> though.
Yes, it's just aterm will be broken for NetBSD soon due to this /dev/ptmx
issue. Actually, I've switched to rxvt-unicode now. I wonder whether aterm
should maybe be deprecated. rxvt-unicode is 100% feature-compatible, fixes all
the above and has the advantages that it handles Unicode properly (better
than xterm), has multi-terminal support which reduces the memory footprint with
many terminals quite a lot and last but not least it's actively maintained.
So fixing aterm any further is probably just a waste of time.
--
Christian
From: Christian Biere <christianbiere@gmx.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: pkg/34718: Patches for aterm
Date: Mon, 9 Oct 2006 04:11:33 +0200
> > - The option "ptmx" was added to indicate support of Unix98 PTYs
> > (/dev/ptmx). It would be better to patch the configure script
> > of course. aterm doesn't detect it but has it hardcoded to
> > certain systems. Without this aterm doesn't work properly on
> > NetBSD(-current) at least not with PTYFS because it runs out
> > ptys after 2-3 terminals.
I've patched aterm to detect posix_openpt() and use it if available.
Thus, a pkgsrc option is no longer required. I also think --enable-ttygid
should always be used (just like for rxvt). aterm ignores if there's
no group "tty" at runtime and there's no further effect. However, without
this option the pty is stays world-writable (on many systems).
Here's the complete updated patch for x11/aterm:
--- x11/aterm/Makefile 4 Oct 2006 22:06:56 -0000 1.30
+++ x11/aterm/Makefile 9 Oct 2006 02:03:57 -0000
@@ -15,36 +15,15 @@
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"
+ --enable-wtmp \
+ --enable-ttygid
.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"
--- x11/aterm/distinfo 1 Jan 2006 12:58:00 -0000 1.10
+++ x11/aterm/distinfo 9 Oct 2006 02:03:57 -0000
@@ -5,3 +5,5 @@
Size (aterm-1.0.0.tar.bz2) = 248708 bytes
SHA1 (patch-ac) = 28c79343079680251a013ec3fe364b01f5a5ccac
SHA1 (patch-ad) = 0c87ee69672e98189afa2cfdcdd9691a1571f354
+SHA1 (patch-ae) = 56ac79c51fa19089d15ab24a7bf3de8f6116a8b5
+SHA1 (patch-af) = e2533179edaf6ca2781b5cd41d94624ab3e9d3f9
--- x11/aterm/options.mk 5 Oct 2005 13:29:49 -0000 1.2
+++ x11/aterm/options.mk 9 Oct 2006 02:03:57 -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
+PKG_SUGGESTED_OPTIONS=
+
+.if ${OPSYS:M*BSD} || ${OPSYS} == "Darwin"
+PKG_SUGGESTED_OPTIONS+= aterm-suid
+.endif
.include "../../mk/bsd.options.mk"
@@ -20,3 +26,37 @@
.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-suid)
+# Make aterm setuid root so that tty ownership setting and utmp logging
+# function correctly.
+#
+SPECIAL_PERMS= ${PREFIX}/bin/aterm ${SETUID_ROOT_PERMS}
+.endif
--- mk/defaults/options.description 24 Sep 2006 16:22:42 -0000 1.117
+++ mk/defaults/options.description 9 Oct 2006 02:06:11 -0000
@@ -15,7 +15,9 @@
aspell
aterm-big5 Enable Chinese support.
aterm-greek Enable Greek keyboard support.
+aterm-afterstep Enable AfterStep integration.
aterm-kanji Enable kanji support.
+aterm-suid Install aterm executable setuid root.
aterm-xterm-scroll Use xterm-scrollbar instead of a NeXT-like one.
audiofile
authlib
@@ -215,7 +217,7 @@
pcb-motif Use Motif for the gui instead of GTK for cad/pcb.
pcre
perf-tuning
-perl
+perl Enable Perl support.
pf
pgsql Enable PostgreSQL support.
pinfo-native-curses Use NetBSD native curses rather than ncurses.
@@ -359,6 +361,7 @@
xorg-server-vga
xorg-server-via
xorg-server-vmware
+xpm Enable XPM support.
xrender Enable Xrender support.
xscreensaver-webcollage Install webcollage screensaver.
xterm-256color Enable 256 color support.
--- /dev/null 2006-10-09 03:49:53.000000000 +0200
+++ x11/aterm/patches/patch-ae 2006-10-09 03:20:21.000000000 +0200
@@ -0,0 +1,56 @@
+$NetBSD$
+
+--- autoconf/config.h.in 2004-11-11 00:40:13.000000000 +0100
++++ autoconf/config.h.in 2006-10-09 03:16:17.000000000 +0200
+@@ -28,6 +28,9 @@
+ /* Define to 1 if you have the `getpt' function. */
+ #undef HAVE_GETPT
+
++/* Define to 1 if you have the `posix_openpt' function. */
++#undef HAVE_POSIX_OPENPT
++
+ /* Define to 1 if you have the <grp.h> header file. */
+ #undef HAVE_GRP_H
+
+--- autoconf/configure.in 2005-07-05 17:30:15.000000000 +0200
++++ autoconf/configure.in 2006-10-09 03:13:37.000000000 +0200
+@@ -423,7 +423,7 @@
+
+ AC_HEADER_TIME
+
+-AC_CHECK_FUNCS(getpt)
++AC_CHECK_FUNCS(getpt posix_openpt)
+
+ AC_C_CONST
+ AC_C_INLINE
+--- configure 2005-07-05 17:30:15.000000000 +0200
++++ configure 2006-10-09 03:13:23.000000000 +0200
+@@ -7048,7 +7048,7 @@
+
+
+
+-for ac_func in getpt
++for ac_func in getpt posix_openpt
+ do
+ as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ echo "$as_me:$LINENO: checking for $ac_func" >&5
+--- src/command.c 2005-06-21 22:08:16.000000000 +0200
++++ src/command.c 2006-10-09 03:17:53.000000000 +0200
+@@ -542,13 +542,16 @@
+ ptydev = ttydev = _getpty(&fd, O_RDWR | O_NDELAY, 0622, 0);
+ if (ptydev == NULL)
+ goto Failed;
+-#elif defined (__svr4__) || defined(__CYGWIN32__) || defined(__lnx21__)
++#elif defined (__svr4__) || defined(__CYGWIN32__) || defined(__lnx21__) \
++ || defined(HAVE_POSIX_OPENPT)
+ {
+ extern char *ptsname();
+
+ /* open the STREAMS, clone device /dev/ptmx (master pty) */
+ #ifdef HAVE_GETPT
+ if ((fd = getpt()) < 0) {
++#elif defined(HAVE_POSIX_OPENPT)
++ if ((fd = posix_openpt(O_RDWR)) < 0) {
+ #else
+ if ((fd = open("/dev/ptmx", O_RDWR)) < 0) {
+ #endif
--- /dev/null 2006-10-09 03:49:53.000000000 +0200
+++ x11/aterm/patches/patch-af 2006-10-05 04:25:19.000000000 +0200
@@ -0,0 +1,21 @@
+$NetBSD$
+
+--- src/main.c 2005-06-20 18:10:19.000000000 +0200
++++ src/main.c 2006-10-05 03:36:49.000000000 +0200
+@@ -1037,12 +1037,16 @@
+ XConfigureEvent *xconf = &(ev->xconfigure);
+
+ while( XCheckTypedWindowEvent( Xdisplay, TermWin.parent, ConfigureNotify, ev ) );
++#if !defined(NO_DEBUG_OUTPUT)
+ fprintf( stderr, "config_geom = %dx%d\n", xconf->width, xconf->height );
++#endif
+ resize_window1(xconf->width, xconf->height);
+ #if 1
+ XTranslateCoordinates (Xdisplay, TermWin.parent, Xroot, 0, 0, &root_x, &root_y, &wdumm);
+
++#if !defined(NO_DEBUG_OUTPUT)
+ fprintf( stderr, "root_geom = %dx%d%+d%+d, root_size = %dx%d\n", xconf->width, xconf->height, root_x, root_y, XdisplayWidth, XdisplayHeight );
++#endif
+ TermWin.root_x = root_x ;
+ TermWin.root_y = root_y ;
+ TermWin.root_width = xconf->width ;
--
Christian
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.