What is the equation for the energy balance between turbine, compressor and propeller?
Since the compressor loses a fraction of the turbine's work through the shaft, but is unaffected by the gearbox, but the prop experiences losses from the shaft and the gearbox, this equation should be what you need:

$$\dot{W_t}=\frac{-\dot{W_c}}{\eta_{shaft}}+\frac{-\dot{W_p}}{\eta_{shaft}*\eta_{gearbox}}$$

Which is the same as your attempt two (with some algebra).

As you add more efficiencies to a component, you would just continue to multiple the all $\eta$'s together to get the total efficiency of that component, since efficiencies are multiplicative and the associative property of multiplication.