2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper, perl, procps, file, gnused, bash }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "lesspipe";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.08";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wofr06";
|
|
|
|
repo = "lesspipe";
|
|
|
|
rev = "v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-jN8x5qd9zRr0bpjGYOWfFbiXbWSDDQ8CLZJo79fnegI=";
|
2022-07-14 12:49:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ perl makeWrapper ];
|
2021-10-17 09:34:42 +00:00
|
|
|
buildInputs = [ perl bash ];
|
|
|
|
strictDeps = true;
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2021-10-17 09:34:42 +00:00
|
|
|
patchShebangs --build configure
|
2022-07-14 12:49:19 +00:00
|
|
|
substituteInPlace configure --replace '/etc/bash_completion.d' '/share/bash-completion/completions'
|
2021-10-17 09:34:42 +00:00
|
|
|
'';
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
configureFlags = [ "--shell=${bash}/bin/bash" "--prefix=/" ];
|
|
|
|
configurePlatforms = [ ];
|
|
|
|
|
2021-10-17 09:34:42 +00:00
|
|
|
dontBuild = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
installFlags = [ "DESTDIR=$(out)" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
postInstall = ''
|
|
|
|
for f in lesspipe.sh lesscomplete; do
|
|
|
|
wrapProgram "$out/bin/$f" --prefix-each PATH : "${lib.makeBinPath [ file gnused procps ]}"
|
|
|
|
done
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A preprocessor for less";
|
|
|
|
longDescription = ''
|
|
|
|
Usually lesspipe.sh is called as an input filter to less. With the help
|
|
|
|
of that filter less will display the uncompressed contents of compressed
|
|
|
|
(gzip, bzip2, compress, rar, 7-zip, lzip, xz or lzma) files. For files
|
|
|
|
containing archives and directories, a table of contents will be
|
|
|
|
displayed (e.g tar, ar, rar, jar, rpm and deb formats). Other supported
|
|
|
|
formats include nroff, pdf, ps, dvi, shared library, MS word, OASIS
|
|
|
|
(e.g. Openoffice), NetCDF, html, mp3, jpg, png, iso images, MacOSX bom,
|
|
|
|
plist and archive formats, perl storable data and gpg encrypted files.
|
|
|
|
This does require additional helper programs being installed.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/wofr06/lesspipe";
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.martijnvermaat ];
|
|
|
|
};
|
|
|
|
}
|