4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
77 lines
1.3 KiB
Nix
77 lines
1.3 KiB
Nix
{ attrs
|
|
, buildPythonPackage
|
|
, defusedxml
|
|
, fetchPypi
|
|
, hypothesis
|
|
, isPy3k
|
|
, lxml
|
|
, pillow
|
|
, pybind11
|
|
, pytestCheckHook
|
|
, pytest-helpers-namespace
|
|
, pytest-timeout
|
|
, pytest_xdist
|
|
, pytestrunner
|
|
, python-dateutil
|
|
, python-xmp-toolkit
|
|
, python3
|
|
, qpdf
|
|
, setuptools-scm-git-archive
|
|
, setuptools_scm
|
|
, lib, stdenv
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pikepdf";
|
|
version = "2.2.0";
|
|
disabled = ! isPy3k;
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "74300a32c41b3d578772f6933f23a88b19f74484185e71e5225ce2f7ea5aea78";
|
|
};
|
|
|
|
buildInputs = [
|
|
pybind11
|
|
qpdf
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
setuptools-scm-git-archive
|
|
setuptools_scm
|
|
];
|
|
|
|
checkInputs = [
|
|
attrs
|
|
hypothesis
|
|
pillow
|
|
pytestCheckHook
|
|
pytest-helpers-namespace
|
|
pytest-timeout
|
|
pytest_xdist
|
|
pytestrunner
|
|
python-dateutil
|
|
python-xmp-toolkit
|
|
];
|
|
|
|
propagatedBuildInputs = [ defusedxml lxml ];
|
|
|
|
postPatch = ''
|
|
sed -i \
|
|
-e 's/^pytest .*/pytest/g' \
|
|
-e 's/^attrs .*/attrs/g' \
|
|
-e 's/^hypothesis .*/hypothesis/g' \
|
|
requirements/test.txt
|
|
'';
|
|
|
|
preBuild = ''
|
|
HOME=$TMPDIR
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/pikepdf/pikepdf";
|
|
description = "Read and write PDFs with Python, powered by qpdf";
|
|
license = licenses.mpl20;
|
|
maintainers = [ maintainers.kiwi ];
|
|
};
|
|
}
|