at master 1.3 kB view raw
1{ 2 stdenv, 3 lib, 4 buildPythonPackage, 5 fetchFromGitHub, 6 7 # build-system 8 cython, 9 setuptools, 10 11 # native dependencies 12 libxml2, 13 libxslt, 14 zlib, 15 xcodebuild, 16}: 17 18buildPythonPackage rec { 19 pname = "lxml"; 20 version = "6.0.0"; 21 pyproject = true; 22 23 src = fetchFromGitHub { 24 owner = "lxml"; 25 repo = "lxml"; 26 tag = "lxml-${version}"; 27 hash = "sha256-e1Lhtn8cjuDWkBV29icIqe0CJ59Ab05hBGMa+eRBzAw="; 28 }; 29 30 build-system = [ 31 cython 32 setuptools 33 ] 34 ++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ]; 35 36 # required for build time dependency check 37 nativeBuildInputs = [ 38 libxml2.dev 39 libxslt.dev 40 ]; 41 42 buildInputs = [ 43 libxml2 44 libxslt 45 zlib 46 ]; 47 48 env = lib.optionalAttrs stdenv.cc.isClang { 49 NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types"; 50 }; 51 52 # tests are meant to be ran "in-place" in the same directory as src 53 doCheck = false; 54 55 pythonImportsCheck = [ 56 "lxml" 57 "lxml.etree" 58 ]; 59 60 meta = with lib; { 61 changelog = "https://github.com/lxml/lxml/blob/lxml-${version}/CHANGES.txt"; 62 description = "Pythonic binding for the libxml2 and libxslt libraries"; 63 homepage = "https://lxml.de"; 64 license = licenses.bsd3; 65 maintainers = [ ]; 66 }; 67}