This feature is now natively implemented since patch 9.1.1485: missing Wayland clipboard support
The solutions here are obsolete since then. Wayland clipboard support will continue to mature, there have been quite a few bugfixes since then.
patch 9.1.1543: Wayland: clipboard appears to not be working
patch 9.1.1565: configure: does not consider tiny version for wayland
patch 9.1.1587: Wayland: timeout not updated before select()
patch 9.1.1585: Wayland: gvim still needs GVIM_ENABLE_WAYLAND
Regarding last commit - I recommend you remove GVIM_ENABLE_WAYLAND=1
if you have previously enabled that as it is auto-detecting Wayland now.
Also see