ABCL needs maven for FFI
When trying to load an FFI dependent lisp library, e.g. cl-glfw-opengl-sgix_shadow_ambient, with ABCL, one gets error like this:
; Caught SIMPLE-WARNING:
; Please obtain and install maven-3.0.3 or later locally from <http://maven.apache.org/download.html>, then set ABCL-ASDF:*MVN-LIBS-DIRECTORY* to the directory containing maven-core-3.*.jar et. al.
Unhandled SERIOUS-CONDITION of type COMMON-LISP:ERROR is signaled: Class not found: com.sun.jna.Pointer
This is because ABCL uses maven to download the JNA library it uses for FFI.
My current workaround is to have maven downloaded from the said URL to a directory mounted to the docker image as the cl
user home, and then have M2_HOME and M2 variables exported in my main script (located in the same mounted directory)
THIS_DIR=$(realpath "`dirname $0`")
export M2_HOME=$THIS_DIR/apache-maven-3.8.6
export M2=$M2_HOME/bin
# ... run lisp
(Actually any one of the two variables would be enough I believe, although not tested, because I needed both in my environment for some other reason).
Note, maven by default downloads libraries to ~/.m2/, so having home directory mounted helps here - the download happens only once and then reused by the container on next run.
The ABCL code that looks up for Maven installation is here: https://github.com/armedbear/abcl/blob/master/contrib/abcl-asdf/maven.lisp But I don't know which of these functions are required for most crucial things like FFI, and which are optional or used only in specific situations.
It may be good to have in the Docker image Maven already installed, and maybe JNA already downloaded.