mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-23 13:45:49 +02:00
Merge pull request #181311 from squalus/pydantic
python310Packages.pydantic: fix cross compile
This commit is contained in:
commit
1224622646
|
@ -1,4 +1,5 @@
|
||||||
{ lib
|
{ lib
|
||||||
|
, stdenv
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, cython
|
, cython
|
||||||
, devtools
|
, devtools
|
||||||
|
@ -10,6 +11,7 @@
|
||||||
, pythonOlder
|
, pythonOlder
|
||||||
, typing-extensions
|
, typing-extensions
|
||||||
# dependencies for building documentation.
|
# dependencies for building documentation.
|
||||||
|
, withDocs ? (stdenv.hostPlatform == stdenv.buildPlatform)
|
||||||
, ansi2html
|
, ansi2html
|
||||||
, markdown-include
|
, markdown-include
|
||||||
, mkdocs
|
, mkdocs
|
||||||
|
@ -25,7 +27,13 @@
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "pydantic";
|
pname = "pydantic";
|
||||||
version = "1.9.0";
|
version = "1.9.0";
|
||||||
outputs = [ "out" "doc" ];
|
|
||||||
|
outputs = [
|
||||||
|
"out"
|
||||||
|
] ++ lib.optionals withDocs [
|
||||||
|
"doc"
|
||||||
|
];
|
||||||
|
|
||||||
disabled = pythonOlder "3.7";
|
disabled = pythonOlder "3.7";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
|
@ -41,7 +49,7 @@ buildPythonPackage rec {
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
cython
|
cython
|
||||||
|
] ++ lib.optionals withDocs [
|
||||||
# dependencies for building documentation
|
# dependencies for building documentation
|
||||||
ansi2html
|
ansi2html
|
||||||
markdown-include
|
markdown-include
|
||||||
|
@ -73,12 +81,12 @@ buildPythonPackage rec {
|
||||||
|
|
||||||
# Must include current directory into PYTHONPATH, since documentation
|
# Must include current directory into PYTHONPATH, since documentation
|
||||||
# building process expects "import pydantic" to work.
|
# building process expects "import pydantic" to work.
|
||||||
preBuild = ''
|
preBuild = lib.optionals withDocs ''
|
||||||
PYTHONPATH=$PWD:$PYTHONPATH make docs
|
PYTHONPATH=$PWD:$PYTHONPATH make docs
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Layout documentation in same way as "sphinxHook" does.
|
# Layout documentation in same way as "sphinxHook" does.
|
||||||
postInstall = ''
|
postInstall = lib.optionals withDocs ''
|
||||||
mkdir -p $out/share/doc/$name
|
mkdir -p $out/share/doc/$name
|
||||||
mv ./site $out/share/doc/$name/html
|
mv ./site $out/share/doc/$name/html
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue