pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/pc-lisp lang/pc-lisp: import pc-lisp-6.0



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7ece7b39e9b8
branches:  trunk
changeset: 375133:7ece7b39e9b8
user:      kamil <kamil%pkgsrc.org@localhost>
date:      Sat Feb 03 20:26:31 2018 +0000

description:
lang/pc-lisp: import pc-lisp-6.0

PC-LISP is a small implementation of LISP for just about any machine with a
good C compiler. This manual is biased towards the UNIX and MS-DOS versions.

While small, it is capable of running a pretty good subset of Franz LISP.
The functions are supposed to perform in the same way as Franz with a few
exceptions made for effeciencies sake.

diffstat:

 lang/pc-lisp/DESCR                        |    6 +
 lang/pc-lisp/Makefile                     |   45 +++++++++
 lang/pc-lisp/PLIST                        |   14 ++
 lang/pc-lisp/distinfo                     |   11 ++
 lang/pc-lisp/patches/patch-src_Makefile   |   21 ++++
 lang/pc-lisp/patches/patch-src_buselect.c |   21 ++++
 lang/pc-lisp/patches/patch-src_busopen.c  |  147 ++++++++++++++++++++++++++++++
 lang/pc-lisp/patches/patch-src_bustrfnd.c |   47 +++++++++
 lang/pc-lisp/patches/patch-src_lisp.h     |   25 +++++
 9 files changed, 337 insertions(+), 0 deletions(-)

diffs (truncated from 373 to 300 lines):

