Make ANSI Common Lisp available on Haiku (again)

This time is was much better and created a package with executable files and not only. Its size however is 7.66 MB, less than yours of 8.24 MB (maybe you have different optimization options).

Now, the sections are:

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libsigsegv$secondaryArchSuffix
	devel:libffcall$secondaryArchSuffix
	devel:libiconv$secondaryArchSuffix
	devel:libunistring$secondaryArchSuffix
	#devel:libgettext_libintl$secondaryArchSuffix
	devel:libreadline$secondaryArchSuffix
	#devel:libncurses6$secondaryArchSuffix
	"

(commented out are not found). These are per unix/INSTALL file. I see you use different libraries. Where they come from?

Next, I did not modify BUILD_PREREQUIRES, which I anyway copied from you except cmd:msgfmt is not found in my case. Again, what is the source of information for all them?

Next:

BUILD()
{
	export FORCE_UNSAFE_CONFIGURE=1 # Haiku user has root privileges
	#cd clisp-clisp-$portVersion
	./configure \
		--with-included-regex \
		--prefix=$prefix
	# TODO To patch src/config.lisp
	make
}

and probably --prefix=$prefix does the trick (it is the only change from previous recipe).

Finally:

TEST()
{
	make check
}

again per unix/INSTALL. What exactly means (and where it comes from):
make bench -Csrc
Is it equivalent of:
cd src && make bench
Again where this bench target is defined?

I am sorry for so many questions. I just want to understand all this stuff :slight_smile:

This is:

devel:libintl$secondaryArchSuffix

Base information on layout is here:

Yes, we sometimes use this for cmake (well mostly) like:

make -Cbuild / make -Cbuild install

This -C switches to the build directory then.

In the generated Makefile you can find these:

# Perform self-tests.
check : check-recompile check-fresh-line check-script check-tests check-sacla-tests bench

Running “make check -Csrc” invokdes them all in one row, but check-tests fails on 3 items (already mentioned at the begining), so it stops after that and doesn’t run the 2 last tests then.

1 Like

Did you see a message near the end when packaging like “POLICY WARNINGS”?

No, it seems. The last part of the log is:

creating package clisp-2.50-1-x86_64.hpkg ...
----- Package Info ----------------
header size:                     80
heap size:                  8034357
TOC size:                      4018
package attributes size:        718
total size:                 8034437
-----------------------------------
waiting for build package clisp-2.50-1 to be deactivated
cleaning chroot folder
grabbing clisp-2.50-1-x86_64.hpkg and moving it to /boot/home/haikuports/packages/clisp-2.50-1-x86_64.hpkg

OK, I now see why your required packages are different from mine: clisp-master lists different packages than clisp-2.50.

Not so much of a difference for the 2.50 package here, that’s also +8MB

I meant a bit before that :slight_smile: At the end of “install” part:

/bin/install -c -m 644 ANNOUNCE COPYRIGHT GNU-GPL SUMMARY NEWS README README.de README.es MAGIC.add /packages/clisp-2.49.93~git-1/.self/documentation/packages/clisp/
mkdir -p /packages/clisp-2.49.93~git-1/.self/documentation/packages/clisp/doc
/bin/install -c -m 644 clisp.1 clisp.html clisp-link.1 clisp-link.html LISP-tutorial.txt CLOS-guide.txt impnotes.html impnotes.css clisp.png  /packages/clisp-2.49.93~git-1/.self/documentation/packages/clisp/doc/
make[1]: Leaving directory '/sources/clisp-c735dd548ba2365804bcee9c2bdd3c291657e8ae/src'
/packages/clisp_debuginfo-2.49.93~git-1/.self
Warning: POLICY WARNING: Invalid top-level package entry "share"
name                    clisp
version                 2.49.93~git-1
architecture            x86_64

PS, up and running on 32bit here also :slight_smile:

1 Like

The only policy warnings are:

Warning: POLICY WARNING: Invalid top-level package entry "share"
Warning: POLICY WARNING: no matching provides "cmd:clisp_link" for "bin/clisp-link"

I tried several more scenaries, all resulting in 7.66 MB package. I believe it is because I really did not clone the haikuports repository and did not use it as described in document about haikuporter, just downloaded master tarball and used it locally.

