vim: Harden build against ex and other tools being missing

Those tools are often used as build-time dependency. Some deficiencies
in the upstream makefiles makes it possible that they will not be
installed, even though the `make install` call was successful.

This *could* make the `vim` build fail where it wouldn't have failed
previously, but it will now fail in a correct manner instead of being
incorrectly successful.

The previous patch (actually using -j1 in install phase) should make
this change redundant, but let's not pretend new bugs are never going to
happen!
This commit is contained in:
Samuel Dionne-Riel 2023-04-22 15:56:31 -04:00
parent cf122f34dd
commit 15ebfa7be7

View File

@ -50,6 +50,15 @@ stdenv.mkDerivation {
ln -s $out/bin/vim $out/bin/vi
mkdir -p $out/share/vim
cp "${vimrc}" $out/share/vim/vimrc
# Prevent bugs in the upstream makefile from silently failing and missing outputs.
# Some of those are build-time requirements for other packages.
for tool in ex xxd vi view vimdiff; do
if [ ! -e "$out/bin/$tool" ]; then
echo "ERROR: install phase did not install '$tool'."
exit 1
fi
done
'';
__impureHostDeps = [ "/dev/ptmx" ];