diff -r 6d4a0a48bc42 -r 7ece7b39e9b8 lang/pc-lisp/DESCR
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/pc-lisp/DESCR        Sat Feb 03 20:26:31 2018 +0000
@@ -0,0 +1,6 @@
+PC-LISP is a small implementation of LISP for just about any machine with a
+good C compiler. This manual is biased towards the UNIX and MS-DOS versions.
+
+While small, it is capable of running a pretty good subset of Franz LISP.
+The functions are supposed to perform in the same way as Franz with a few
+exceptions made for effeciencies sake.
diff -r 6d4a0a48bc42 -r 7ece7b39e9b8 lang/pc-lisp/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/pc-lisp/Makefile     Sat Feb 03 20:26:31 2018 +0000
@@ -0,0 +1,45 @@
+# $NetBSD: Makefile,v 1.1 2018/02/03 20:26:31 kamil Exp $
+
+DISTNAME=      master
+# There is no exact version available; use VERSION from lisp.h
+PKGNAME=       pc-lisp-6.0
+CATEGORIES=    lang
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=blakemcbride/}
+DIST_SUBDIR=   ${GITHUB_PROJECT}
+EXTRACT_SUFX=  .zip
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/blakemcbride/PC-LISP/
+COMMENT=       Franz Lisp dialect Lisp system
+LICENSE=       2-clause-bsd
+
+GITHUB_PROJECT=        PC-LISP
+GITHUB_TAG=    2b50414e258a3916bf19d1b354f4c4e647eb7bb8
+
+USE_TOOLS+=    gmake
+
+BUILD_DIRS=    src
+BUILD_TARGET=  pc-lisp
+
+INSTALLATION_DIRS=     bin share/doc/${PKGBASE} share/${PKGBASE}
+
+do-install:
+       ${RUN} ${INSTALL_PROGRAM} \
+               ${WRKSRC}/src/pc-lisp \
+               ${DESTDIR}${PREFIX}/bin
+
+.for f in README.md Franz_Lisp_July_1983.pdf pc-lisp.doc
+       ${RUN} ${INSTALL_DATA} \
+               ${WRKSRC}/${f} \
+               ${DESTDIR}${PREFIX}/share/doc/${PKGBASE}/${f}
+.endfor
+
+.for f in diff.l dragon.l hanoi.l if.l match.l pc-lisp.l qanda.l queens.l \
+          turtle.l
+       ${RUN} ${INSTALL_SCRIPT} \
+               ${WRKSRC}/${f} \
+               ${DESTDIR}${PREFIX}/share/${PKGBASE}/${f}
+       ${RUN} ${CHMOD} -x ${DESTDIR}${PREFIX}/share/${PKGBASE}/${f}
+.endfor
+
+.include "../../mk/bsd.pkg.mk"
diff -r 6d4a0a48bc42 -r 7ece7b39e9b8 lang/pc-lisp/PLIST
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/pc-lisp/PLIST        Sat Feb 03 20:26:31 2018 +0000
@@ -0,0 +1,14 @@
+@comment $NetBSD: PLIST,v 1.1 2018/02/03 20:26:31 kamil Exp $
+bin/pc-lisp
+share/doc/pc-lisp/Franz_Lisp_July_1983.pdf
+share/doc/pc-lisp/README.md
+share/doc/pc-lisp/pc-lisp.doc
+share/pc-lisp/diff.l
+share/pc-lisp/dragon.l
+share/pc-lisp/hanoi.l
+share/pc-lisp/if.l
+share/pc-lisp/match.l
+share/pc-lisp/pc-lisp.l
+share/pc-lisp/qanda.l
+share/pc-lisp/queens.l
+share/pc-lisp/turtle.l
diff -r 6d4a0a48bc42 -r 7ece7b39e9b8 lang/pc-lisp/distinfo
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/pc-lisp/distinfo     Sat Feb 03 20:26:31 2018 +0000
@@ -0,0 +1,11 @@
+$NetBSD: distinfo,v 1.1 2018/02/03 20:26:31 kamil Exp $
+
+SHA1 (PC-LISP/master-2b50414e258a3916bf19d1b354f4c4e647eb7bb8.zip) = b5cda3214fbf41673d26f25defc0db3095d9e538
+RMD160 (PC-LISP/master-2b50414e258a3916bf19d1b354f4c4e647eb7bb8.zip) = 9da45864097aa2d5de2f18630a267584bfba826a
+SHA512 (PC-LISP/master-2b50414e258a3916bf19d1b354f4c4e647eb7bb8.zip) = 4aec599bc6a26311b7d4d509b171919a05714b56ff23949ebfb5a61a986505f45d377ab68ae5a5fae605ec976c695c12d2fc8101a7cc4d5676ceeb73311d2a0f
+Size (PC-LISP/master-2b50414e258a3916bf19d1b354f4c4e647eb7bb8.zip) = 1011041 bytes
+SHA1 (patch-src_Makefile) = 3f388dbff31fad82c9813fb7b3bb5888d118d480
+SHA1 (patch-src_buselect.c) = eeae7661fd5a8d3b4f0a68f38dc50471902ae444
+SHA1 (patch-src_busopen.c) = bf44bf31a9653c86b8616b6d6901dbbbe7c71298
+SHA1 (patch-src_bustrfnd.c) = f2dc238e8d52d9731d685caa88b1218d1ec49706
+SHA1 (patch-src_lisp.h) = 623ab2b3897aaa8f6a99843ff14574a6ede19297
diff -r 6d4a0a48bc42 -r 7ece7b39e9b8 lang/pc-lisp/patches/patch-src_Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/pc-lisp/patches/patch-src_Makefile   Sat Feb 03 20:26:31 2018 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_Makefile,v 1.1 2018/02/03 20:26:31 kamil Exp $
+
+Pass CFLAGS and LDFLAGS.
+
+--- src/Makefile.orig  2015-07-22 00:49:58.000000000 +0000
++++ src/Makefile
+@@ -31,12 +31,12 @@ buuntrac.c buwhile.c buzaplin.c buzerop.
+ lierror.c lieval.c liinst.c limain.c limkstak.c limman.c liscan.c \
+ lithrow.c litrace.c liutils.c
+ 
+-CFLAGS = -Wall -Wno-parentheses -O3
++CFLAGS ?= -Wall -Wno-parentheses -O3
+ 
+ OBJ = $(SRC:.c=.o)
+ 
+ pc-lisp : $(OBJ)
+-      gcc -o $@ $^ -lm
++      gcc $(CFLAGS) $(LDFLAGS) -o $@ $^ -lm
+ 
+ 
+ $(OBJ) : lisp.h
diff -r 6d4a0a48bc42 -r 7ece7b39e9b8 lang/pc-lisp/patches/patch-src_buselect.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/pc-lisp/patches/patch-src_buselect.c Sat Feb 03 20:26:31 2018 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_buselect.c,v 1.1 2018/02/03 20:26:31 kamil Exp $
+
+Port to NetBSD.
+
+--- src/buselect.c.orig        2015-07-22 00:49:58.000000000 +0000
++++ src/buselect.c
+@@ -48,7 +48,7 @@ struct conscell *form;
+            if (port->celltype == FILECELL) {                        /* if argument is a port */
+                fp = port->atom;                                     /* extract FILE * from atom */
+                if (fp == NULL) ioerror(fp);                         /* a null 'atom' indicates file closed */
+-#if defined(__linux__) ||  defined(__APPLE__)  /* _cnt & _flag are no longer available; this code will have to be updated  */
++#if defined(__linux__) ||  defined(__APPLE__) || defined(__NetBSD__)  /* _cnt & _flag are no longer available; this code will have to be updated  */
+              return(LIST(port));
+ #else
+                if ((fp->_cnt > 0) && (fp->_flag & _IOREAD))         /* a read only port with data pending causes an immediate return */
+@@ -117,5 +117,3 @@ struct conscell *form;
+   er:  ierror("*select");  /*  doesn't return  */
+        return NULL;   /*  keep compiler happy  */
+ }
+-
+-
diff -r 6d4a0a48bc42 -r 7ece7b39e9b8 lang/pc-lisp/patches/patch-src_busopen.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/pc-lisp/patches/patch-src_busopen.c  Sat Feb 03 20:26:31 2018 +0000
@@ -0,0 +1,147 @@
+$NetBSD: patch-src_busopen.c,v 1.1 2018/02/03 20:26:31 kamil Exp $
+
+Port to NetBSD.
+
+--- src/busopen.c.orig 2015-07-22 00:49:58.000000000 +0000
++++ src/busopen.c
+@@ -40,6 +40,7 @@
+  *************************************************************************/
+ 
+ #include <stdio.h>
++#include <unistd.h>
+ #include "lisp.h"
+ 
+ #if HASTCP                            /* only compile busopen/busopenP if TCP/IP available */
+@@ -76,7 +77,7 @@ static int fd_port = -1;
+  ** default is 'anybody' i.e. INADDR_ANY.                               **
+  ** implies no port currently in use.                                   **
+  *************************************************************************/
+-static long fd_addr = INADDR_ANY;
++static struct in_addr fd_addr = { INADDR_ANY };
+ 
+ /*************************************************************************
+  ** fdwait(fd, sec, usec) return 1 iff and only if there is activity on **
+@@ -102,7 +103,7 @@ static int fdwait(fd, sec, usec)
+  ** any forked children to inherit this file descriptor because that can**
+  ** stop listens from working so we set the close-on-exec flag on the fd**
+  *************************************************************************/
+-static int fdasync(fd)
++static void fdasync(fd)
+        int fd;
+ {
+        fcntl(fd, F_SETFL, FASYNC);
+@@ -164,7 +165,8 @@ static int addrok(cl_addr, m_addr)
+ static FILE *sopen(addr, port, wait, caddr)
+        long addr, port, wait; char *caddr;
+ {
+-       int len, on = 1, s1, s2 = -1; FILE *fp;
++       int on = 1, s1, s2 = -1; FILE *fp;
++       socklen_t len;
+        struct sockaddr_in server, client;
+        if ((s1 = socket(AF_INET, SOCK_STREAM, 0)) < 0) goto er;                /* allocate a new socket using TCP/IP */
+        bzero(&server, sizeof(server));
+@@ -179,11 +181,11 @@ static FILE *sopen(addr, port, wait, cad
+               for(;;) {                                                        /* repeat while getting EINTR's */
+                   if (!fdwait(s1, wait, 0)) goto er;                           /* wait at most wait seconds for activity on s1 */
+                   len = sizeof(client);
+-                  if ((s2 = accept(s1,&client,&len)) >= 0) break;              /* if activity on s1 and got connection exit loop */
++                  if ((s2 = accept(s1,(struct sockaddr *)&client,&len)) >= 0) break;              /* if activity on s1 and got connection exit loop */
+                   if (len != sizeof(client)) goto er;                          /* did we conenct to AF_INET addressee? */
+                   if (errno != EINTR) goto er;                                 /* error occured, only one we expect is EINTR */
+               }
+-              if (!addrok(client.sin_addr.s_addr, addr)) goto er;
++              if (!addrok(client.sin_addr.s_addr, (struct sockaddr *)addr)) goto er;
+               if (caddr) {strcpy(caddr, inet_ntoa(client.sin_addr));}          /* construct clients address for as a return parameter */
+               close(s1);                                                       /* all ok, have a new fd s2 so can close s1 now */
+           } else {                                                             /* we are not to wait (ie wait = -2), will process on SIGIO */
+@@ -191,7 +193,7 @@ static FILE *sopen(addr, port, wait, cad
+               s2 = s1;
+           }
+        } else {                                                                /* this is the active side of the connection ie wait = 0 */
+-          if (connect(s1, &server, sizeof(server)) < 0) goto er;               /* so try to make an active connect */
++          if (connect(s1, (struct sockaddr *)&server, sizeof(server)) < 0) goto er;               /* so try to make an active connect */
+           s2 = s1;                                                             /* just copy s1 to s2 so that we end in same state as passive */
+        }
+        fp = fdopen(s2, "r+");                                                  /* convert the file descriptor s2 into a FILE * */
+@@ -226,7 +228,7 @@ struct conscell *busopen(form)
+ struct conscell *form;
+ {      char *iaddr; FILE *fd;
+        struct conscell *fcell;
+-       struct hostent *host;
++//       struct hostent *host;
+        char addr[MAXATOMSIZE + 1];
+        long port, wait = 0, haddr;
+        errno = 0;
+@@ -250,6 +252,7 @@ struct conscell *form;
+   er:  ierror("socketopen");
+   er2: ierror("socketopen:bad address");
+   er3: ierror("socketopen:reserved port");
++  return NULL; // XXX
+ }
+ 
+ /***************************************************************************************************
+@@ -264,7 +267,7 @@ struct conscell *form;
+ int    busopenP(op)
+        int op;
+ {
+-       static FILE *fd_listen = NULL, *fd_talk = NULL; static int old_mask;
++       static FILE *fd_listen = NULL, *fd_talk = NULL; // static int old_mask;
+ 
+       /*
+        | Must reset errno to see if I/O routines triggered an error.
+@@ -311,9 +314,9 @@ int    busopenP(op)
+                Dprintf(("\tbusopenP accepting fd_listen & opening fd_talk\n"));
+                if (fdwait(fdl, 0, 10) == 1) {                                 /* if activity on socket try to accept */
+                   struct sockaddr_in client;
+-                  int len = sizeof(client);
++                  socklen_t len = sizeof(client);
+                   Dprintf(("\tbusopenP data available on fd_listen\n"));
+-                  if ((fdt = accept(fdl, &client, &len)) >= 0) {              /* accept the connection, if error drop out */
++                  if ((fdt = accept(fdl, (struct sockaddr *)&client, &len)) >= 0) {              /* accept the connection, if error drop out */
+                       Dprintf(("\tbusopenP connection accepted\n"));
+                       fclose(fd_listen);                                      /* got accept don't need listner socket now so close it down */
+                       fd_listen = NULL;                                       /* and clear FILE * so we do not enter this code on next liio(-1) */
+@@ -446,7 +449,7 @@ struct conscell *buREPsopen(form)
+        struct conscell *form;
+ {
+        int  isdflt, last_fd_port = fd_port;
+-       long addr, last_fd_addr = fd_addr;
++       struct in_addr addr, last_fd_addr = fd_addr;
+        long port; void (*f)();
+ 
+       /*
+@@ -457,7 +460,7 @@ struct conscell *buREPsopen(form)
+        */
+        if (form == NULL) {
+            if (last_fd_port <= IPPORT_RESERVED) return(NULL);
+-           fd_addr = INADDR_ANY;                              /* restore default addr mask to 'anyone' */
++           fd_addr.s_addr = INADDR_ANY;                              /* restore default addr mask to 'anyone' */
+            busopenP(1);
+            goto ret;
+        }
+@@ -485,7 +488,7 @@ struct conscell *buREPsopen(form)
+           if (form->cdrp) goto er;
+           if (!name2addr(addr_s, &addr)) goto er4;
+        } else
+-          addr = INADDR_ANY;
++          addr.s_addr = INADDR_ANY;
+ 
+       /*
+        | Now, try to open the new port/addr as a REP server. If we suceed all is well, just return the previous
+@@ -510,7 +513,7 @@ ret:   form = new(CONSCELL);
+        form->cdrp = new(CONSCELL);
+        if (last_fd_port > IPPORT_RESERVED) {
+            form->carp = newintop((long) last_fd_port);
+-           form->cdrp->carp = LIST(insertstring((last_fd_addr == INADDR_ANY) ? "*" : inet_ntoa(last_fd_addr)));
++           form->cdrp->carp = LIST(insertstring((last_fd_addr.s_addr == INADDR_ANY) ? "*" : inet_ntoa(last_fd_addr)));
+        }
+        xpop(1);
+        return(form);
+@@ -522,6 +525,7 @@ ret:   form = new(CONSCELL);
+  er1:  ierror("REP-socketopen: illegal port");
+  er2:  ierror("REP-socketopen: no SIGIO handler present");
+  er4:  ierror("REP-socketopen: bad address mask");
++ return NULL; // XXX
+ }
+ 
+ #else  /* dummy out these routines on machines that do not support TCP/IP */
diff -r 6d4a0a48bc42 -r 7ece7b39e9b8 lang/pc-lisp/patches/patch-src_bustrfnd.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/pc-lisp/patches/patch-src_bustrfnd.c Sat Feb 03 20:26:31 2018 +0000
@@ -0,0 +1,47 @@
+$NetBSD: patch-src_bustrfnd.c,v 1.1 2018/02/03 20:26:31 kamil Exp $
+
+Port to NetBSD.



Home | Main Index | Thread Index | Old Index