nominatim: fix issues with package

There are two issues that make the package unusable as is:
- The python dependencies are not taken into account, giving import
  errors on launch
- nominatim needs to be built with the same postgres version it will run
  on. It's a bit dirty to do an override postgresql_12 =
  postgresql_another_version, so this commit adds a `postgres` attribute
  to be more consistent
This commit is contained in:
traxys 2023-10-30 18:44:13 +01:00
parent fe1e9d524b
commit 758e0ef541
2 changed files with 17 additions and 16 deletions

View file

@ -1,7 +1,8 @@
{ stdenv, lib, fetchFromGitHub, fetchurl
, clang-tools, cmake, bzip2, zlib, expat, boost, git, pandoc, gzip
, postgresql_12
, python3, python3Packages, php
, clang-tools, cmake, bzip2, zlib, expat, boost, git, pandoc
# Nominatim needs to be built with the same postgres version it will target
, postgresql
, python3, php
}:
let
@ -36,21 +37,19 @@ stdenv.mkDerivation rec {
zlib
expat
boost
python3
(python3.withPackages (ps: with ps; [
pyyaml
python-dotenv
psycopg2
psutil
jinja2
pyicu
datrie
]))
# python3Packages.pylint # We don't want to run pylint because the package could break on pylint bumps which is really annoying.
# python3Packages.pytest # disabled since I can't get it to run tests anyway
# python3Packages.behave # disabled since I can't get it to run tests anyway
postgresql_12
];
propagatedBuildInputs = with python3Packages; [
pyyaml
python-dotenv
psycopg2
psutil
jinja2
pyicu
datrie
postgresql
];
postPatch = ''

View file

@ -1953,7 +1953,9 @@ with pkgs;
node-glob = callPackage ../tools/misc/node-glob { };
nominatim = callPackage ../servers/nominatim { };
nominatim = callPackage ../servers/nominatim {
postgresql = postgresql_12;
};
npm-check-updates = callPackage ../tools/package-management/npm-check-updates { };