Files
nixpkgs/pkgs/development/python-modules/lxml/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

73 lines
1.3 KiB
Nix

{
stdenv,
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
cython,
setuptools,
# native dependencies
libxml2,
libxslt,
zlib,
xcodebuild,
}:
buildPythonPackage rec {
pname = "lxml";
version = "6.0.2";
pyproject = true;
src = fetchFromGitHub {
owner = "lxml";
repo = "lxml";
tag = "lxml-${version}";
hash = "sha256-Ri5SzfQJFghRcMAKHS5QKD365OZlio895fSlumq83vs=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace-fail 'Cython>=3.1.4' 'Cython'
'';
build-system = [
cython
setuptools
]
++ lib.optionals stdenv.hostPlatform.isDarwin [ xcodebuild ];
# required for build time dependency check
nativeBuildInputs = [
libxml2.dev
libxslt.dev
];
buildInputs = [
libxml2
libxslt
zlib
];
env = lib.optionalAttrs stdenv.cc.isClang {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
};
# tests are meant to be ran "in-place" in the same directory as src
doCheck = false;
pythonImportsCheck = [
"lxml"
"lxml.etree"
];
meta = {
changelog = "https://github.com/lxml/lxml/blob/lxml-${version}/CHANGES.txt";
description = "Pythonic binding for the libxml2 and libxslt libraries";
homepage = "https://lxml.de";
license = lib.licenses.bsd3;
maintainers = [ ];
};
}