hred: convert to finalAttrs, add binlore

+8 -6
+8 -6
pkgs/by-name/hr/hred/package.nix
··· 3 buildNpmPackage, 4 fetchFromGitHub, 5 runCommand, 6 - hred, 7 jq, 8 }: 9 10 - buildNpmPackage rec { 11 pname = "hred"; 12 version = "1.5.1"; 13 14 src = fetchFromGitHub { 15 owner = "danburzo"; 16 repo = "hred"; 17 - rev = "v${version}"; 18 hash = "sha256-+0+WQRI8rdIMbPN0eBUdsWUMWDCxZhTRLiFo1WRd2xc="; 19 }; 20 ··· 23 dontNpmBuild = true; 24 25 passthru.tests = { 26 - simple = runCommand "${pname}-test" { } '' 27 set -e -o pipefail 28 - echo '<i id="foo">bar</i>' | ${hred}/bin/hred 'i#foo { @id => id, @.textContent => text }' -c | ${jq}/bin/jq -c > $out 29 [ "$(cat $out)" = '{"id":"foo","text":"bar"}' ] 30 ''; 31 }; 32 33 meta = { 34 description = "Command-line tool to extract data from HTML"; 35 mainProgram = "hred"; ··· 37 homepage = "https://github.com/danburzo/hred"; 38 maintainers = with lib.maintainers; [ tejing ]; 39 }; 40 - }
··· 3 buildNpmPackage, 4 fetchFromGitHub, 5 runCommand, 6 jq, 7 + binlore, 8 }: 9 10 + buildNpmPackage (finalAttrs: { 11 pname = "hred"; 12 version = "1.5.1"; 13 14 src = fetchFromGitHub { 15 owner = "danburzo"; 16 repo = "hred"; 17 + rev = "v${finalAttrs.version}"; 18 hash = "sha256-+0+WQRI8rdIMbPN0eBUdsWUMWDCxZhTRLiFo1WRd2xc="; 19 }; 20 ··· 23 dontNpmBuild = true; 24 25 passthru.tests = { 26 + simple = runCommand "hred-test" { } '' 27 set -e -o pipefail 28 + echo '<i id="foo">bar</i>' | ${finalAttrs.finalPackage}/bin/hred 'i#foo { @id => id, @.textContent => text }' -c | ${jq}/bin/jq -c > $out 29 [ "$(cat $out)" = '{"id":"foo","text":"bar"}' ] 30 ''; 31 }; 32 33 + passthru.binlore.out = binlore.synthesize finalAttrs.finalPackage "execer cannot bin/hred"; 34 + 35 meta = { 36 description = "Command-line tool to extract data from HTML"; 37 mainProgram = "hred"; ··· 39 homepage = "https://github.com/danburzo/hred"; 40 maintainers = with lib.maintainers; [ tejing ]; 41 }; 42 + })