The local village church has a playable, but not especially in-tune, piano. I'm going to be playing guitar alongside this and wondered what the best approach is for my tuning?
When you say 'out of tune' it could mean in with itself, but not at concert pitch, or just not in tune with itself, even.
If it's the former, then it makes sense to tune to the notes sounding on the piano - what else could happen? If it's the latter, then you need to establish if it's just some of the strings on the piano that don't match (pianos have one, two and three strings for each note, depending which notes) then it's going to sound bad by itself, and probably even worse with an 'in tune' guitar.
You're going to have to try it out, but best case scenario, if it sounds as bad as it probably is, is to forego the piano, or even the gig. If it's only a bit out on some notes, maybe the pianist is good enough to avoid those, or change key to use the notes that are in tune.An invidious situation to be in, but as a player (the player) you need to make a judgement call and say that it won't work, if the piano is that much out. Good luck!
Assuming there's no way out of this, by e.g. ditching the piano...
If it's as bad as you say, then there is no 'fix', only approximation.
Get the pianist to play chords - get him to play the hymns you'll be performing. Tune to an approximation of where the 'centre' of each chord appears to be, then to the 'centre' of those approximations.
No note will be right, but maybe less of them will be wrong enough to be painful.
Don't, whatever you do, try to tune one string to one note on the piano - that is going to be a recipe for disaster.
Certainly don't attempt to follow the 'out-of-tuneness' of specific notes. Find the overall average pitch of the piano and tune up or down (probably down) to it. Strum along, make a joyful noise and don't be too critical!