2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
cython,
|
|
|
|
setuptools,
|
|
|
|
|
|
|
|
# native dependencies
|
|
|
|
libxml2,
|
|
|
|
libxslt,
|
|
|
|
zlib,
|
|
|
|
xcodebuild,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "lxml";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "5.1.0";
|
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-02-29 20:09:43 +00:00
|
|
|
owner = "lxml";
|
|
|
|
repo = "lxml";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/lxml-${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-eWLYzZWatYDmhuBTZynsdytlNFKKmtWQ1XIyzVD8sDY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# setuptoolsBuildPhase needs dependencies to be passed through nativeBuildInputs
|
2024-02-29 20:09:43 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
libxml2.dev
|
|
|
|
libxslt.dev
|
2024-04-21 15:54:59 +00:00
|
|
|
cython
|
2024-02-29 20:09:43 +00:00
|
|
|
setuptools
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [ xcodebuild ];
|
2024-02-29 20:09:43 +00:00
|
|
|
buildInputs = [
|
|
|
|
libxml2
|
|
|
|
libxslt
|
|
|
|
zlib
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
env = lib.optionalAttrs stdenv.cc.isClang {
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# tests are meant to be ran "in-place" in the same directory as src
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"lxml"
|
|
|
|
"lxml.etree"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
meta = with lib; {
|
2024-02-29 20:09:43 +00:00
|
|
|
changelog = "https://github.com/lxml/lxml/blob/lxml-${version}/CHANGES.txt";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Pythonic binding for the libxml2 and libxslt libraries";
|
|
|
|
homepage = "https://lxml.de";
|
|
|
|
license = licenses.bsd3;
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ jonringer ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|