Good luck finding an e34 sump for reasonable money. Wreckers on here will want your first born as a deposit... however, if you can find an old e34 with a m50b20 motor, that sump will fit as the 2.0/2.5 blocks are the same basic casting. Likely to be able to buy a 520 for peanuts as nobody wants them (but they are also not very plentiful like the 525's, so happy hunting..)
You can use an e38 m52b28 motor, has the correct sump on but you will need e36 engine mounting arms, the e38 arms will not work. This is the route I would take as there are plenty of m52b28 e38's to be had for cheap. When I did my first m52b28 conversion back at least 10 yrs ago now, I used an e36 coupe as a donor, and e34 sumps were plentiful as the old e34's were dying and getting wrecked aplenty. However, most have now gone to china to make toasters so slim pickings to be had..
Using the m54 motor will involve major work to get the integrated electronics working, not worth the effort. If you want to speak to someone who went down this path, get hold of Westy. Easier/better to find a 3L crank and make a stroker m52 if c.c. floats your boat.
Best... M60/M62->e30 is for real men..