Tim Powers' pirate fantasy book On Stranger Tides is a very important link in this chain. Gilbert's said it was a major influence, and the first Pirates movie had a lot of Tides' vibes. Pirates 4 was a straight-up adaptation of the book.
...An adaptation which kept nearly nothing about the book, sadly.
It's a great novel (if you excuse some minor flaws, like the protagonist's lightning-fast mastering of sailing after he becomes a pirate) which deserves a proper adaptation, but now that Disney owns the rights, that will likely never happen.
https://en.wikipedia.org/wiki/On_Stranger_Tides#Influence_on...