Subject: Re: indent vs. gindent
To: James K. Lowden <jklowden@schemamania.org>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 10/19/2002 14:02:36
[ On Saturday, October 19, 2002 at 13:20:08 (-0400), James K. Lowden wrote: ]
> Subject: indent vs. gindent
>
> Why is gindent a package?  Why is it not /usr/bin/indent?  
> 
> It has a BSD license and is derived from BSD indent(1), per the man page. 

Hmmm..... I don't think that's entirely true.  If I understand correctly
the changes which make it into 'GNU indent' have been assigned to the
FSF under the GPL copyright, though that's not entirely clear in the
notices which come with it.

> NetBSD's indent is, um, suboptimal.  At least, I couldn't get it to
> consistently line up switch statements.  

I haven't had any noticable problem when using:

	-bad -bap -bc -br -nbs -c49 -cd33 -ncdb -ce -cli0 -d0 -di16 -ndj -ei -neei -nfc1 -i8 -ip -l256 -lp -npcs -psl -sc -nsob -Tptrdiff_t -Tsize_t -Tssize_t -Toff_t -Ttime_t -Tclock_t -Tsocklen_t -Tbool_t -Tenum_t -Tu_char -Tu_short -Tu_int -Tu_long -Tuchar -Tushort -Tuint -Tulong -Tunchar -Tquad_t -Tu_quad_t -Tqaddr_t -Tlonglong_t -Tu_longlong_t -Tregoff_t -Twchar_t -Tint8_t -Tuint8_t -Tu_int8_t -Tint16_t -Tuint16_t -Tu_int16_t -Tint32_t -Tuint32_t -Tu_int32_t -Tint64_t -Tuint64_t -Tu_int64_t -Tintptr_t -Tuintptr_t -Tva_list -Tmode_t -Toff_t -Tpid_t -Tuid_t -Tgid_t -Trlim_t

> I realize it's not a burning issue, but it's surprisingly used:
> 
> $ pkg_info gindent |grep -E '^[a-z].+[0-9]$' |wc -l
>       36

I think that's only because it's claimed to be a run-time dependency of
net/ORBit (which seems to be a core library for lots of things, though
on my system it's only mozilla at the moment, so I get "1").

(Un)fortunately that claim is, strictly speaking at least, false.  GNU
Indent is not really required by ORBit.  It's used in the IDL compiler,
but _any_ indent will do, and indeed it'll happily use "cat" if none is
available at all (i.e. if you configure it with '--disable-indent').

If you configure net/ORBit with the following patch then you'll find it
happily choses the following indent command using /usr/bin/indent:

	indent -npro -bad -bap -bc -sob -br -ce -cli2 -npcs -di1 -psl -i3 -lp -st

I.e. you don't even have to configure with '--enable-indent=kr'.

Index: Makefile
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/net/ORBit/Makefile,v
retrieving revision 1.79
diff -c -r1.79 Makefile
*** Makefile	27 Sep 2002 00:45:13 -0000	1.79
--- Makefile	19 Oct 2002 17:51:55 -0000
***************
*** 10,18 ****
  HOMEPAGE=		http://www.gnome.org/
  COMMENT=		high-performance CORBA ORB with support for the C language
  
! DEPENDS+=		gindent-[0-9]*:../../devel/gindent
! 
  AUTOMAKE_OVERRIDE=	NO	# Otherwise breaks 1.5 arm32
  USE_GMAKE=		YES
  USE_LIBTOOL=		YES
  LIBTOOL_OVERRIDE+=	${WRKSRC}/libtool
--- 10,19 ----
  HOMEPAGE=		http://www.gnome.org/
  COMMENT=		high-performance CORBA ORB with support for the C language
  
! .if (${MACHINE_ARCH} == "arm32")
  AUTOMAKE_OVERRIDE=	NO	# Otherwise breaks 1.5 arm32
+ .endif
+ 
  USE_GMAKE=		YES
  USE_LIBTOOL=		YES
  LIBTOOL_OVERRIDE+=	${WRKSRC}/libtool


-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>