yq: fix path to jq #103737
Merged
yq: fix path to jq #103737
Conversation
@@ -27,6 +27,7 @@ buildPythonPackage rec { | |||
pyyaml | |||
xmltodict | |||
argcomplete | |||
jq |
jonringer
Nov 14, 2020
Contributor
if the package is "shelling" out to it, this should be patched in the source to do so. Otherwise there's no guarantee that it will work when imported as a python module.
if the package is "shelling" out to it, this should be patched in the source to do so. Otherwise there's no guarantee that it will work when imported as a python module.
ttuegel
Nov 16, 2020
Author
Member
Thanks for pointing that out! I patched the package; could you please take another look?
Thanks for pointing that out! I patched the package; could you please take another look?
patches = [ ./jq-path.patch ]; | ||
|
||
postPatch = '' | ||
substituteInPlace test/test.py --replace "expect_exit_codes={0} if sys.stdin.isatty() else {2}" "expect_exit_codes={0}" | ||
substituteInPlace yq/__init__.py --subst-var-by JQ "${lib.getBin pkgs.jq}/bin/jq" | ||
substituteInPlace test/test.py \ | ||
--subst-var-by JQ "${lib.getBin pkgs.jq}/bin/jq" \ | ||
--replace "expect_exit_codes={0} if sys.stdin.isatty() else {2}" "expect_exit_codes={0}" | ||
''; |
Comment on lines
25
to
35
kalbasit
Nov 16, 2020
•
Member
You can actually replace the variables you have with substitute within the patches
declaration so you don't really need the postPatch for the JQ substitution.
Example:
nixpkgs/pkgs/applications/audio/curseradio/default.nix
Lines 20 to 25
in
14f2dc1
You can actually replace the variables you have with substitute within the patches
declaration so you don't really need the postPatch for the JQ substitution.
Example:
nixpkgs/pkgs/applications/audio/curseradio/default.nix
Lines 20 to 25 in 14f2dc1
f0826c4
to
d26a776
yq requires jq at runtime, so that the package is broken unless the path to jq is patched in.
b5bf9da
into
NixOS:master
19 checks passed
19 checks passed
grahamcofborg-eval-darwin
nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4074d4a"; rev="4074d4ad98fb41093c492e5e57492ef65caf1d13"; } ./pkgs/t
Details
grahamcofborg-eval-nixos
nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4074d4a"; rev="4074d4ad98fb41093c492e5e57492ef65caf1d13"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual
nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4074d4a"; rev="4074d4ad98fb41093c492e5e57492ef65caf1d13"; } ./nixos/
Details
grahamcofborg-eval-nixos-options
nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4074d4a"; rev="4074d4ad98fb41093c492e5e57492ef65caf1d13"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual
nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4074d4a"; rev="4074d4ad98fb41093c492e5e57492ef65caf1d13"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball
nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4074d4a"; rev="4074d4ad98fb41093c492e5e57492ef65caf1d13"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset
nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="4074d4a"; rev="4074d4ad98fb41093c492e5e57492ef65caf1d13"; } ./pkgs/t
Details
grahamcofborg-eval-package-list-no-aliases
nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
yq requires jq at runtime, so that the package is broken without patching in the path to jq.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)