Some D&D ones:
FOR3 Pirates of the Sea of Fallen Stars. Forgotten Realms 2e Sourcebook on fantasy D&D pirates.
Sea of Fallen Stars. 2e FR sourcebook, mostly about the undersea and underwater adventuring and campaigning, but has some bits on the Pirate Isles detailed in FOR3.
Corsairs of the Great Sea. Al-Qadim 2e small boxed set on fantasy Arabian pirates.
Havens of the Great Bay. Birthright 2e setting sourcebook on coastal regions with some pirates.
Rock of Bral. Spelljammer asteroid city founded by fantasy space pirates called the City of Thieves.
SJA2 Skull and Crossbones. 2e Spelljammer anthology of adventures about hunting down pirates.
HR4 A Mighty Fortress is Elizabethan time period if you want to do Sir Francis Drake stuff with extensive period firearms.
LC4 Port of Raven's Bluff. A Forgotten Realms 2e port city with pirates regularly in it.
DMGR9 Of Ships and Seas. 2e rules sourcebook provides rules for nautical adventuring and ship combat.
Stormwrack. The 3e sea themed environment sourcebook with some nautical adventuring rules.
Salt and Sea Dogs: Pirates of Tellene. 3.5 Kalamar sourcebook on nautical adventuring and pirating.
Zoa Citadel of the Bay. 3.5 Kalamar smuggler haven port city sourcebook.
City of Stormreach. 3.5 Eberron smuggler and pirate port city full hardcover sourcebook.
Eberron as a Campaign Setting. 3.5-5e has the Lhazar Provinces of pirate kingdoms but they are not as well fleshed out as other stuff with official adventures and dedicated sourcebooks and such.
Greyhawk has its own pirates areas too such as the isles of the Sea Barons and the Hold of the Sea Princes and the fantasy viking raiders of the Snow, Frost, and Ice barbarians.
Lankhmar had some pirate stuff in the setting, but not much in the D&D adventures or city sourcebooks that I remember.