I recently posted an article on how to download, install, and build a macOS installer pkg for
bash 5. In that first version of this post I ignored patches, minor updates to the bash source code and binary. But as the patches to
bash 5 are accumulating, I cannot ignore them much longer.
This post will extend the instructions in the original post.
After downloading and expanding the
bash-5.0.tar.gz, create a
$ cd path/to/bash-5.0 $ mkdir patches $ cd patches
You can download the patches for
bash-5.0 here. As of this writing, there are seven patches for
bash50-007. You can download all at once with:
$ curl 'https://ftp.gnu.org/gnu/bash/bash-5.0-patches/bash50-[001-007]' -O
(Adapt the numbers when there are more patches in the future.)
Then move up one directory level to the
bash-5.0 root directory and apply the patches using the
$ cd .. $ patch -p0 -i patches/bash50-001 $ patch -p0 -i patches/bash50-002
You can download and patch with a single step. Make sure your working directory is the
bash-5.0 with all the code and run:
$ curl 'https://ftp.gnu.org/gnu/bash/bash-5.0-patches/bash50-[001-007]' | patch -p0
From here, you can continue with the remaining build steps from the original post. The next step will be running
The script to build the pkg installer has also been updated in the repository to download and apply the patches before building.