git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #90697 from lilyball/bat-extras

bat-extras: 20200408 -> 20200515-dev

commitee11fe8d63287e52f02d0e6997cb37d19a26cf2b authorMaximilian Bosch <maximilian@mbosch.me> dateThu 18 Jun 2020, 01:34 (6 years ago) parent58e6a3b1894b5a
1 file changed+20−22
pkgs/tools/misc/bat-extras/default.nix+20−22
pkgs/tools/misc/bat-extras/default.nix+20−22
@@ -1,5 +1,6 @@
1−{ stdenv, callPackage, fetchFromGitHub, bash, makeWrapper, ncurses, bat
2−# batgrep and batwatch
1+{ stdenv, callPackage, fetchFromGitHub, bash, makeWrapper, bat
2+# batdiff, batgrep, and batwatch
3+, coreutils
34, less
45# batgrep
56, ripgrep
@@ -10,34 +11,35 @@
1011, withRustFmt ? rustfmt != null, rustfmt ? null
1112# batwatch
1213, withEntr ? entr != null, entr ? null
13− }:
14+# batdiff
15+, gitMinimal
16+, withDelta ? gitAndTools?delta, gitAndTools ? null
17+}:
1418
1519let
1620 # Core derivation that all the others are based on.
1721 # This includes the complete source so the per-script derivations can run the tests.
1822 core = stdenv.mkDerivation rec {
1923 pname = "bat-extras";
20− version = "20200408";
24+ # there hasn't been a release since 2020-05-01 but there are important bugfixes
25+ # to the test suite so we'll pull the latest commit as of 2020-06-17.
26+ version = "20200515-dev"; # latest commit was dated 2020-05-15
2127
2228 src = fetchFromGitHub {
2329 owner = "eth-p";
2430 repo = pname;
25− rev = "v${version}";
26− sha256 = "184d5rwasfpgbj2k98alg3wy8jmzna2dgfik98w2a297ky67s51v";
31+ rev = "3029b6749f61f7514e9eef30e035cfab0e31eb1d";
32+ sha256 = "08mb94k2n182ql97c5s5j1v7np25ivynn5g0418whrx11ra41wr7";
2733 fetchSubmodules = true;
2834 };
2935
30− nativeBuildInputs = [ bash makeWrapper ];
36+ # bat needs to be in the PATH during building so EXECUTABLE_BAT picks it up
37+ nativeBuildInputs = [ bash bat ];
3138
3239 dontConfigure = true;
3340
3441 postPatch = ''
35− substituteInPlace lib/constants.sh \
36− --replace 'EXECUTABLE_BAT="bat"' 'EXECUTABLE_BAT="${bat}/bin/bat"'
37−
3842 patchShebangs --build test.sh test/shimexec .test-framework/bin/best.sh
39− wrapProgram .test-framework/bin/best.sh \
40− --prefix PATH : "${ncurses}/bin"
4143 '';
4244
4345 buildPhase = ''
@@ -131,17 +133,13 @@ let
131133 stdenv.lib.optional cond dep;
132134in
133135{
134− batgrep = script "batgrep" [ less ripgrep ];
135− batman = (script "batman" []).overrideAttrs (drv: {
136− doCheck = stdenv.isDarwin; # test fails on Linux due to SIGPIPE (eth-p/bat-extras#19)
137− });
138− batwatch = script "batwatch" ([ less ] ++ optionalDep withEntr entr);
139− prettybat = (script "prettybat" ([]
136+ batdiff = script "batdiff" ([ less coreutils gitMinimal ] ++ optionalDep withDelta gitAndTools.delta);
137+ batgrep = script "batgrep" [ less coreutils ripgrep ];
138+ batman = script "batman" [];
139+ batwatch = script "batwatch" ([ less coreutils ] ++ optionalDep withEntr entr);
140+ prettybat = script "prettybat" ([]
140141 ++ optionalDep withShFmt shfmt
141142 ++ optionalDep withPrettier nodePackages.prettier
142143 ++ optionalDep withClangTools clang-tools
143− ++ optionalDep withRustFmt rustfmt)
144− ).overrideAttrs (drv: {
145− doCheck = stdenv.isDarwin; # test fails on Linux due to SIGPIPE (eth-p/bat-extras#19)
146− });
144+ ++ optionalDep withRustFmt rustfmt);
147145}