Unified construction of finite element and finite volume discretizations for compressible flows