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,73 @@
{ lib
, stdenv
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, substituteAll
, graphviz
, xdg-utils
, makeFontsConf
, freefont_ttf
, mock
, pytest
, pytest-mock
, python
}:
buildPythonPackage rec {
pname = "graphviz";
version = "0.20";
disabled = pythonOlder "3.7";
# patch does not apply to PyPI tarball due to different line endings
src = fetchFromGitHub {
owner = "xflr6";
repo = "graphviz";
rev = version;
hash = "sha256-QyZwXxRbcMushxh/Ypy+v4FOTM4H1u5b7IZMSVgLyEs=";
};
patches = [
(substituteAll {
src = ./paths.patch;
inherit graphviz;
xdgutils = xdg-utils;
})
];
postPatch = ''
sed -i "/--cov/d" setup.cfg
'';
# Fontconfig error: Cannot load default config file
FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [ freefont_ttf ];
};
checkInputs = [
mock
pytest
pytest-mock
];
checkPhase = ''
runHook preCheck
HOME=$TMPDIR ${python.interpreter} run-tests.py
runHook postCheck
'';
# Too many failures due to attempting to connect to com.apple.fonts daemon
doCheck = !stdenv.isDarwin;
meta = with lib; {
description = "Simple Python interface for Graphviz";
homepage = "https://github.com/xflr6/graphviz";
changelog = "https://github.com/xflr6/graphviz/blob/${src.rev}/CHANGES.rst";
license = licenses.mit;
maintainers = with maintainers; [ dotlambda ];
};
}

View file

@ -0,0 +1,79 @@
diff --git a/graphviz/backend/dot_command.py b/graphviz/backend/dot_command.py
index 60654bd..2c62b47 100644
--- a/graphviz/backend/dot_command.py
+++ b/graphviz/backend/dot_command.py
@@ -9,7 +9,7 @@ from .. import parameters
__all__ = ['DOT_BINARY', 'command']
-DOT_BINARY = pathlib.Path('dot')
+DOT_BINARY = pathlib.Path('@graphviz@/bin/dot')
def command(engine: str, format_: str, *,
diff --git a/graphviz/backend/unflattening.py b/graphviz/backend/unflattening.py
index a386b8c..883cdc6 100644
--- a/graphviz/backend/unflattening.py
+++ b/graphviz/backend/unflattening.py
@@ -11,7 +11,7 @@ from . import execute
__all__ = ['UNFLATTEN_BINARY', 'unflatten']
-UNFLATTEN_BINARY = pathlib.Path('unflatten')
+UNFLATTEN_BINARY = pathlib.Path('@graphviz@/bin/unflatten')
@_tools.deprecate_positional_args(supported_number=1)
diff --git a/graphviz/backend/viewing.py b/graphviz/backend/viewing.py
index fde74a6..6f29b68 100644
--- a/graphviz/backend/viewing.py
+++ b/graphviz/backend/viewing.py
@@ -55,7 +55,7 @@ def view_darwin(filepath: typing.Union[os.PathLike, str], *,
def view_unixoid(filepath: typing.Union[os.PathLike, str], *,
quiet: bool) -> None:
"""Open filepath in the user's preferred application (linux, freebsd)."""
- cmd = ['xdg-open', filepath]
+ cmd = ['@xdgutils@/bin/xdg-open', filepath]
log.debug('view: %r', cmd)
kwargs = {'stderr': subprocess.DEVNULL} if quiet else {}
subprocess.Popen(cmd, **kwargs)
diff --git a/tests/_common.py b/tests/_common.py
index 87b4cbd..4188beb 100644
--- a/tests/_common.py
+++ b/tests/_common.py
@@ -14,9 +14,9 @@ __all__ = ['EXPECTED_DOT_BINARY', 'EXPECTED_UNFLATTEN_BINARY',
'as_cwd',
'check_startupinfo', 'StartupinfoMatcher']
-EXPECTED_DOT_BINARY = _compat.make_subprocess_arg(pathlib.Path('dot'))
+EXPECTED_DOT_BINARY = _compat.make_subprocess_arg(pathlib.Path('@graphviz@/bin/dot'))
-EXPECTED_UNFLATTEN_BINARY = _compat.make_subprocess_arg(pathlib.Path('unflatten'))
+EXPECTED_UNFLATTEN_BINARY = _compat.make_subprocess_arg(pathlib.Path('@graphviz@/bin/unflatten'))
EXPECTED_DEFAULT_ENCODING = 'utf-8'
diff --git a/tests/backend/test_execute.py b/tests/backend/test_execute.py
index 2cb853a..8093dfe 100644
--- a/tests/backend/test_execute.py
+++ b/tests/backend/test_execute.py
@@ -15,6 +15,7 @@ def empty_path(monkeypatch):
monkeypatch.setenv('PATH', '')
+@pytest.mark.skip(reason='empty $PATH has no effect')
@pytest.mark.usefixtures('empty_path')
@pytest.mark.parametrize(
'func, args',
diff --git a/tests/backend/test_viewing.py b/tests/backend/test_viewing.py
index 59a23d5..f73f905 100644
--- a/tests/backend/test_viewing.py
+++ b/tests/backend/test_viewing.py
@@ -26,6 +26,6 @@ def test_view_mocked(mocker, mock_platform, mock_popen, mock_startfile, quiet):
if mock_platform == 'darwin':
mock_popen.assert_called_once_with(['open', 'nonfilepath'], **kwargs)
elif mock_platform in ('linux', 'freebsd'):
- mock_popen.assert_called_once_with(['xdg-open', 'nonfilepath'], **kwargs)
+ mock_popen.assert_called_once_with(['@xdgutils@/bin/xdg-open', 'nonfilepath'], **kwargs)
else:
raise RuntimeError