Postgres: how to add pg_trgm support? (how to install postgres-contrib)

I have installed Postgres as an App from the App Directory but can’t seem to find a way to install postgres-contrib or use any image that would include support for the module pg_trgm.

I’d be grateful for anyone pointing me in the right direction.