1{ stdenv, lib, buildPythonPackage, fetchFromGitHub
2, cython
3, libxml2
4, libxslt
5, zlib
6, xcodebuild
7}:
8
9buildPythonPackage rec {
10 pname = "lxml";
11 version = "4.9.3-3";
12
13 src = fetchFromGitHub {
14 owner = pname;
15 repo = pname;
16 rev = "refs/tags/lxml-${version}";
17 hash = "sha256-Vrizi+6jUUEx7qODU4PAH5ZmvBIyT9H18+QpYB0m1f4=";
18 };
19
20 # setuptoolsBuildPhase needs dependencies to be passed through nativeBuildInputs
21 nativeBuildInputs = [ libxml2.dev libxslt.dev cython ] ++ lib.optionals stdenv.isDarwin [ xcodebuild ];
22 buildInputs = [ libxml2 libxslt zlib ];
23
24 # tests are meant to be ran "in-place" in the same directory as src
25 doCheck = false;
26
27 pythonImportsCheck = [ "lxml" "lxml.etree" ];
28
29 meta = with lib; {
30 description = "Pythonic binding for the libxml2 and libxslt libraries";
31 homepage = "https://lxml.de";
32 license = licenses.bsd3;
33 maintainers = with maintainers; [ jonringer ];
34 };
35}