From 640b1bb38b64f7270b06b502c2d6eae817dddd67 Mon Sep 17 00:00:00 2001 From: squalus Date: Tue, 12 Jul 2022 20:39:33 -0700 Subject: [PATCH] python310Packages.pydantic: fix cross compile make the doc build optional, and disable for cross builds --- .../python-modules/pydantic/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/pydantic/default.nix b/pkgs/development/python-modules/pydantic/default.nix index 25a5d54d529e..a1f567adcd59 100644 --- a/pkgs/development/python-modules/pydantic/default.nix +++ b/pkgs/development/python-modules/pydantic/default.nix @@ -1,4 +1,5 @@ { lib +, stdenv , buildPythonPackage , cython , devtools @@ -10,6 +11,7 @@ , pythonOlder , typing-extensions # dependencies for building documentation. +, withDocs ? (stdenv.hostPlatform == stdenv.buildPlatform) , ansi2html , markdown-include , mkdocs @@ -25,7 +27,13 @@ buildPythonPackage rec { pname = "pydantic"; version = "1.9.0"; - outputs = [ "out" "doc" ]; + + outputs = [ + "out" + ] ++ lib.optionals withDocs [ + "doc" + ]; + disabled = pythonOlder "3.7"; src = fetchFromGitHub { @@ -41,7 +49,7 @@ buildPythonPackage rec { nativeBuildInputs = [ cython - + ] ++ lib.optionals withDocs [ # dependencies for building documentation ansi2html markdown-include @@ -73,12 +81,12 @@ buildPythonPackage rec { # Must include current directory into PYTHONPATH, since documentation # building process expects "import pydantic" to work. - preBuild = '' + preBuild = lib.optionals withDocs '' PYTHONPATH=$PWD:$PYTHONPATH make docs ''; # Layout documentation in same way as "sphinxHook" does. - postInstall = '' + postInstall = lib.optionals withDocs '' mkdir -p $out/share/doc/$name mv ./site $out/share/doc/$name/html '';