Commit Graph

168 Commits

Author SHA1 Message Date
Wolfgang Walther
527713c1db postgresql: provide pltcl extension as package
This allows us to always build the extension, but still have the user
explicitly enable it without causing rebuilds.
2025-03-21 18:19:42 +01:00
Wolfgang Walther
310ec25e98 postgresql: provide plperl extension as package
This allows us to always build the extension, but still have the user
explicitly enable it without causing rebuilds.
2025-03-21 18:19:41 +01:00
Wolfgang Walther
fbdb09b2cc postgresql: provide plpython3 extension as package
This allows us to always build the extension, but still have the user
explicitly enable it without causing rebuilds.
2025-03-21 18:15:28 +01:00
Wolfgang Walther
2888972b4f postgresql: fix tclSupport with strictDeps
Can't find tcl anymore ever since we enabled strictDeps. Need to do the
same as for perl and python.
2025-03-21 18:09:36 +01:00
Wolfgang Walther
0ccd469787 postgresql: fix cross-compilation with perlSupport
Perl is available in nativeBuildInputs, but the perl used at runtime,
must be a different one. Thus, we need to explicitly tell configure
about it, similar to how we did with python.
2025-03-21 18:09:35 +01:00
Wolfgang Walther
33782bdff6 postgresql: remove left-over buildInput python
We don't need to pass it as build input anymore, because we pass it via
PYTHON environment variable already.
2025-03-21 18:09:35 +01:00
Wolfgang Walther
82e2064212 postgresql: switch to makeBinaryWrapper
This could be slightly faster and since "postgres" is called for every
connection, it could theoretically make a difference with high
throughput.
2025-03-21 18:09:34 +01:00
Wolfgang Walther
1173e312e3 postgresql: disable unconditional plperl in versions before 17
We accidentally enabled building plperl in versions before 17
unconditionally, which was not intended.

Happened in be8612e15a.
2025-03-21 18:09:33 +01:00
Wolfgang Walther
5dff1a074f postgresql: use lib.getExe 2025-03-21 18:09:28 +01:00
Wolfgang Walther
39337618bb postgresql: use meta.availableOn for linux-pam 2025-03-21 18:09:23 +01:00
Wolfgang Walther
f9765933f4 postgresql: move CFLAGS comment
This only applies to CFLAGS, not all of env.
2025-03-21 18:09:21 +01:00
nixpkgs-ci[bot]
e8240407b0 Merge staging-next into staging 2025-03-18 18:05:35 +00:00
Wolfgang Walther
259b4ff913 postgresql: split postgresqlTestExtension into separate file 2025-03-18 18:17:25 +01:00
Wolfgang Walther
72b8186ff7 postgresqlPackages: rename buildPostgresqlExtension to postgresqlBuildExtension
This is for consistency with postgresqlTestExtension and
postgresqlTestHook. Everything that is passed via postgresql's
generic.nix "packages scope" now is prefixed with "postgresql".
2025-03-18 18:17:24 +01:00
Wolfgang Walther
6e0738b8c2 postgresqlPackages: load automatically from ext/ folder
No need to manually put them in the default.nix file anymore.
2025-03-18 18:17:24 +01:00
Wolfgang Walther
dfb0d4fd7c postgresql: remove unused argument
Accidentally introduced in 247053e.
2025-03-16 14:54:28 +01:00
Audrey Dutcher
247053e4ac postgresql: fix cross for FreeBSD
- Fix dependencies (uuid and locale)
- Add the --export-dynamic flag - it is applicable for all
  autotools-based cross configurations starting with v16.
2025-03-14 14:44:25 -07:00
Maximilian Bosch
8e25714eee postgresql_13: 13.18 -> 13.20
ChangeLog:
https://www.postgresql.org/about/news/postgresql-173-167-1511-1416-and-1319-released-3015/
https://www.postgresql.org/about/news/out-of-cycle-release-scheduled-for-february-20-2025-3016/

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-02-18 11:19:28 +01:00
Wolfgang Walther
be8612e15a postgresql: fetch from GitHub instead of tarball
This allows us to fetch newer releases a few days before they are
officially released and the tarballs have been pushed.

The regular release cycle is like this:
- Sunday, the release notes are committed.
- Monday, the version is "stamped", i.e. the version bump committed.
- Thursday, the release is made.

There are not going to be any changes from Monday on, so we can kick off
our builds at that time already - they still need time to hit unstable
anyway.
2025-02-18 10:59:47 +01:00
Wolfgang Walther
a8f509677f various: replace substituteAll with replaceVars
Some easy ones.
2025-01-26 16:47:16 +01:00
Wolfgang Walther
0238f9cf84 postgresql: fix build
The recent tzdata update to 2025a broke postgres' test suite. Until the
next minor releases come out, we'll apply upstream's commit to fix this
as a patch.
2025-01-21 20:34:19 +01:00
nixpkgs-ci[bot]
6d43ecacaa Merge staging-next into staging 2025-01-18 18:04:38 +00:00
nixpkgs-ci[bot]
0cae90809c Merge master into staging-next 2025-01-18 18:04:10 +00:00
Christoph Hrdinka
b6773ad79e postgresql: add PYTHONPATH via wrapProgram
Currently `PYTHONPATH` is not set when building PostgreSQL. This results
in Python modules not being available within `pl/python3u`.

