2022-07-01 13:31:42 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, substituteAll, makeWrapper, perl, procps, file, gnused, bash }:
|
2016-05-09 14:59:26 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-07-08 22:05:01 +00:00
|
|
|
pname = "lesspipe";
|
2023-01-15 07:21:02 +00:00
|
|
|
version = "2.07";
|
2016-05-09 14:59:26 +00:00
|
|
|
|
2022-07-01 13:31:42 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wofr06";
|
|
|
|
repo = "lesspipe";
|
|
|
|
rev = "v${version}";
|
2023-01-15 07:21:02 +00:00
|
|
|
sha256 = "sha256-L39Prxs39Ku3jrQO/tOi2qGREFl7+W18WXTCcgoDkXU=";
|
2022-07-01 13:31:42 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ perl makeWrapper ];
|
2021-10-18 13:47:55 +00:00
|
|
|
buildInputs = [ perl bash ];
|
|
|
|
strictDeps = true;
|
2022-07-01 13:31:42 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2021-10-18 13:47:55 +00:00
|
|
|
patchShebangs --build configure
|
2022-07-01 13:31:42 +00:00
|
|
|
substituteInPlace configure --replace '/etc/bash_completion.d' '/share/bash-completion/completions'
|
2021-10-18 13:47:55 +00:00
|
|
|
'';
|
2022-07-01 13:31:42 +00:00
|
|
|
|
|
|
|
configureFlags = [ "--shell=${bash}/bin/bash" "--prefix=/" ];
|
|
|
|
configurePlatforms = [ ];
|
|
|
|
|
2021-10-18 13:47:55 +00:00
|
|
|
dontBuild = true;
|
2016-05-09 14:59:26 +00:00
|
|
|
|
2022-07-01 13:31:42 +00:00
|
|
|
installFlags = [ "DESTDIR=$(out)" ];
|
2016-05-09 14:59:26 +00:00
|
|
|
|
2022-07-01 13:31:42 +00:00
|
|
|
postInstall = ''
|
|
|
|
for f in lesspipe.sh lesscomplete; do
|
|
|
|
wrapProgram "$out/bin/$f" --prefix-each PATH : "${lib.makeBinPath [ file gnused procps ]}"
|
|
|
|
done
|
|
|
|
'';
|
2018-07-23 18:32:39 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-05-09 14:59:26 +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.
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/wofr06/lesspipe";
|
2016-05-09 14:59:26 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = [ maintainers.martijnvermaat ];
|
|
|
|
};
|
|
|
|
}
|