From 758e0ef541aa3fbe8dd07572d0f047496cbc08c9 Mon Sep 17 00:00:00 2001 From: traxys Date: Mon, 30 Oct 2023 18:44:13 +0100 Subject: [PATCH] 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 --- pkgs/servers/nominatim/default.nix | 29 ++++++++++++++--------------- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/pkgs/servers/nominatim/default.nix b/pkgs/servers/nominatim/default.nix index 3994177e0847..8c0410b87ac3 100644 --- a/pkgs/servers/nominatim/default.nix +++ b/pkgs/servers/nominatim/default.nix @@ -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 = '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 546e6a6e66d8..03e4d19851bd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };