It looks like a few of the shell commands in the setup script won't run correctly on macOS.
I've found that I can solve this by modifying the script slightly:
setup.sh:
sed -i .orig 's/GIT_PACK_FILE_MODE 0444/GIT_PACK_FILE_MODE 0644/g' libgit2/src/libgit2/pack.h
sed -i .orig 's/GIT_OBJECT_FILE_MODE 0444/GIT_OBJECT_FILE_MODE 0644/g' libgit2/src/libgit2/odb.h
Adding the designation .orig after the -i flag seems to do the trick.
It looks like a few of the shell commands in the setup script won't run correctly on macOS.
I've found that I can solve this by modifying the script slightly:
setup.sh:Adding the designation
.origafter the-iflag seems to do the trick.