The underlying problem was fixed as a side-effect of [1], for reasons
unknown to me. In the current state, it's enough to disable a few
breaking dependencies to make the build pass.
Note, that this builds the full package, including backend. However, the
backend is not working, yet: Loading shared modules, which PostgreSQL
heavily depends is still broken. Further, all binaries in the default
output, even client binaries such as psql, are currently dynamically
linked against libpq.so. While the current autoconf based build system
doesn't support changing this, this might be possible in the future with
meson.
However, not all is bad: Fixing the build allows using the static
libpq.a library, which is probably the one thing that most users want
from pkgsStatic.postgresql anyway.
Resolves#191920
[1]: 77977286d8
This replaces `writeShellApplication` with `writeShellScriptBin` that
doesn't perform a shellcheck. This makes it way easier to build
postgresql on staging since GHC is super slow to build, even with pretty
powerful machines.
Also Haskell updates are currently merged straight into master which
means that postgresql and all reverse dependencies require a rebuild on
master then[1].
[1] https://github.com/NixOS/nixpkgs/pull/354270#issuecomment-2463196665
(cherry picked from commit 4cd083a3cd)
(cherry picked from commit a40d887561)
This was added for non-structuredAttrs output checks in #211783. Here we
extend the same concept to structuredAttrs-enabled outputChecks, too.
The postgresql package worked around this with some conditionals. Those
can now be removed - without causing LLVM to be built or substituted.
The darwin specific Makefile contains a reference to the postgres
binary. Some extensions are able to set bindir to their own output
correctly for installation and will then fail to find the postgres
binaryin their own output during linking.
PostGIS worked around this by faking a postgres binary in their own
output, but we can do better by hardcoding the proper path in the
Makefile when PostgreSQL is built.
The tests were disabled in #62752. The problem is System Integrity
Protection on macOS, which resets DYDL_LIBRARY_PATH and thus breaks the
temporary installation of PostgreSQL. By running the checks *after* the
installPhase, the libraries will already be available in the default
locations.