From 6819a15ccc8a1e12462d479d60a6fdb697b27041 Mon Sep 17 00:00:00 2001 From: phaer Date: Thu, 13 Jul 2023 09:31:40 +0200 Subject: [PATCH] v1/drvs: add nixpkgs-overrides for odoos psycopg2 ...to fix aarch64-darwin builds --- v1/nix/modules/drvs/odoo/default.nix | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/v1/nix/modules/drvs/odoo/default.nix b/v1/nix/modules/drvs/odoo/default.nix index 8c9a986b..51f551d4 100644 --- a/v1/nix/modules/drvs/odoo/default.nix +++ b/v1/nix/modules/drvs/odoo/default.nix @@ -39,12 +39,28 @@ in { "${src}" ]; + # These buildInputs are only used during locking, well-behaved, i.e. + # PEP 518 packages should not those, but some packages like psycopg2 + # require dependencies to be available during locking in order to execute + # setup.py. This is fixed in psycopg3 nativeBuildInputs = [config.deps.postgresql]; - # fix some builds via overrides + # fix some builds via package-specific overrides drvs = { - psycopg2.mkDerivation = { - nativeBuildInputs = [config.deps.postgresql]; + psycopg2 = { + # We can bulk-inherit overrides from nixpkgs, to which often helps to + # get something working quickly. In this case it's needed for psycopg2 + # to build on aarch64-darwin. We exclude propagatedBuildInputs to keep + # python deps from our lock file and avoid version conflicts + nixpkgs-overrides = { + enable = true; + exclude = ["propagatedBuildInputs"]; + }; + # packages-specific build inputs that are used for this + # package only. Included here for demonstration + # purposes, as nativeBuildInputs from nixpkgs-overrides + # should already include it + mkDerivation.nativeBuildInputs = [config.deps.postgresql]; }; libsass.mkDerivation = { doCheck = false;