Thank you for your patience, I can get pretty much carried away when it comes to creating recipes, learned from the best back then. ![]()
I’ve made some changes to reflect the one I have here (2.49.93) (also crossed some of your changes to the one here).
Link stays up for a week: View paste ETJ74
EDIT: missing in BUILD: “–bindir, --docdir, --libdir and --mandir”
--bindir: for 32bit this should end up in $prefix/bin (we don't build it for gcc2 but do for gcc13)
--docdir: documentation now ends up in $dataDir, this should go to $docDir
--libdir: on 32bit we want those in $prefix/lib/x86 (gcc13) and not in $prefix/lib (gcc2)
--mandir: this should end up in $prefix/documentation/man ($manDir) and not in $dataDir/man
It was too intense for me, I need a pause ![]()
Here are some more information from CLISP team:
The clisp-2.50 branch was meant to give rise to a 2.50 release, but is obsolete by now. The next release will be cut from the master branch, and will be called 2.51.
So, stay with 2.49.93 recipe.
The next step would be building CLISP modules. The file unix/INSTALL file has a suggestion:
Binary package creation: we recommend distributing module “clisp” containing just the base linking set and individual modules packaged separately. We recommend keeping the base linking set (i18n, regexp, syscalls, readline) intact in order to ensure a uniform experience to all CLISP users regardless of platform or distribution.
So, I will try to include these 4 modules (i18n, regexp, syscalls, readline) in recipe (I see @Begasus’s recipe already includes regexp?). All the rest modules will go probably in separate package, something like clisp-packages. Currently, except the former 4, it will contain 20 more packages, depending on their portability to Haiku. This would divide the effort of porting and maintaining, because each package may have different dependencies. What do HaikuPorts developers think?
Haven’t really looked at the extra modules so far, I guess it’s best for now to finish up on the basic recipe and then start tackling the modules? (PS doing some other port checks atm) ![]()
OK, looked a bit into a few modules already, I see these are installed in $libDir, maybe $dataDir would be a better place?
These are basically already added in the build by default if you look at the generated src/Makefile.
I tried to do the following in BUILD(), which continue failing. Probably, I do something fundamentally wrong:
./configure \
FORCE_UNSAFE_CONFIGURE=1 \
LDFLAGS="-lbsd -lnetwork" \
--with-included-regex \
--prefix=$prefix \
--datarootdir=$dataDir \
--bindir=$folderForBinary
--docdir=$docDir
--libdir=$folderForLibrary
--mandir=$manDir
EDIT: Forgot to put '\' at the end of lines that continue on the next line.
where local variables are defined also in BUILD() as:
local folderForBinary
local folderForLibrary
if [$targetArchitecture = x86]; then
folderForBinary=bin
folderForLibrary=lib/x86
else
folderForBinary=bin
folderForLibrary=lib
fi
(I know, there is some redundancy here, but still). And this fails with:
EDIT: Of course:
local folderForBinary
local folderForLibrary
if [$targetArchitecture = x86]; then
folderForBinary=$prefix/bin
folderForLibrary=$prefix/lib/x86
else
folderForBinary=$prefix/bin
folderForLibrary=$prefix/lib
fi
Building ...
/port.recipe: line 54: [x86_64: command not found
executing ../src/configure FORCE_UNSAFE_CONFIGURE=1 LDFLAGS=-lbsd -lnetwork --with-included-regex --prefix=/packages/clisp-2.49.93~git-1/.self --datarootdir=/packages/clisp-2.49.93~git-1/.self/data --bindir=bin
configure: error: expected an absolute directory name for --bindir: bin
Warning: Command '['bash', '-c', '. /wrapper-script']' returned non-zero exit status 1.
cleaning 'chroot/boot' folder
keeping chroot folder /boot/home/haikuports/dev-lisp/clisp/work-2.49.93~git intact for inspection
Error: Build has failed - stopping.
EDIT: No more crashing.
Perhaps I understand something wrong, or did not understand at all with aforementioned folders. But as soon as I can see the recipe with all the paths building (and get some spare time), I will prepare a merge request for the recipe.
One issue with JIT compiled languages is they generate intermediary code (such as .class in Java), and Lisp, being a very dynamic language, does it quite often. Technically speaking .fas files are libraries (so $libDir is the right place), but they probably need to be placed in a writable folder. Or if they are not changed, and their .fas as well, they could be in read-only folder.
In package content I see .fas files are placed next to their .lisp sources, which is fine. This means, CLISP developers do not expect them to be changed during usage (or there is some other mechanism to overwrite them if necessary), so they are good in read-only folder. However, I see no reasons to have Makefile and .o files there. I do make distclean after make install. But if they are still there, CLISP knows why…
However, users of Lisp compilers will certainly need a write-able folder where .lisp files are translated into .fas ones. Until now, I did not see problems with it in CLISP, given I did not test it extensively. Lisp implementations usually create in user home folder some subfolder where the cache of .fas files is created in a reusable way.
Strange, I do not see the modules as in @Begasus screenshot:
--bindir=$prefix/bin (or you could use $commandBinDir if you added it to the recipe (some examples are in the repo
--libdir=$libDir
No need to create different variables for these ![]()
binDir = $prefix/bin/x86 on 32bit, $prefix/bin on 64bit
libDir = $prefix/lib/x86 on 32bit, $prefix/lib on 64bit
OK, let’s keep them there for now, we’ll see where we end up. ![]()
That’s because I already started adding modules in configure with --with-module=*
There are 2 more modules to add: asdf (Lisp package manager) and rawsock (CLISP all-in-one building of itself, EDIT: rawsock = Row Socket, a communication with socket library). They have 0 external dependencies. So my total number of modules is 6:
i18n,regexp,syscalls,readline(should have meet required packages already),asdf,rawsock(no external dependence).
Add pcre there too, for berkerly-db extra dep libdb is needed.
My .phkg does not contain berkeley-db module, and CLISP does not consider it as mandatory. So, I live it out for clisp-modules recipe along with other dozens of modules.
Yeah, I’m only checking which ones can/could be build/added, nothing adding for the base one so far.
EDIT
libsvm updated and checked
Saw that, yanked it out and added: rm src/config.cache (before running configure in build, just don’t enable it on a first build, it’s mentioned somewhere in the readme’s iirc). ![]()
I see asdf and rawsock are added effortlessly with only configure options --with-module=.... However, other modules need to be explicitly installed as:
cd src
make install-modules MODULE="XYZ" DESTDIR=$prefix
However, for all 4 mandatory modules i18n, regexp, syscalls, readline this fails to install them. I can see Lisp code compiled to .fas and native code compiled to .so in src/dynmod, however they fail to be installed. My error is something like:
In file included from modules.c:37
modules.h: At top level:
modules.h:5:15: error redefinition of 'struct module__i18n__subr_tab_t'
5 | MODULE(i18n)
The build log seems to be sensible to presence of src/config.cache file, so tried to remove it before installing modules. So far, without success.
@Begasus, did you have any success for these 4 modules?
Not finished yet checking them all, but so far (without doing some manual “make install foo”:
# good
# --with-module="asdf" \
# --with-module="berkeley-db" \
# --with-module="libsvm" \
# --with-module="pcre" \
# --with-module="queens" \
# --with-module="rawsock" \
# --with-module="zlib" \
# bad
# --with-module="clx/mit-clx" \ fails with "cp: cannot stat 'README.CLISP': No such file or directory"
# --with-module="fastcgi" \ no fastcgi available
# --with-module="oracle" \ error: #error "Please include config.h first."
# --with-module="postgresql" \ needs a fix? runtime_loader: /boot/system/lib/libpq.so: Troubles relocating: Symbol not found
# --with-module="netica" \
--with-module="clx/mit-clx" - Call Xlib functions from CLISP in old MIT implementation. This is probably not intended to be run on Haiku. There is a newer implementation in “clx/new-clx”, which maybe can communicate with Xlib of Haiku some day.
--with-module="oracle" - may depend on Oracle vendor specific libraries.
Yeah, on some I expect failures, but going through the list nevertheless ![]()
Looking into pari atm, bumping our current version in the process. (seems to have problems finding pari_data).
The meaning / purpose of modules is described here. It may help understanding what to try to debug and what to leave out.
OK, enough playing around for today, these build install without much hustle ![]()
I’ll leave it up to you which ones could be useful, looking at the additional files I guess these could go in one package, eg no need for sub-packages for the modules.
My BUILD() section:
BUILD()
{
rm src/config.cache
export FORCE_UNSAFE_CONFIGURE=1
./configure LDFLAGS="-lbsd -lnetwork" CXXFLAGS="_D_BSD_SOURCE" \
--prefix=$prefix \
--bindir=$commandBinDir \
--datarootdir=$dataDir \
--docdir=$docDir \
--libdir=$libDir \
--mandir=$manDir \
--with-included-regex \
--with-module="asdf" \
--with-module="berkeley-db" \
--with-module="libsvm" \
--with-module="pcre" \
--with-module="rawsock" \
--with-module="zlib" \
src
make $jobArgs
}


