Welcome! Please see the About page for a little more info on how this works.

+1 vote
in Clojure CLI by
retagged by

I use Clojure on a variety of platforms, including FreeBSD. Which is fine as a rule, but it can be tricky to install. There is a port/package, but it's often agreeable to get the latest version by installing directly, as clojure.org suggests.

It would be nice to see https://clojure.org/guides/install_clojure mention BSD, but at the very least, the Linux script could be made secretly compatible. It currently relies on GNU's version of /usr/bin/install, but not for any apparent reason. Dropping the -D argument in favor of mkdir -p is all it would take to make it work with BSD's install as well:


Of course, as long as we have the file open, it's worth noting how straightforward it is: it doesn't actually rely on bash or install in any meaningful way. One more pass can dispense with the recreational dependencies and turn it into the pure POSIX shell script that it's clearly yearning to be:


Less is definitely more in this case. The repo I'm linking to also has a Vagrantfile that runs the script against Debian and FreeBSD machines and checks for a working install.


2 Answers

0 votes
selected by
Best answer
+1 vote
edited by

A version of this is now available in prerelease

curl -O https://download.clojure.org/install/posix-install-
chmod +x posix-install-
sudo ./posix-install-