  We provide a constructive, variational proof of Rivin's realization theorem
for ideal hyperbolic polyhedra with prescribed intrinsic metric, which is
equivalent to a discrete uniformization theorem for spheres. The same
variational method is also used to prove a discrete uniformization theorem of
Gu et al. and a corresponding polyhedral realization result of Fillastre. The
variational principles involve twice continuously differentiable functions on
the decorated Teichm\"uller spaces $\widetilde{\mathcal{T}_{g,n}}$ of punctured
surfaces, which are analytic in each Penner cell, convex on each fiber over
$\mathcal{T}_{g,n}$, and invariant under the action of the mapping class group.
