  Mergers of gas-rich galaxies are key events in the hierarchical built-up of
cosmic structures, and can lead to the formation of massive black hole
binaries. By means of high-resolution hydrodynamical simulations we consider
the late stages of a gas-rich major merger, detailing the dynamics of two
circumnuclear discs, and of the hosted massive black holes during their pairing
phase. During the merger gas clumps with masses of a fraction of the black hole
mass form because of fragmentation. Such high-density gas is very effective in
forming stars, and the most massive clumps can substantially perturb the black
hole orbits. After $\sim 10$ Myr from the start of the merger a gravitationally
bound black hole binary forms at a separation of a few parsecs, and soon after,
the separation falls below our resolution limit of $0.39$ pc. At the time of
binary formation the original discs are almost completely disrupted because of
SNa feedback, while on pc scales the residual gas settles in a circumbinary
disc with mass $\sim 10^5 M_\odot$. We also test that binary dynamics is robust
against the details of the SNa feedback employed in the simulations, while gas
dynamics is not. We finally highlight the importance of the SNa time-scale on
our results.
