Subject: pkg/21887: make pico build under Linux
To: None <gnats-bugs@gnats.netbsd.org>
From: None <reed@reedmedia.net>
List: netbsd-bugs
Date: 06/14/2003 17:56:01
>Number:         21887
>Category:       pkg
>Synopsis:       make editors/pico build under Linux
>Confidential:   yes
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 15 00:56:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.6
>Organization:
http://bsd.reedmedia.net/
>Environment:
	
	
System: NetBSD rainier.reedmedia.net 1.6 NetBSD 1.6 (JCR-20020927) #3: Sat Sep 28 13:40:20 PDT 2002 reed@rainier.reedmedia.net:/usr/src/sys/arch/i386/compile/JCR-20020927 i386
Architecture: i386
Machine: i386
>Description:
Below is a new patch-ag and patches so editors/pico
can build under Linux.

It also improves DESCR (formatting and additional text).

Also, COMMENT should include "Pilot" but I didn't
provide wording for that. (Or Pilot should be like
sysutils/pilot instead.)

By the way, in February, I split out c-client
so pine can install without also installing mail
retrieval servers. I will import to pkgsrc-wip,
but also current packages need to be changed too.
Maybe I'll import all to pkgsrc-wip for testing.
(I should upgrade to latest pine too.)

>How-To-Repeat:
	
>Fix:

This includes patches and the patch-ag file at bottom.

? editors/pico/patches/patch-ag
Index: editors/pico/DESCR
===================================================================
RCS file: /cvsroot/pkgsrc/editors/pico/DESCR,v
retrieving revision 1.2
diff -b -u -r1.2 DESCR
--- editors/pico/DESCR	2003/05/06 17:41:06	1.2
+++ editors/pico/DESCR	2003/06/15 00:49:14
@@ -1,5 +1,9 @@
-Pico is a simple text editor with limited searching, block cut and paste,
-and spell checking features.
+Pico is a simple text editor with limited searching, block cut and
+paste, and spell checking features.
 
-The pico pkg includes libpico, the library used by Pine for its display
-and text editing capabilities.
+The pico package provides libpico, the library used by the Pine
+email client for its display and text editing capabilities.
+
+This also includes pilot(1), which is a simple, console-based,
+display-oriented file system navigator. Pilot provides basic file
+manipulation commands.
Index: editors/pico/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/editors/pico/Makefile,v
retrieving revision 1.37
diff -b -u -r1.37 Makefile
--- editors/pico/Makefile	2003/06/02 01:20:07	1.37
+++ editors/pico/Makefile	2003/06/15 00:49:14
@@ -23,6 +23,9 @@
 BUILDNAME= so5
 .elif ${OPSYS} == "Darwin"
 BUILDNAME= osx
+.elif ${OPSYS} == "Linux"
+BUILDNAME= lnx
+.include "../../devel/ncurses/buildlink2.mk"
 .else
 BUILDNAME= neb
 .endif
Index: editors/pico/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/editors/pico/distinfo,v
retrieving revision 1.9
diff -b -u -r1.9 distinfo
--- editors/pico/distinfo	2003/01/23 07:37:12	1.9
+++ editors/pico/distinfo	2003/06/15 00:49:14
@@ -8,3 +8,4 @@
 SHA1 (patch-ad) = 1180abc4909f4120ec91ba14854da9445be3ac6a
 SHA1 (patch-ae) = f228f3c7f61be31a36730b252dfa37d611e8be4b
 SHA1 (patch-af) = ebc41187ea97f57f1553a6919c81c773013a1428
+SHA1 (patch-ag) = 7166128e46a10b879c44caea1207b84d13d1b0f4


This is the patch-ag:

$NetBSD$

--- pico/makefile.lnx.orig	Tue Oct 23 15:19:06 2001
+++ pico/makefile.lnx
@@ -36,18 +36,14 @@
 RM=          rm -f
 LN=          ln -s
 MAKE=        make
-OPTIMIZE=    # -O
+OPTIMIZE=    -O2
 PROFILE=     # -pg
-DEBUG=       -g -DDEBUG
+DEBUG=       -g
 
 STDCFLAGS=	-Dlnx -DJOB_CONTROL -DPOSIX -DMOUSE
 CFLAGS=         $(OPTIMIZE) $(PROFILE) $(DEBUG) $(EXTRACFLAGS) $(STDCFLAGS)
 
 # switches for library building
-LIBCMD=		ar
-LIBARGS=	ru
-RANLIB=		ranlib
-
 LIBS=		$(EXTRALDFLAGS) -lncurses
 
 OFILES=		attach.o basic.o bind.o browse.o buffer.o \
@@ -61,17 +57,17 @@ HFILES=		headers.h estruct.h edef.h efun
 # dependencies for the Unix versions of pico and libpico.a
 #
 all:		pico pilot
-pico pilot:	libpico.a
+pico pilot:	libpico.la
 
 pico:		main.o
-		$(CC) $(CFLAGS) main.o libpico.a $(LIBS) -o pico
+		$(CC) $(CFLAGS) main.o libpico.la $(LIBS) -o pico
 
 pilot:		pilot.o
-		$(CC) $(CFLAGS) pilot.o libpico.a $(LIBS) -o pilot
+		$(CC) $(CFLAGS) pilot.o libpico.la $(LIBS) -o pilot
 
-libpico.a:	$(OFILES)
-		$(LIBCMD) $(LIBARGS) libpico.a $(OFILES)
-		$(RANLIB) libpico.a
+libpico.la:	$(OFILES)
+		$(CC) -o libpico.la $(OFILES:.o=.lo) -rpath $(PREFIX)/lib \
+			-version-info 4:0
 
 clean:
 		rm -f *.a *.o *~ pico_os.c os.h pico pilot
>Release-Note:
>Audit-Trail:
>Unformatted: