2021-03-19 17:17:44 +00:00
|
|
|
{ stdenv, lib, buildPythonPackage, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, cython
|
|
|
|
, libxml2
|
|
|
|
, libxslt
|
|
|
|
, zlib
|
2021-03-19 17:17:44 +00:00
|
|
|
, xcodebuild
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "lxml";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "4.9.4";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/lxml-${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-qS20wb83eFapiPZe25BViHpYkjgvnCIZpiYkPNIPHZg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
patches = [
|
|
|
|
# fix compile error with libxml 2.12
|
|
|
|
# backport of: https://github.com/lxml/lxml/commit/b0861bea17769584a85f57eb00235ce0ca9811af
|
|
|
|
./libxml-2.12.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# setuptoolsBuildPhase needs dependencies to be passed through nativeBuildInputs
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [ libxml2.dev libxslt.dev cython ] ++ lib.optionals stdenv.isDarwin [ xcodebuild ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libxml2 libxslt zlib ];
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "lxml" "lxml.etree" ];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
meta = with lib; {
|
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
|
|
|
};
|
|
|
|
}
|