Work on system with deformable boundaries

Background

I am self-studying the book Elements of Gasdynamics by H.W. Liepmann and A. Roshko. In Chapter 1: Concepts from Thermodynamics, the authors discuss the First Law of thermodynamics and a way to describe the work done on a system.

The first law can be written $$\Delta U=Q+W$$

where $$U$$ is the internal energy, $$Q$$ is the heat added to the system, and $$W$$ is the work done on the system. The work done on the system is determined by considering the classic cylinder-piston arrangement:

The work done can be written

$$W=\int \vec{F}\cdot d\vec{r}$$

where $$\vec{F}$$ is the force vector and $$\vec{r}$$ is the displacement vector, i.e. the work done is the force times the distance in the direction of displacement. For an irreversible process, the force is just enough to move the piston slowly, so $$F=pA$$, where $$A$$ is the area of the cylinder. Then

$$W=\int pA dr = -\int pdV$$

where the negative sign has been introduced since a decrease in volume is considered negative.

Question

The authors write

It is not difficult to [derive these equations] even in the case of pressures acting on a deformable enclosure of any shape.

Can anyone present an argument or direct me to an argument showing that the same work equation can be derived for an arbitrary deformable body?

If viscous stresses can be neglected (slow deformation) and S is the external surface of the deformable body, then the local force per unit area exerted by the surroundings on the surface is $$-p\textbf{n}$$, where p is the local pressure at the surface and $$\textbf{n}$$ is a unit outwardly directed local normal to the surface. The rate at which the surroundings are doing work locally on the surface per unit area of surface is then $$d\dot{w}=-p\textbf{n} \centerdot \textbf{v}=-pv_n$$where $$\textbf{v}$$ is the velocity vector at the surface and $$v_n$$ is the normal component of velocity at the surface. If we integrate this over the entire surface of the body, we obtain the rate at which the surroundings are doing work on the body: $$\dot{W}=-\int_S{pv_ndA}$$