Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

newlisp: new recipe #6864

Merged
merged 5 commits into from
May 7, 2022
Merged

newlisp: new recipe #6864

merged 5 commits into from
May 7, 2022

Conversation

hoanga
Copy link
Contributor

@hoanga hoanga commented Apr 30, 2022

the following recipe adds newlisp as a package.

sample run posted below:

> newlisp -h

newLISP v.10.7.5 Copyright (c) 2016 Lutz Mueller. All rights reserved.

usage: newlisp [file | url ...] [options ...] [file | url ...]

options:

 -h this help (no init.lsp)
 -n no init.lsp (must be first)
 -x <source> <target> link (no init.lsp)
 -v version
 -s <stacksize>
 -m <max-mem-MB> cell memory
 -e <quoted lisp expression>
 -l <path-file> log connections
 -L <path-file> log all
 -w <working dir>
 -c no prompts, net-eval, HTTP
 -C force prompts
 -t <usec-server-timeout>
 -p <port-no>
 -d <port-no> daemon mode
 -http only mode
 -http-safe safe mode
 -6 IPv6 mode

more info at http://newlisp.org

> newlisp
newLISP v.10.7.5 64-bit on Haiku IPv4/6 UTF-8, options: newlisp -h

> 

@Begasus
Copy link
Contributor

Begasus commented Apr 30, 2022

