sagemath/sage

Add documentation for implementing spkg-configure.m4 and distros/ for SPKGs

Opened this issue · 4 comments

#24919 added support for placing an M4 macro in the file build/pkg/<pkgname>/spkg-configure.m4 which allows any sage-dist SPKG to provide configure-time logic for detecting a usable system version of a dependency.

For new SPKGs in particular, as well as existing SPKGs (see #26286 for a few) we want to encourage implementing these macros. I would especially encourage it for common system-level packages that are not mathematical packages used directly by Sage (as those are simply less likely to be already provided by most systems). Examples include compression libraries like zlib and bzip2, low-level UI-related libraries like ncurses and libfreetype, and possibly some low-level math libraries such as BLAS. There is also discussion of adding an OpenSSL SPKG for convenience of building on macOS, and this is a case that really ought to prefer the system package where possible.

To better enable this, the SPKG development docs need to be updated to mention and encourage use of spkg-configure.m4. I will also provide some basic documentation (with links to resources) on writing M4 macros for autoconf, as not many people have experience with this and it has a non-trivial learning curve. In #24919 I tried to minimize the amount of M4 that actually has to be written though--the challenge is mainly in deciding the most effective way to detect usability of a given package.

CC: @dimpase @videlec @jhpalmieri @orlitzky

Component: documentation

Issue created by migration from https://trac.sagemath.org/ticket/26668

comment:2

Retargeting some of my tickets.

comment:4

Removing most of the rest of my open tickets out of the 8.7 milestone, which should be closed.

comment:5

See also: #29018 - Improve documentation of m4/sage_spkg_configure.m4

comment:7

#30543 adds basic documentation and a recommendation to create these files, but details on how to write m4 scripts would still be welcome.