This commit adds `PYTHONPATH` of the supplied `python3` via `wrapProgram`,
which is especially useful when supplying a custom Python env.
2025-01-15 13:30:41 +01:00
Christoph Hrdinka
6af01120a6 postgresql: fix build if pythonSupport is enabled
Since 445371f309
(which added `strictDeps = true;`) the build of PostgreSQL is broken if
python support is enabled (via argument `pythonSupport = true`). The
problem seems to be that PostgreSQL’s build system is unable to find
the supplied Python installation.

This commit fixes the build by setting the `PYTHON` environment variable
within the build environment, as document here:

https://www.postgresql.org/docs/current/install-make.html#CONFIGURE-ENVVARS-PYTHON

Closes #372333
2025-01-10 15:23:35 +01:00
Wolfgang Walther
941ebfc7e5 postgresql: fix build on x86_64-darwin (#371534) 2025-01-07 19:27:53 +01:00
Wolfgang Walther
a2b5eb2e96 postgresql: fix build on x86_64-darwin
Resolves #371242
2025-01-06 20:33:19 +01:00
Wolfgang Walther
cb4b0fd769 postgresql: add doc/man outputChecks for all versions
See a0919c7eed for rationale.
2025-01-04 14:59:58 +01:00
Wolfgang Walther
a0919c7eed postgresql_14: fix build
Building postgresql_14 currently fails with this on master:

  error: derivation contains an illegal reference specifier 'man'

The reason seems to be a bug in nix, where outputChecks are run
improperly when one of the outputs can already be substituted. Why the
man output can be substituted from hydra is unknown, but adding more
outputChecks for the the man and doc outputs should work around the
problem until nix is fixed.
2025-01-02 10:31:53 +01:00
github-actions[bot]
4726042dac Merge master into staging-next 2024-12-23 00:15:04 +00:00
Wolfgang Walther
0010ba25b8 various: fix hostPlatform.canExecute buildPlatform
It doesn't matter whether the hostPlatform could execute stuff from the
buildPlatform - we need it the other way around: Certain things during a
build process can only happen when, as part of the build, the
**buildPlatform** can execute the code it just created for the
**hostPlatform**.

Unless we are talking about compilation at run-time, as in the case of
PostgreSQL. Extend the comment there to make it clear that this is on
purpose. Another case that's OK is vlc, where luac can't cross-compile
at build time, thus the bytecode is actually build for the buildPlatform
and the sources must be interpreted at runtime instead.
2024-12-22 16:43:22 +01:00
Silvan Mosberger
4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Silvan Mosberger
84d4f874c2 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev 78e9caf153
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:23:58 +01:00
Ivan Mincik
f29bd95d71 postgresql: remove libxml http workaround 2024-12-09 10:18:08 +01:00
Maximilian Bosch
fc5a956d75 Merge: pkgsStatic.postgresql: fix build (#345289) 2024-12-01 15:51:11 +01:00
Wolfgang Walther
a77adf3285 postgresql: add -export_dynamic on darwin only for v16 2024-11-30 17:52:59 +01:00
Wolfgang Walther
3bd9f92eae pkgsStatic.postgresql: fix build
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
2024-11-30 17:02:13 +01:00
Wolfgang Walther
445371f309 postgresql: enable strictDeps 2024-11-30 17:02:13 +01:00
Maximilian Bosch
ef7dc14ab4 postgresql: drop build-time dependency on GHC
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 a40d887561d5f4a6d330181891d78174f82e84e4)
2024-11-30 15:11:09 +01:00
Wolfgang Walther
88cd14d0f2 postgresql_16: 16.4 -> 16.5
Release Notes:
https://www.postgresql.org/about/news/postgresql-171-165-159-1414-1317-and-1221-released-2955/

(cherry picked from commit 797b544bda)
(cherry picked from commit 77ea13f37774efb6360729f03767ef72b1333e4f)
2024-11-30 15:11:08 +01:00
Wolfgang Walther
5bff902d5e stdenv.mkDerivation: avoid depending on derivations passed in outputChecks
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.
2024-11-25 18:46:07 +01:00
Maximilian Bosch
f910c98b10 Merge: postgresql: fix pgxs Makefile for darwin (#358566) 2024-11-24 12:59:47 +01:00
K900
15bb2bfa54 Merge remote-tracking branch 'origin/staging-next' into staging 2024-11-24 10:18:58 +03:00
Wolfgang Walther
b924334c41 postgresql: fix pgxs Makefile for darwin
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.
2024-11-23 21:43:33 +01:00
Maximilian Bosch
5ec5cdaffa Merge: postgresql: enable tests on darwin (#358248) 2024-11-23 21:04:12 +01:00
Wolfgang Walther
9869d7f746 postgresql: enable tests on darwin
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.
2024-11-23 19:58:50 +01:00
Wolfgang Walther
f51153540e postgresql: remove globin and ivan from maintainers
No response for 3 weeks to:
https://github.com/NixOS/nixpkgs/pull/352905#discussion_r1826066338
2024-11-23 19:54:29 +01:00
Wolfgang Walther
4aa1cda21f postgresql: add bonjourSupport option 2024-11-23 17:11:59 +01:00
Wolfgang Walther
b492340e98 postgresql: add nlsSupport option 2024-11-23 17:11:59 +01:00
Wolfgang Walther
cb8a1c74f3 postgresql: add selinuxSupport option 2024-11-23 17:11:59 +01:00