Run linux fdisk and sfdisk from darwin

On darwin, fdisk is a different command (supposedly Apple’s) than fdisk from linux. I’m working on Linux disk images and would like the same features and command line interface wherever I build my packages. How can I run the linux fdisk on darwin? I’d also like to run sfdisk which is not available at all from darwin.

I can successfully build both fdisk and sfdisk from source, but I’d rather not maintain the derivation in my projects.

Thanks,
Elias