This is a wrapper script for running bash scripts that were written for Linux on OSX/BSD. This script can be used on either Linux or OSX/BSD. On Linux, it will do nothing and just call the specified program/script. On OSX/BSD it will first define functions to ensure that the GNU versions of commands are used.
Here is an example invocation to run tdrop:
with-gnu-utils tdrop -ma -s dropdown kitty
Install these with brew:
bash
coreutils
gawk
findutils
grep
gnu-sed
gnu-tar
gnu-getopt
Install these:
bash
coreutils
gawk
findutils
gnugrep
gsed
gtar
getopt
Install these:
coreutils
gawk
findutils
ggrep
gsed
gtar
GNU getopt is not installeable on FreeBSD and OpenBSD as far as I can tell. On FreeBSD, there is a version of getopt
that is more compatible with GNU getopt.
procps pgrep is also not available on BSD, so scripts that use flags that are only available in procps pgrep will not work either.
If other unavailable commands used, the script may not work (e.g. this script won’t magically make xdotool
work if you are not running X). This script only handles differences in core utilities.
with-gnu-utils
can be used to run makem.sh on FreeBSD or OSX (but not OpenBSD). Either copy the with-gnu-utils
script into your repository or add this repository as a submodule. Install the necessary dependencies listed above and then run makem.sh
through with-gnu-utils
:
# if copied script into repository
./with-gnu-utils \
./makem.sh -vv -S ./sandbox --install-deps --install-linters
# if using submodules
./with-gnu-utils/with-gnu-utils \
./makem/makem.sh -vv -S ./sandbox --install-deps --install-linters
This allows doing CI testing on an OSX machine, for example. See general.el’s Makefile and test.yml.