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:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
55
pkgs/development/python-modules/yq/default.nix
Normal file
55
pkgs/development/python-modules/yq/default.nix
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchPypi
|
||||
, substituteAll
|
||||
, argcomplete
|
||||
, pyyaml
|
||||
, toml
|
||||
, xmltodict
|
||||
, jq
|
||||
, setuptools-scm
|
||||
, pytestCheckHook
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "yq";
|
||||
version = "2.14.0";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-9L8rKZ0eXH69dM+yXR9dm2QBBjusB6LQmhVhRMHWROE=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./jq-path.patch;
|
||||
jq = "${lib.getBin jq}/bin/jq";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pyyaml
|
||||
xmltodict
|
||||
toml
|
||||
argcomplete
|
||||
];
|
||||
|
||||
checkInputs = [
|
||||
pytestCheckHook
|
||||
];
|
||||
|
||||
pytestFlagsArray = [ "test/test.py" ];
|
||||
|
||||
pythonImportsCheck = [ "yq" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents";
|
||||
homepage = "https://github.com/kislyuk/yq";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ womfoo SuperSandro2000 ];
|
||||
};
|
||||
}
|
||||
26
pkgs/development/python-modules/yq/jq-path.patch
Normal file
26
pkgs/development/python-modules/yq/jq-path.patch
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
diff --git a/test/test.py b/test/test.py
|
||||
index f25dced..cd308c8 100755
|
||||
--- a/test/test.py
|
||||
+++ b/test/test.py
|
||||
@@ -105,7 +105,7 @@ class TestYq(unittest.TestCase):
|
||||
tf2.seek(0)
|
||||
self.assertEqual(self.run_yq("", ["-y", arg, tf.name, self.fd_path(tf2)]), '1\n...\n')
|
||||
|
||||
- @unittest.skipIf(subprocess.check_output(["jq", "--version"]) < b"jq-1.6", "Test options introduced in jq 1.6")
|
||||
+ @unittest.skipIf(subprocess.check_output(["@jq@", "--version"]) < b"jq-1.6", "Test options introduced in jq 1.6")
|
||||
def test_jq16_arg_passthrough(self):
|
||||
self.assertEqual(self.run_yq("{}", ["--indentless", "-y", ".a=$ARGS.positional", "--args", "a", "b"]),
|
||||
"a:\n- a\n- b\n")
|
||||
diff --git a/yq/__init__.py b/yq/__init__.py
|
||||
index 91212d0..ee5a799 100755
|
||||
--- a/yq/__init__.py
|
||||
+++ b/yq/__init__.py
|
||||
@@ -146,7 +146,7 @@ def yq(input_streams=None, output_stream=None, input_format="yaml", output_forma
|
||||
try:
|
||||
# Notes: universal_newlines is just a way to induce subprocess to make stdin a text buffer and encode it for us;
|
||||
# close_fds must be false for command substitution to work (yq . t.yml --slurpfile t <(yq . t.yml))
|
||||
- jq = subprocess.Popen(["jq"] + list(jq_args),
|
||||
+ jq = subprocess.Popen(["@jq@"] + list(jq_args),
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE if converting_output else None,
|
||||
close_fds=False,
|
||||
Loading…
Add table
Add a link
Reference in a new issue