Anyway, your and my recipes are converging. The only issue is haikuporter did not find libgettext, so I used libunistring instead (maybe this also afects the size). I will upload my latest recipe on google drive, but I will probably not create a merge request for it. I believe you, @Begasus can deal with recipe cleanup and submit much better than me. Of course, when a change will be necessary, I will take a look at it as soon as possible.

Thank you so much.

How should such BUILD_PREREQUIRES look like in this example?
Thank you, maybe someone else could learn from it! :man_teacher:

For this set --datarootdir with configure:

--datarootdir=$dataDir

You don’t have the command listed in PROVIDES

cmd:clisp_link

after cmd:clisp

Again, you need “libintl” not “libgettext” :slight_smile:

That is how it “should” look like :slight_smile:

1 Like

The idea behind all this was to prepare you so you could add this to haikuports :slight_smile:
Starting out is always the hardest part in understanding how it all works, once you get the basics it’s rather simple (even me as a non developer can do it - granted, been busy with these kind of things for years) :rofl:

Understand. Then I will prepare a merge request for the recipe and will maintain it (at least when it will fail to compile). This will take some more time, but as you said, this time is not lost.

Anyway, I will share my latest recipe on google drive and ask you to review it before that.

1 Like

One thing, I still think we should go for master branch, as that is more evolved then the 2.50 branch, even if the name suggest otherwise.
In this case you could use:

srcGitRev="c735dd548ba2365804bcee9c2bdd3c291657e8ae"
SOURCE_URI="https://gitlab.com/gnu-clisp/clisp/-/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="7c29554297e5d27abd7e50fff7691b4dc2ee26bd694369b238fb368b38278bf7"
SOURCE_DIR="clisp-$srcGitRev"

to grab the source for “clisp-2.49.93~git.recipe”

EDIT: before I forget (nah :stuck_out_tongue: ) export -lbsd and -lnetwork for socket/gethostbyname etc … (or patch upstream a check in configure for that) :slight_smile:

2 Likes

Is this a change in recipe or something to communicate to CLISP team?

You can do an “export …” in the recipe (I’ve mentioned this in the beginning somewhere), that’s the easy way.
Or you can check for instance on inet_ntop/socket/gethostbyname checks with configure and see if a Haiku section could be added to check for those functions in libnetwork.

Taken a peek into configure/configure.in in the src/ directory, those checks are in there, but that configure script is kinda … errr, not going to patch anything in there myself. :rofl:

Nothing mentioned as requirement on RUNTIME:

~> readelf -d /system/bin/clisp

Dynamic section at offset 0x1780 contains 17 entries:
  Tag        Type                         Name/Value
 0x0000000000000001 (NEEDED)             Shared library: [libroot.so]
 0x000000000000000c (INIT)               0x890
 0x000000000000000d (FINI)               0x1411
 0x0000000000000004 (HASH)               0x120
 0x0000000000000005 (STRTAB)             0x4f0
 0x0000000000000006 (SYMTAB)             0x1f0
 0x000000000000000a (STRSZ)              346 (bytes)
 0x000000000000000b (SYMENT)             24 (bytes)
 0x0000000000000003 (PLTGOT)             0x2900
 0x0000000000000002 (PLTRELSZ)           408 (bytes)
 0x0000000000000014 (PLTREL)             RELA
 0x0000000000000017 (JMPREL)             0x6f8
 0x0000000000000007 (RELA)               0x650
 0x0000000000000008 (RELASZ)             168 (bytes)
 0x0000000000000009 (RELAENT)            24 (bytes)
 0x000000006ffffff9 (RELACOUNT)          1
 0x0000000000000000 (NULL)               0x0

After that change my package increased to 8.81 MB.

1 Like

You probably got the “locales” added now :slight_smile:

I add the following:

BUILD()
{
	export FORCE_UNSAFE_CONFIGURE=1 # Haiku user has root privileges
	./configure LDFLAGS="-lbsd -lnetwork" \ # new stuff
		--with-included-regex \
		--prefix=$prefix \
		--datarootdir=$dataDir
	# TODO Waiting for Haiku specific src/config.lisp
	make
}

I see the only human readable entry libroot. It is necessary to add some more section?

Nothing needs to be added in REQUIRES, haiku$secondaryArchSuffix (which contains -lroot) is already in there.

1 Like

So, here are latest recipes for review:

Thank you @Begasus for your patience.

2 Likes