Scheme port, loosely based on FreeBSD port.

Still needs some work (check that shared libraries work, add X11
support...)
This commit is contained in:
espie 2001-01-30 14:59:19 +00:00
parent 769dbb079f
commit baca2d66a2
18 changed files with 516 additions and 0 deletions

65
lang/scm/Makefile Normal file
View File

@ -0,0 +1,65 @@
# $OpenBSD: Makefile,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
# losely based on the FreeBSD port
CATEGORIES= lang
NEED_VERSION= 1.352
DISTNAME= scm5d3
PKGNAME= scm-5d3_2c9
DISTFILES= scm5d3.zip slib2c9.zip
MASTER_SITES= ftp://ftp.swiss.ai.mit.edu/pub/scm/
MAINTAINER= Marc Espie <espie@openbsd.org>
WRKDIST= ${WRKDIR}
WRKSRC= ${WRKDIR}/scm
PERMIT_PACKAGE_CDROM= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_FTP= Yes
SCM_DATA= COPYING Iedline.scm Init5d3.scm Link.scm \
Macexp.scm Macro.scm Transcen.scm Tscript.scm mkimpcat.scm
FEATURES=arrays bignums cautious edit-line curses posix socket unix \
dynamic-linking i/o-extensions inexact
post-build:
cd ${WRKSRC} && PATH=${WRKSRC}:${PORTPATH} /bin/sh ./build \
-F '${FEATURES}' \
-h system \
-o scm \
-s "${PREFIX}/share/scm/"
cd ${WRKSRC} && PATH=${WRKSRC}:${PORTPATH} /bin/sh ./build \
-F '${FEATURES} sicp' \
-h system \
-o scm-sicp \
-s "${PREFIX}/share/scm/"
ALL_TARGET= scmlit
#CFLAGS+= -Dunix
MAKE_FLAGS= CFLAGS='${CFLAGS}' LD='${CC}'
do-install:
${INSTALL_PROGRAM} ${WRKBUILD}/scm ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKBUILD}/scm-sicp ${PREFIX}/bin
${INSTALL_MAN} ${WRKBUILD}/scm.1 ${PREFIX}/man/man1
${INSTALL_DATA_DIR} ${PREFIX}/share/scm
sed -e 's,@PREFIX@,${TRUEPREFIX},' \
<${FILESDIR}/require.scm.in \
>${PREFIX}/share/scm/require.scm
.for file in ${SCM_DATA}
${INSTALL_DATA} ${WRKSRC}/${file} ${PREFIX}/share/scm
.endfor
@touch ${PREFIX}/share/scm/implcat
@touch ${PREFIX}/share/scm/slibcat
@${INSTALL_DATA_DIR} ${PREFIX}/share/scm/slib
${INSTALL_DATA} ${WRKDIR}/slib/*.scm ${PREFIX}/share/scm/slib
${INSTALL_DATA} ${WRKDIR}/scm/scm.info ${PREFIX}/info
${INSTALL_DATA} ${WRKDIR}/slib/slib.info ${PREFIX}/info
.include <bsd.port.mk>

6
lang/scm/files/md5 Normal file
View File

@ -0,0 +1,6 @@
MD5 (scm5d3.zip) = eb39df756b6ea44a1a92e9cc63db54a2
MD5 (slib2c9.zip) = db159efaee38d34e7c0b2395ecc7222c
RMD160 (scm5d3.zip) = c7d8e64dec861ed7c51fb037d5d91336ca07e75a
RMD160 (slib2c9.zip) = 1b32041ee03049f25664ebcf91aa2d7a27f85a11
SHA1 (scm5d3.zip) = 8ba9096e4c18d6c9849b221842939aaeff08b7eb
SHA1 (slib2c9.zip) = 5d221c8651a1c2abbe1098bd05013903934de0e0

View File

@ -0,0 +1,2 @@
(define (library-vicinity) "@PREFIX@/share/scm/slib/")
(load (in-vicinity (library-vicinity) "require"))

View File

@ -0,0 +1,82 @@
$OpenBSD: patch-scm_build_scm,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/build.scm.orig Sat Feb 5 03:37:17 2000
+++ scm/build.scm Tue Jan 30 14:14:59 2001
@@ -451,6 +451,7 @@
(microsoft-c-nt i386 ms-dos cl ) ;link
(microsoft-quick-c 8086 ms-dos qcl ) ;qlink
(ms-dos 8086 ms-dos cc ) ;link
+ (openbsd *unknown* unix gcc ) ;gcc
(os/2-cset i386 os/2 icc ) ;link386
(os/2-emx i386 os/2 gcc ) ;gcc
(svr4-gcc-sun-ld sparc sunos gcc ) ;ld
@@ -582,6 +583,8 @@
(dlll freebsd "-DSUN_DL" "" "" () ())
(nostart freebsd "" "-e start -dc -dp -Bstatic -lgnumalloc" #f ("pre-crt0.c") ())
(dump freebsd "" "/usr/lib/crt0.o" "" ("unexsunos4.c") ())
+ (m openbsd "" "-lm" #f () ())
+ (curses openbsd "" "-lcurses" "/usr/lib/libcurses.a" () ())
))
'(compile-commands
@@ -1389,6 +1392,61 @@
(and (batch:try-command
parms
"ld" "-Bshareable" "-o"
+ (string-append
+ (car (parameter-list-ref parms 'implvic))
+ oname ".so")
+ objects)
+ (batch:rebuild-catalog parms)
+ (string-append
+ (car (parameter-list-ref parms 'implvic))
+ oname ".so"))))
+
+(defcommand compile-c-files openbsd
+ (lambda (files parms)
+ (and (batch:try-chopped-command
+ parms
+ "cc" "-O2" "-Wall" "-c"
+ (c-includes parms)
+ (c-flags parms)
+ files)
+ (map c->o files))))
+(defcommand link-c-program openbsd
+ (lambda (oname objects libs parms)
+ (batch:rename-file parms
+ oname (string-append oname "~"))
+ (and (batch:try-command parms
+ "cc" "-o" oname
+ (must-be-first
+ '("-nostartfiles"
+ "pre-crt0.o" "crt0.o"
+ "/usr/lib/crt0.o")
+ (append libs objects)))
+ oname)))
+(defcommand compile-dll-c-files openbsd
+ (lambda (files parms)
+ (and (batch:try-chopped-command
+ parms
+ "cc" "-O2" "-Wall" "-fPIC" "-c"
+ (string-append
+ "-I" (parameter-list-ref parms 'scm-srcdir))
+ (c-includes parms)
+ (c-flags parms)
+ files)
+ (let ((objs (map c->o files)))
+ (every
+ (lambda (f)
+ (and (batch:try-command
+ parms "gcc" "-shared" "-fPIC" f)
+ (batch:try-command
+ parms "mv" "a.out" f)))
+ objs)
+ objs))))
+
+(defcommand make-dll-archive openbsd
+ (lambda (oname objects libs parms)
+ (and (batch:try-command
+ parms
+ "gcc" "-shared" "-fPIC" "-o"
(string-append
(car (parameter-list-ref parms 'implvic))
oname ".so")

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-scm_findexec_c,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/findexec.c.orig Tue May 2 04:21:39 2000
+++ scm/findexec.c Tue Jan 30 14:39:37 2001
@@ -72,6 +72,13 @@ Wed Feb 21 23:06:35 1996 Aubrey Jaffer
# include <sys/types.h>
# include <sys/stat.h>
#endif
+#ifdef __OpenBSD__
+/* This might be same for 44bsd derived system. */
+# include <stdlib.h>
+# include <unistd.h>
+# include <sys/types.h>
+# include <sys/stat.h>
+#endif
#ifdef __alpha
# include <string.h>
# include <stdlib.h>

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-scm_ioext_c,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/ioext.c.orig Tue Jan 30 12:57:54 2001
+++ scm/ioext.c Tue Jan 30 12:58:30 2001
@@ -70,6 +70,9 @@ SCM stat2scm P((struct stat *stat_temp))
#ifdef __FreeBSD__
# include <unistd.h>
#endif
+#ifdef __OpenBSD__
+# include <unistd.h>
+#endif
/* added by Denys Duchier */
#ifdef __SVR4
# include <sys/types.h>

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-scm_posix_c,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/posix.c.orig Thu Oct 14 05:46:15 1999
+++ scm/posix.c Tue Jan 30 14:14:04 2001
@@ -60,6 +60,10 @@
# else
# ifdef linux
# include <unistd.h>
+# else
+# ifdef __OpenBSD__
+# include <unistd.h>
+# endif
# endif
# endif
#endif

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-scm_repl_c,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/repl.c.orig Thu Mar 30 21:06:07 2000
+++ scm/repl.c Tue Jan 30 14:44:45 2001
@@ -53,6 +53,11 @@ void scm_fill_freelist P((void));
# include <sys/types.h>
#endif
+#ifdef __OpenBSD__
+# include <ctype.h>
+# include <unistd.h>
+#endif
+
#ifdef ARM_ULIB
# include <termio.h>
int set_erase()
@@ -1452,7 +1457,7 @@ void init_sbrk()
}
void scm_brk_report()
{
- unsigned long scm_curbrk = sbrk(0),
+ unsigned long scm_curbrk = (unsigned long)sbrk(0),
dif1 = ((dumped ? scm_dumped_brk : scm_curbrk) - scm_init_brk)/1024,
dif2 = (scm_curbrk - scm_dumped_brk)/1024;

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-scm_scm_c,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/scm.c.orig Tue Sep 21 05:14:03 1999
+++ scm/scm.c Tue Jan 30 14:28:01 2001
@@ -62,6 +62,9 @@
# ifdef SVR4
# include <unistd.h>
# endif
+# ifdef __OpenBSD__
+# include <unistd.h>
+# endif
# ifdef __amigados__
# include <unistd.h>
# endif
@@ -601,6 +604,13 @@ void final_scm(freeall)
# define DIRSEP "/"
# ifndef MSDOS /* DJGPP defines both */
# define SYSTNAME "unix"
+# endif
+#else
+# ifdef __unix__
+# define DIRSEP "/"
+# ifndef MSDOS /* DJGPP defines both */
+# define SYSTNAME "unix"
+# endif
# endif
#endif
#ifdef MWC

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-scm_scm_h,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/scm.h.orig Tue Jan 30 14:46:01 2001
+++ scm/scm.h Tue Jan 30 14:46:52 2001
@@ -649,6 +649,7 @@ SCM my_time P((void));
SCM your_time P((void));
void init_iprocs P((iproc *subra, int type));
+void final_scm P((int));
void init_sbrk P((void));
int init_buf0 P((FILE *inport));
void scm_init_from_argv P((int argc, char **argv, char *script_arg,

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-scm_scmmain_c,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/scmmain.c.orig Tue Jan 30 14:28:32 2001
+++ scm/scmmain.c Tue Jan 30 14:29:35 2001
@@ -45,6 +45,9 @@
#include "scm.h"
#include "patchlvl.h"
+#ifdef __OpenBSD__
+# include <unistd.h>
+#endif
#ifndef GENERIC_NAME
# define GENERIC_NAME "scm"
#endif

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-scm_socket_c,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/socket.c.orig Tue Jan 30 14:16:50 2001
+++ scm/socket.c Tue Jan 30 14:17:26 2001
@@ -69,6 +69,9 @@
# ifdef SVR4
# include <unistd.h>
# endif
+# ifdef __OpenBSD__
+# include <unistd.h>
+# endif
#endif /* STDC_HEADERS */
static char s_inetaddr[] = "inet:string->address";

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-scm_sys_c,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/sys.c.orig Tue Jan 30 10:09:47 2001
+++ scm/sys.c Tue Jan 30 10:10:32 2001
@@ -72,6 +72,9 @@ SCM *loc_open_file; /* for open-file ca
# ifdef linux
# include <unistd.h>
# endif
+# ifdef __OpenBSD__
+# include <unistd.h>
+# endif
#endif
static void gc_sweep P((int contin_bad));

View File

@ -0,0 +1,28 @@
$OpenBSD: patch-scm_time_c,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/time.c.orig Tue May 2 04:21:39 2000
+++ scm/time.c Tue Jan 30 10:00:34 2001
@@ -44,6 +44,11 @@
#include "scm.h"
+#ifdef __unix__
+# ifndef unix
+# define unix 1
+# endif
+#endif
#ifdef STDC_HEADERS
# include <time.h>
# ifdef M_SYSV
@@ -104,6 +109,12 @@
# define USE_GETTIMEOFDAY
#endif
#ifdef __FreeBSD__
+# include <sys/types.h>
+# include <sys/time.h>
+# include <sys/timeb.h>
+# define USE_GETTIMEOFDAY
+#endif
+#ifdef __OpenBSD__
# include <sys/types.h>
# include <sys/time.h>
# include <sys/timeb.h>

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-scm_unix_c,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
--- scm/unix.c.orig Tue Jan 30 14:17:52 2001
+++ scm/unix.c Tue Jan 30 14:18:20 2001
@@ -62,6 +62,9 @@ SCM stat2scm P((struct stat *stat_temp))
# ifdef SVR4
# include <unistd.h>
# endif
+# ifdef __OpenBSD__
+# include <unistd.h>
+# endif
#endif /* STDC_HEADERS */
/* Only the superuser can successfully execute mknod and acct */

1
lang/scm/pkg/COMMENT Normal file
View File

@ -0,0 +1 @@
scheme r5 interpreter

31
lang/scm/pkg/DESCR Normal file
View File

@ -0,0 +1,31 @@
Scm conforms to Revised^5 Report on the Algorithmic Language Scheme
and the IEEE P1178 specification. Scm is written in C and runs under
Amiga, Atari-ST, MacOS, MS-DOS, OS/2, NOS/VE, Unicos, VMS, Unix and
similar systems. ASCII and EBCDIC are supported.
Documentation is included explaining the many Scheme Language
extensions in scm, the internal representation and how to extend or
include scm in other programs.
SLIB is a portable Scheme library which SCM uses.
-- OpenBSD issues
1. Pathname dependencies:
The init file is hardcoded as ${PREFIX}/share/scm/Init.scm.
Alternatively, one can set the environment variable SCM_INIT_PATH to
the pathname of Init.scm.
The library files are in ${PREFIX}/share/scm/slib. Alternatively,
one can set the environment variable SCHEME_LIBRARY_PATH to
the slib directory. Remember to use a trailing / on the
pathname.
2. Documentation:
People not familiar with scheme may wish to install scheme-report
as well.
3. Sicp compliance:
Two interpreters, scm and scm-sicp, are compiled by default.
scm conforms to R^5, scm-sicp to SCIP. If you don't know what I'm
talking about, use scm.

143
lang/scm/pkg/PLIST Normal file
View File

@ -0,0 +1,143 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2001/01/30 14:59:19 espie Exp $
@unexec install-info --delete --info-dir=%D/info %D/info/scm.info
@unexec install-info --delete --info-dir=%D/info %D/info/slib.info
bin/scm
bin/scm-sicp
info/scm.info
info/slib.info
man/man1/scm.1
share/scm/COPYING
share/scm/Iedline.scm
share/scm/Init5d3.scm
share/scm/Link.scm
share/scm/Macexp.scm
share/scm/Macro.scm
share/scm/Transcen.scm
share/scm/Tscript.scm
share/scm/implcat
share/scm/mkimpcat.scm
share/scm/require.scm
share/scm/slib/Bev2slib.scm
share/scm/slib/Template.scm
share/scm/slib/alist.scm
share/scm/slib/alistab.scm
share/scm/slib/array.scm
share/scm/slib/arraymap.scm
share/scm/slib/batch.scm
share/scm/slib/break.scm
share/scm/slib/byte.scm
share/scm/slib/chap.scm
share/scm/slib/charplot.scm
share/scm/slib/cltime.scm
share/scm/slib/collect.scm
share/scm/slib/comlist.scm
share/scm/slib/comparse.scm
share/scm/slib/cring.scm
share/scm/slib/db2html.scm
share/scm/slib/dbrowse.scm
share/scm/slib/dbutil.scm
share/scm/slib/debug.scm
share/scm/slib/defmacex.scm
share/scm/slib/determ.scm
share/scm/slib/dwindtst.scm
share/scm/slib/dynamic.scm
share/scm/slib/dynwind.scm
share/scm/slib/eval.scm
share/scm/slib/factor.scm
share/scm/slib/fft.scm
share/scm/slib/fluidlet.scm
share/scm/slib/format.scm
share/scm/slib/formatst.scm
share/scm/slib/genwrite.scm
share/scm/slib/getopt.scm
share/scm/slib/getparam.scm
share/scm/slib/glob.scm
share/scm/slib/hash.scm
share/scm/slib/hashtab.scm
share/scm/slib/htmlform.scm
share/scm/slib/http-cgi.scm
share/scm/slib/lineio.scm
share/scm/slib/logical.scm
share/scm/slib/macrotst.scm
share/scm/slib/macwork.scm
share/scm/slib/makcrc.scm
share/scm/slib/mbe.scm
share/scm/slib/minimize.scm
share/scm/slib/mklibcat.scm
share/scm/slib/modular.scm
share/scm/slib/mulapply.scm
share/scm/slib/mularg.scm
share/scm/slib/mwdenote.scm
share/scm/slib/mwexpand.scm
share/scm/slib/mwsynrul.scm
share/scm/slib/nclients.scm
share/scm/slib/obj2str.scm
share/scm/slib/object.scm
share/scm/slib/paramlst.scm
share/scm/slib/plottest.scm
share/scm/slib/pnm.scm
share/scm/slib/pp.scm
share/scm/slib/ppfile.scm
share/scm/slib/prec.scm
share/scm/slib/printf.scm
share/scm/slib/priorque.scm
share/scm/slib/process.scm
share/scm/slib/promise.scm
share/scm/slib/psxtime.scm
share/scm/slib/qp.scm
share/scm/slib/queue.scm
share/scm/slib/r4rsyn.scm
share/scm/slib/randinex.scm
share/scm/slib/random.scm
share/scm/slib/ratize.scm
share/scm/slib/rdms.scm
share/scm/slib/recobj.scm
share/scm/slib/record.scm
share/scm/slib/repl.scm
share/scm/slib/report.scm
share/scm/slib/require.scm
share/scm/slib/root.scm
share/scm/slib/sc2.scm
share/scm/slib/sc4opt.scm
share/scm/slib/sc4sc3.scm
share/scm/slib/scaexpp.scm
share/scm/slib/scaglob.scm
share/scm/slib/scainit.scm
share/scm/slib/scamacr.scm
share/scm/slib/scanf.scm
share/scm/slib/scaoutp.scm
share/scm/slib/schmooz.scm
share/scm/slib/scmacro.scm
share/scm/slib/scmactst.scm
share/scm/slib/selfset.scm
share/scm/slib/sierpinski.scm
share/scm/slib/sort.scm
share/scm/slib/soundex.scm
share/scm/slib/stdio.scm
share/scm/slib/strcase.scm
share/scm/slib/strport.scm
share/scm/slib/strsrch.scm
share/scm/slib/struct.scm
share/scm/slib/structst.scm
share/scm/slib/structure.scm
share/scm/slib/synchk.scm
share/scm/slib/synclo.scm
share/scm/slib/synrul.scm
share/scm/slib/tek40.scm
share/scm/slib/tek41.scm
share/scm/slib/timezone.scm
share/scm/slib/trace.scm
share/scm/slib/tree.scm
share/scm/slib/trnscrpt.scm
share/scm/slib/tsort.scm
share/scm/slib/tzfile.scm
share/scm/slib/values.scm
share/scm/slib/withfile.scm
share/scm/slib/wttest.scm
share/scm/slib/wttree.scm
share/scm/slib/yasyn.scm
share/scm/slibcat
@dirrm share/scm/slib
@dirrm share/scm
@exec install-info --info-dir=%D/info %D/info/scm.info
@exec install-info --info-dir=%D/info %D/info/slib.info