With a quick look, several empty lines not needed in the recipe, check guidelines: https://github.com/haikuports/haikuports/wiki/HaikuPorter-Guidelines#ordering
In the patchset there are hard coded paths, on 32bit you would have to add /boot/system/lib/x86/* there too (not checked yet)
EDIT saw that you used spaces instead of 1 tab at the indents, please use 1 tab there

@Begasus
Copy link
Contributor

Begasus commented Apr 30, 2022

Some changes are needed as mentioned above, you could also add libffi in REQUIRES and BUILD_REQUIRES, this means also a small patch to detect the header, the following patch takes care of building for 32bit and support for ffi.

patchset From 3092c8dda36727a653eb5feb259863bfb23df973 Mon Sep 17 00:00:00 2001 From: begasus Date: Sat, 30 Apr 2022 10:19:46 +0000 Subject: Fixes for 32bit
modified:   makefile_haiku
modified:   modules/crypto.lsp
modified:   modules/mysql.lsp
modified:   modules/postgres.lsp
modified:   modules/sqlite3.lsp
modified:   modules/unix.lsp
modified:   modules/zlib.lsp
modified:   newlisp.h

diff --git a/makefile_haiku b/makefile_haiku
index 94b631d..bfdbc82 100644
--- a/makefile_haiku
+++ b/makefile_haiku
@@ -5,13 +5,13 @@
OBJS = newlisp.o nl-symbol.o nl-math.o nl-list.o nl-liststr.o nl-string.o nl-filesys.o
nl-sock.o nl-import.o nl-xml-json.o nl-web.o nl-matrix.o nl-debug.o pcre.o

-CFLAGS = -Wall -pedantic -Wno-uninitialized -Wno-strict-aliasing -Wno-long-long -c -O2 -s -DREADLINE -DHAIKU
+CFLAGS = -Wall -pedantic -Wno-uninitialized -Wno-strict-aliasing -Wno-long-long -c -O2 -s -DFFI -DREADLINE -DHAIKU
#CFLAGS = -Wall -pedantic -Wno-uninitialized -Wno-strict-aliasing -Wno-long-long -c -O2 -s -DOS2

CC = gcc

default: $(OBJS)

  • $(CC) $(OBJS) -lm -lreadline -lncurses -lnetwork -lroot -o newlisp
  • $(CC) $(OBJS) -lm -lffi -lreadline -lncurses -lnetwork -lroot -o newlisp
    #$(CC) $(OBJS) -Zomf -Zmt -lm -ldl -o newlisp.exe

.c.o:
diff --git a/modules/crypto.lsp b/modules/crypto.lsp
index 9cc15d0..8f40d58 100644
--- a/modules/crypto.lsp
+++ b/modules/crypto.lsp
@@ -56,6 +56,7 @@
"/usr/lib/libcrypto.so.18.0" ; OpenBSD 4.6
"/usr/lib/libcrypto.so.19.0" ; OpenBSD 5.0
"/usr/lib/libcrypto.dylib"

  •          "/system/develop/lib/x86/libcrypto.so" ; Haiku 32bit
             "/system/develop/lib/libcrypto.so" ; Haiku
             ))
    

diff --git a/modules/mysql.lsp b/modules/mysql.lsp
index 94fbb2a..e8067a2 100644
--- a/modules/mysql.lsp
+++ b/modules/mysql.lsp
@@ -127,6 +127,7 @@
"/usr/local/mysql/lib/libmysqlclient.so" ; Linux, UNIX
"/usr/local/mysql/lib/libmysqlclient.dylib" ; MacOS X
"/usr/lib/libmysqlclient.dylib" ; MacOS X

  • "/system/develop/lib/x86/libmysqlclient.so" ; Haiku 32bit
    "/system/develop/lib/libmysqlclient.so" ; Haiku
    ))

diff --git a/modules/postgres.lsp b/modules/postgres.lsp
index 76783a6..0617f53 100644
--- a/modules/postgres.lsp
+++ b/modules/postgres.lsp
@@ -145,6 +145,7 @@
"/usr/lib/libpq.so.5.1" ; Debian
"/usr/local/pgsql/lib/libpq.dylib" ; Mac OS X
"c:/Program Files/PostgreSQL/8.3/bin/libpq.dll" ; Win32

  • "/system/develop/lib/x86/libpq.so" ; Haiku 32bit
    "/system/develop/lib/libpq.so" ; Haiku
    )))

diff --git a/modules/sqlite3.lsp b/modules/sqlite3.lsp
index 8f07cd6..47fe38b 100644
--- a/modules/sqlite3.lsp
+++ b/modules/sqlite3.lsp
@@ -100,6 +100,7 @@
"/usr/lib/x86_64-linux-gnu/libsqlite3.so.0"
"/usr/lib/i386-linux-gnu/libsqlite3.so" ; for UBUNTU 32-bit
"/usr/lib/i386-linux-gnu/libsqlite3.so.0"

  • "/system/develop/lib/x86/libsqlite3.so" ; Haiku 32bit
    "/system/develop/lib/libsqlite3.so" ; Haiku
    "sqlite3.dll" ; Windows DLL path and current directory
    (string (env "PROGRAMFILES") "/sqlite3/sqlite3.dll") ; Windows SQLite3 std install
    diff --git a/modules/unix.lsp b/modules/unix.lsp
    index e3d159f..dafcdda 100644
    --- a/modules/unix.lsp
    +++ b/modules/unix.lsp
    @@ -48,6 +48,7 @@
    "/lib64/libc.so.6" ; CentOS 6.x
    "/lib/libc.so.6" ; UBUNTU Linux 9.04
    "/usr/lib/libc.so" ; Linux, BSD, Solaris
  • "/system/develop/lib/x86/libroot.so" ; Haiku 32bit
    "/system/develop/lib/libroot.so" ; Haiku
    ))

diff --git a/modules/zlib.lsp b/modules/zlib.lsp
index 283bcdb..5935990 100644
--- a/modules/zlib.lsp
+++ b/modules/zlib.lsp
@@ -40,6 +40,7 @@
"/usr/lib64/libz.so" ; for 64Bit CentOS 6 Linux
"/usr/lib/libz.dylib" ; Mac OSX / Darwin
"libz1.dll" ; MS Windows

  • "/system/develop/lib/x86/libz.so" ; Haiku 32bit
    "/system/develop/lib/libz.so" ; Haiku
    ))

diff --git a/newlisp.h b/newlisp.h
index 342d1e0..47e8bcc 100644
--- a/newlisp.h
+++ b/newlisp.h
@@ -122,7 +122,7 @@
#include "win-ffi.h"
#endif

-#if defined(LINUX) || defined(_BSD) || defined(KFREEBSD) || defined(CYGWIN)
+#if defined(LINUX) || defined(_BSD) || defined(KFREEBSD) || defined(CYGWIN) || defined(HAIKU)
#include <ffi.h>
#endif

--
2.35.1

@hoanga
Copy link
Contributor Author

hoanga commented May 1, 2022

thanks for the feedback! i pushed some changes that should address the recommendations, thanks for catching the spaces instead of tabs. this was brought in from an earlier porting effort so the spaces came along for the ride. i was not able to figure out how to download and apply the patchset provided (thanks btw) so have tried to recreate the patchset manually which i hope works as well as the provided one. if the attribution for the attribution should be updated, can do that as well.

dev-lisp/newlisp/newlisp-10.7.5.recipe Outdated Show resolved Hide resolved
dev-lisp/newlisp/newlisp-10.7.5.recipe Outdated Show resolved Hide resolved
dev-lisp/newlisp/newlisp-10.7.5.recipe Outdated Show resolved Hide resolved
dev-lisp/newlisp/newlisp-10.7.5.recipe Outdated Show resolved Hide resolved
@Begasus
Copy link
Contributor

Begasus commented May 1, 2022

i was not able to figure out how to download and apply the patchset provided (thanks btw)

You could just have cp'd pasted it at the end of the previous patchset, but it's ok by me. :)

@Begasus Begasus merged commit 783ae90 into haikuports:master May 7, 2022
@Begasus
Copy link
Contributor

Begasus commented May 7, 2022

Pushed a last change here, thanks for sticking by! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants