I’m currently rewriting much of the nixpkgs packaging for SWI-Prolog. Nix lets you specify all kinds of options, such as withGui
, or withPython
, to conditionally build a package with more features. To get the most out of this I’ve been studying the build to see what options exist.
For the most part it is straightforward, as a lot of features are auto included when a library is available at build time (and most such features can additionally be turned off explicitly). However, there are some options here that are a bit unclear to me. Hopefully someone can explain them.
gmp or libBF
If I understand correctly, swi-prolog will include gmp if
- gmp is available in the build environment
USE_GMP=ON
(which is the default)
Otherwise, swi-prolog will build with libBF.
Is this understanding correct? And how stable is this assumption going forward?
readline or libedit
Both readline and libedit have their own included prolog libraries. It follows that for a full library set, we have to depend on both. Interestingly, unlike many other libraries, these two don’t seem to have an option to turn off their package.
Separate from those libraries though, swi-prolog itself also uses either readline or libedit for its top-level.
I assume that by default readline will be used by swi-prolog for its top-level, and if it is unavailable but libedit is there, libedit will be used instead. Is that true?
qt
There’s a lot of qt stuff in swi-prolog. I was personally unaware that there was any qt support. Is this there for the XPCE implementation on non-X? Is it possible to use qt to build the graphical parts of swi-prolog instead of the ‘normal’ X way on linux?
engines
There’s an ENGINES
build flag, but it is very unclear to me what it does. By default it is off, but nevertheless, swipl still builds with all the usual engine predicates.
What does this flag actually do?
protobufs
It looks like the protobufs library requires some things to be available at build time, but the build does not fail when these are missing, and I still seem to be getting a protobufs library. @peter.ludemann maybe you can tell me more about how this hooks into the build? I’m not sure how the protobufs library is supposed to work and how to test if it does what it should.
That’s it, for now
[edit] just one more…
xpce dependencies, xinerama?
It is a bit unclear what you really need to build xpce. There’s some common sets of dependencies floating around online, but I find some of them dubious.
A lot recommend including libxinerama
. This is a library to support multi-display output on X. Is SWI-Prolog actually directly using this in any way? I seem to be able to compile without just fine, but I don’t know if there’s runtime consequences.
For what it’s worth, the minimum set of extra packages I need to get xpce to build using nixpkgs is:
- libXt - X toolkit
- libXext - common X extensions
- libXpm - X pixmap format
- libXft - X freetype fonts
- libjpeg - jpeg format support
This pulls in other dependencies of course, notably libX11.
[more edit]
It turns out that libxinerama is an optional dependency of xpce. So it builds without, but it still does something (what?) when present.