uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,97 @@
{ lib
, attrs
, buildPythonPackage
, defusedxml
, fetchFromGitHub
, hypothesis
, pythonOlder
, jbig2dec
, lxml
, mupdf
, packaging
, pillow
, psutil
, pybind11
, pytest-xdist
, pytestCheckHook
, python-dateutil
, python-xmp-toolkit
, qpdf
, setuptools
, setuptools-scm
, setuptools-scm-git-archive
, substituteAll
}:
buildPythonPackage rec {
pname = "pikepdf";
version = "5.1.3";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "pikepdf";
repo = "pikepdf";
rev = "v${version}";
# The content of .git_archival.txt is substituted upon tarball creation,
# which creates indeterminism if master no longer points to the tag.
# See https://github.com/jbarlow83/OCRmyPDF/issues/841
postFetch = ''
rm "$out/.git_archival.txt"
'';
hash = "sha256-jkAwc1bQ1jRDf/qY+xAjiLXXO98qKjyX+J7Lu4tYWoI=";
};
patches = [
(substituteAll {
src = ./paths.patch;
jbig2dec = "${lib.getBin jbig2dec}/bin/jbig2dec";
mudraw = "${lib.getBin mupdf}/bin/mudraw";
})
];
postPatch = ''
sed -i 's|\S*/opt/homebrew.*|pass|' setup.py
'';
SETUPTOOLS_SCM_PRETEND_VERSION = version;
buildInputs = [
pybind11
qpdf
];
nativeBuildInputs = [
setuptools-scm-git-archive
setuptools-scm
];
checkInputs = [
attrs
hypothesis
pytest-xdist
psutil
pytestCheckHook
python-dateutil
python-xmp-toolkit
];
propagatedBuildInputs = [
defusedxml
lxml
packaging
pillow
setuptools
];
pythonImportsCheck = [ "pikepdf" ];
meta = with lib; {
homepage = "https://github.com/pikepdf/pikepdf";
description = "Read and write PDFs with Python, powered by qpdf";
license = licenses.mpl20;
maintainers = with maintainers; [ kiwi dotlambda ];
changelog = "https://github.com/pikepdf/pikepdf/blob/${version}/docs/release_notes.rst";
};
}

View file

@ -0,0 +1,44 @@
diff --git a/src/pikepdf/_methods.py b/src/pikepdf/_methods.py
index 87e99fe..253a701 100644
--- a/src/pikepdf/_methods.py
+++ b/src/pikepdf/_methods.py
@@ -204,7 +204,7 @@ def _mudraw(buffer, fmt) -> bytes:
tmp_in.flush()
proc = run(
- ['mudraw', '-F', fmt, '-o', '-', tmp_in.name],
+ ['@mudraw@', '-F', fmt, '-o', '-', tmp_in.name],
capture_output=True,
check=True,
)
diff --git a/src/pikepdf/jbig2.py b/src/pikepdf/jbig2.py
index 04c762d..924727c 100644
--- a/src/pikepdf/jbig2.py
+++ b/src/pikepdf/jbig2.py
@@ -26,7 +26,7 @@ def extract_jbig2(
output_path = Path(tmpdir) / "outfile"
args = [
- "jbig2dec",
+ "@jbig2dec@",
"--embedded",
"--format",
"png",
@@ -59,7 +59,7 @@ def extract_jbig2_bytes(jbig2: bytes, jbig2_globals: bytes) -> bytes:
output_path = Path(tmpdir) / "outfile"
args = [
- "jbig2dec",
+ "@jbig2dec@",
"--embedded",
"--format",
"png",
@@ -84,7 +84,7 @@ def extract_jbig2_bytes(jbig2: bytes, jbig2_globals: bytes) -> bytes:
def jbig2dec_available() -> bool:
try:
- proc = run(['jbig2dec', '--version'], stdout=PIPE, check=True, encoding='ascii')
+ proc = run(['@jbig2dec@', '--version'], stdout=PIPE, check=True, encoding='ascii')
except (CalledProcessError, FileNotFoundError):
return False
else: