2021-03-17 20:32:48 +00:00
|
|
|
{ stdenv, lib, buildPythonPackage, fetchFromGitHub
|
2019-10-21 15:57:20 +00:00
|
|
|
, cython
|
2017-12-30 14:10:02 +00:00
|
|
|
, libxml2
|
|
|
|
, libxslt
|
2019-10-21 15:57:20 +00:00
|
|
|
, zlib
|
2021-03-17 20:32:48 +00:00
|
|
|
, xcodebuild
|
2017-12-30 14:10:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "lxml";
|
2022-03-02 21:42:04 +00:00
|
|
|
version = "4.8.0";
|
2017-12-30 14:10:02 +00:00
|
|
|
|
2019-10-21 15:57:20 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
2021-11-25 22:46:58 +00:00
|
|
|
rev = "lxml-${version}";
|
2022-03-02 21:42:04 +00:00
|
|
|
sha256 = "sha256-ppyLn8B0YFQivRCOE8TjKGdDDQHbb7UdTUkevznoVC8=";
|
2017-12-30 14:10:02 +00:00
|
|
|
};
|
|
|
|
|
2019-10-21 15:57:20 +00:00
|
|
|
# setuptoolsBuildPhase needs dependencies to be passed through nativeBuildInputs
|
2021-03-17 20:32:48 +00:00
|
|
|
nativeBuildInputs = [ libxml2.dev libxslt.dev cython ] ++ lib.optionals stdenv.isDarwin [ xcodebuild ];
|
2019-10-21 15:57:20 +00:00
|
|
|
buildInputs = [ libxml2 libxslt zlib ];
|
2017-12-30 14:10:02 +00:00
|
|
|
|
2019-10-21 15:57:20 +00:00
|
|
|
# tests are meant to be ran "in-place" in the same directory as src
|
|
|
|
doCheck = false;
|
2017-12-30 14:10:02 +00:00
|
|
|
|
2019-10-21 15:57:20 +00:00
|
|
|
pythonImportsCheck = [ "lxml" "lxml.etree" ];
|
|
|
|
|
2020-07-07 21:35:00 +00:00
|
|
|
meta = with lib; {
|
2017-12-30 14:10:02 +00:00
|
|
|
description = "Pythonic binding for the libxml2 and libxslt libraries";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://lxml.de";
|
2019-10-21 15:57:20 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ jonringer sjourdois ];
|
2017-12-30 14:10:02 +00:00
|
|
|
};
|
2018-06-30 00:18:27 +00:00
|
|
|
}
|