pipe.
buy a bit of pipe that will be a loose fit for the bolt (internal diameter) to allow for the door sagging or moving, and drill a hole that is a close sliding fit (external diameter) for the pipe in the doorframe or whatever.
verify that it fits, and after cutting to length, secure the pipe with a little builders adhesive.
Copper pipe is very easy to cut if you have a pipe cutter. On an outside door or gate, you need something that will not rust. Stainless steel is quite hard to cut by hand. Aluminium is very easy. You might find an ebay vendor that will sell you, say, 1-inch lengths neatly cut to size.
If you want a strong fixing, you can get a staple (keep) for a door lock, set in a rectangular strip so it can be fixed with four screws.
I did once manage to get some to take a round bolt, but have never seen them again.