Composer is now the recommended way to install / manage Drupal. That's all fine and good. Composer generally works well. But...
Incorporating patches into Drupal projects has become mainstream. So much so that
cweagans/composer-patches is currently included in the standard Drupal composer template. Again, all fine and good.
cweagans/composer-patches generally works well.
Until it doesn't... Like on FreeBSD and other OS's that don't support the
--no-backup-if-mismatch option for the
Until that issue is resolved, FreeBSD users are out in the cold with
composer install fails if there are patches.
Here's what's working for me.
cweagans/composer-patches from the main project, but it may be installed anyway as a dependency of one the project's requirements. In that case,
cweagans/composer-patches will still run and fail.
To keep these failures from aborting the composer operation, make sure that this line isn't in the project's
cweagans/composer-patches in the project with
$ composer remove cweagans/composer-patches; composer require vaimo/composer-patches
In my experience, these changes should fix the installation problems on FreeBSD.