The prebuilt macOS binaries do not work as they rely on openssl being installed in /usr/local/opt/openssl@3/lib/ (brew?).
To have a proper portable binary, you should instead package the openSSL libraries (libcrypt and libssl) in PG lib directory and update the RPATH/link path on all of the binaries/libs to look in the @loader_path/../lib folder
For example the Postgres APP ( https://postgresapp.com/ ) does this correctly and has the ssl/crypto in the lib folder and has their link paths on the main binaries set like this.
otool -L postgres
postgres:
@loader_path/../lib/libzstd.1.dylib (compatibility version 1.0.0, current version 1.5.7)
@loader_path/../lib/liblz4.1.dylib (compatibility version 1.0.0, current version 1.9.4)
@loader_path/../lib/libxml2.2.dylib (compatibility version 13.0.0, current version 13.4.0)
@loader_path/../lib/libssl.3.dylib (compatibility version 3.0.0, current version 3.0.0)
@loader_path/../lib/libcrypto.3.dylib (compatibility version 3.0.0, current version 3.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
@loader_path/../lib/libicui18n.72.dylib (compatibility version 72.0.0, current version 72.1.0)
@loader_path/../lib/libicuuc.72.dylib (compatibility version 72.0.0, current version 72.1.0)
Another option would be to add support for "detecting" the Postgresapp being installed on the user's system and utilizing that on macOS as that will work and includes multiple versions of Postgres. (the latest full version has 14->18)
The prebuilt macOS binaries do not work as they rely on openssl being installed in /usr/local/opt/openssl@3/lib/ (brew?).
To have a proper portable binary, you should instead package the openSSL libraries (libcrypt and libssl) in PG lib directory and update the RPATH/link path on all of the binaries/libs to look in the @loader_path/../lib folder
For example the Postgres APP ( https://postgresapp.com/ ) does this correctly and has the ssl/crypto in the lib folder and has their link paths on the main binaries set like this.
Another option would be to add support for "detecting" the Postgresapp being installed on the user's system and utilizing that on macOS as that will work and includes multiple versions of Postgres. (the latest full version has 14->18)