KadathThorn build script contains GNUisms

Issue #2712 resolved
Roland Haas created an issue

KadathThorn’s build script contains (at least):

BASEDIR_ABS=`realpath ..`

and expects to find out the absolute path of the parent directory that way. However this is not POSIX conforming. realpath is not available on a POSIX system (see https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html). The “correct” way in POSIX to get the absolute path is:

BASEDIR_ABS=`cd .. ; pwd -P`

Assuming that the thorn name is given by the name of the checked out repository is not correct. People may have a checkout “KadathThorn-devel” which still is the the KadathThorn thorn. If you like to avoid hard-coding KadathThorn (so that people can rename the thorn eg KadathThorn-rhaas) then you can use the THORN variable that make sets by adding an export THORN to make.config.deps.

Note that you are hard-coding THORN as KadathThorn in detect.sh already so you may just as well do it in build.sh as well (or change both to use THORN as provided by make).

build.sh uses cp -r ${SRCDIR}/${NAME}/ ./ to try and copy the fuka directory to the current directory. However BSD cp (on macOS) will copy the contents of fuka when it is given a trailing / in its argument. The simplest fix is, likely to remove the trailing / in the source path. Note that -r is not available in POSIX cp. Instead the option to use is -R (capital “R”). See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/cp.html#tag_20_24_02

Comments (4)

  1. tootle

    @Roland Haas It took me a bit, but I think I have all of these issues resolved. The GNUisms was trivial, but updating to allow for different folder names was less so with the main issue being that `detect.sh` does not have knowledge of THORN even aftering adding it to make.config.deps. To alleviate this issues, I have resorted to using a static thorn name KadathThorn within the *.sh files and make.config.deps since i don’t see any reason for conflicts to be of issues unless one tries to build using two different versions of the same thorn (e.g. KadathThorn and KadathThorn-rhaas).

  2. Roland Haas reporter

    I did not explicitly check, but Samuel claims to have removed the GNUisms, which is good enough for me.

    We can open a new ticket if more or the same issues are found again.

  3. Log in to comment