From 1830f9dc306611adecba0c2b64ca81850591087d Mon Sep 17 00:00:00 2001 From: figsoda Date: Sat, 3 Dec 2022 19:40:26 -0500 Subject: [PATCH] patsh: 0.1.3 -> 0.2.0 Diff: https://github.com/nix-community/patsh/compare/v0.1.3...v0.2.0 Changelog: https://github.com/nix-community/patsh/blob/v0.2.0/CHANGELOG.md --- pkgs/development/tools/misc/patsh/default.nix | 31 +++++++++++++------ 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/pkgs/development/tools/misc/patsh/default.nix b/pkgs/development/tools/misc/patsh/default.nix index 9d79fc8ba53e..e36ce7c884bd 100644 --- a/pkgs/development/tools/misc/patsh/default.nix +++ b/pkgs/development/tools/misc/patsh/default.nix @@ -1,30 +1,41 @@ { lib +, runCommand , rustPlatform , fetchFromGitHub , stdenv -, runCommand -, tree-sitter +, coreutils }: +let + custom = runCommand "custom" { } '' + mkdir -p $out/bin + touch $out/bin/{'foo$','foo"`'} + chmod +x $out/bin/{'foo$','foo"`'} + ''; +in + rustPlatform.buildRustPackage rec { pname = "patsh"; - version = "0.1.3"; + version = "0.2.0"; src = fetchFromGitHub { owner = "nix-community"; repo = pname; rev = "v${version}"; - sha256 = "sha256-KmQVZwZC7KHlzNnL2IKQ76wHUDNUZKz/aFaY4ujvBo4="; + sha256 = "sha256-7HXJspebluQeejKYmVA7sy/F3dtU1gc4eAbKiPexMMA="; }; - cargoSha256 = "sha256-vozQKBxAVELdqTnqBpgHX0Wyk18EZAtpiRsKjwz8xKE="; + cargoSha256 = "sha256-R6ScpLYbEJAu7+CyJsMdljtXq7wsMojHK5O1lH+E/E8="; - # tests fail on darwin due to rpath issues - doCheck = !stdenv.isDarwin; + checkInputs = [ custom ]; - TREE_SITTER_BASH = runCommand "tree-sitter-bash" { } '' - mkdir $out - ln -s ${tree-sitter.builtGrammars.tree-sitter-bash}/parser $out/libtree-sitter-bash.a + postPatch = '' + for file in tests/fixtures/*-expected.sh; do + substituteInPlace $file \ + --subst-var-by cc ${stdenv.cc} \ + --subst-var-by coreutils ${coreutils} \ + --subst-var-by custom ${custom} + done ''; meta = with lib; {