Merge pull request #76194 from lilyball/bat

bat: insert less into PATH
This commit is contained in:
Maximilian Bosch 2019-12-23 02:54:16 +01:00 committed by GitHub
commit a69908f0db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
{ stdenv, rustPlatform, fetchFromGitHub, llvmPackages, pkgconfig
, Security, libiconv, installShellFiles
{ stdenv, rustPlatform, fetchFromGitHub, llvmPackages, pkgconfig, less
, Security, libiconv, installShellFiles, makeWrapper
}:
rustPlatform.buildRustPackage rec {
@ -16,7 +16,7 @@ rustPlatform.buildRustPackage rec {
cargoSha256 = "0d7h0kn41w6wm4w63vjy2i7r19jkansfvfjn7vgh2gqh5m60kal2";
nativeBuildInputs = [ pkgconfig llvmPackages.libclang installShellFiles ];
nativeBuildInputs = [ pkgconfig llvmPackages.libclang installShellFiles makeWrapper ];
buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Security libiconv ];
@ -27,6 +27,13 @@ rustPlatform.buildRustPackage rec {
installShellCompletion assets/completions/bat.fish
'';
# Insert Nix-built `less` into PATH because the system-provided one may be too old to behave as
# expected with certain flag combinations.
postFixup = ''
wrapProgram "$out/bin/bat" \
--prefix PATH : "${stdenv.lib.makeBinPath [ less ]}"
'';
meta = with stdenv.lib; {
description = "A cat(1) clone with syntax highlighting and Git integration";
homepage = https://github.com/sharkdp/bat;