I think vent stacks are one area where RV manufacturers have traditionally borrowed from residential rather than marine construction. Holding tanks up to around 100 gallons are vented with 5/8" hose and terminated with one of these vent fittings (Seadog p/n 352110, about $10 MSRP).

Using hose will allow it to flex as the top goes up and down, will still vent when the top is down, and will let you keep the fitting on the roof. Sani hose is a heavy, reinforced vinyl hose meant specifically to prevent holding tank odors from passing through it. Because it's so tough, it helps to warm it with a heat gun just before you tighten the hose clamps.
(Sealand p/n 345650, about $3/ft)
