2023-09-10 12:25:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
makeWrapper,
|
|
|
|
perl,
|
|
|
|
procps,
|
|
|
|
bash,
|
|
|
|
|
|
|
|
# shell referenced dependencies
|
|
|
|
resholve,
|
|
|
|
binutils-unwrapped,
|
|
|
|
file,
|
|
|
|
gnugrep,
|
|
|
|
coreutils,
|
|
|
|
gnused,
|
|
|
|
gnutar,
|
|
|
|
iconv,
|
|
|
|
ncurses,
|
|
|
|
}:
|
2016-05-09 14:59:26 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-07-08 22:05:01 +00:00
|
|
|
pname = "lesspipe";
|
2023-12-13 18:20:38 +00:00
|
|
|
version = "2.11";
|
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-12-13 18:20:38 +00:00
|
|
|
hash = "sha256-jJrKiRdrargk0JzcPWxBZGyOpMfTIONHG8HNRecazVo=";
|
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 = ''
|
2023-09-10 12:25:02 +00:00
|
|
|
# resholve doesn't see strings in an array definition
|
|
|
|
substituteInPlace $out/bin/lesspipe.sh --replace 'nodash strings' "nodash ${binutils-unwrapped}/bin/strings"
|
|
|
|
|
|
|
|
${resholve.phraseSolution "lesspipe.sh" {
|
|
|
|
scripts = [ "bin/lesspipe.sh" ];
|
|
|
|
interpreter = "${bash}/bin/bash";
|
|
|
|
inputs = [
|
|
|
|
coreutils
|
|
|
|
file
|
|
|
|
gnugrep
|
|
|
|
gnused
|
|
|
|
gnutar
|
|
|
|
iconv
|
|
|
|
procps
|
|
|
|
ncurses
|
|
|
|
];
|
|
|
|
keep = [
|
|
|
|
"$prog"
|
|
|
|
"$c1"
|
|
|
|
"$c2"
|
|
|
|
"$c3"
|
|
|
|
"$c4"
|
|
|
|
"$c5"
|
|
|
|
"$cmd"
|
|
|
|
"$colorizer"
|
|
|
|
"$HOME"
|
|
|
|
];
|
|
|
|
fake = {
|
|
|
|
# script guards usage behind has_cmd test function, it's safe to leave these external and optional
|
|
|
|
external =
|
|
|
|
[
|
|
|
|
"cpio"
|
|
|
|
"isoinfo"
|
|
|
|
"cabextract"
|
|
|
|
"bsdtar"
|
|
|
|
"rpm2cpio"
|
|
|
|
"bsdtar"
|
|
|
|
"unzip"
|
|
|
|
"ar"
|
|
|
|
"unrar"
|
|
|
|
"rar"
|
|
|
|
"7zr"
|
|
|
|
"7za"
|
|
|
|
"isoinfo"
|
|
|
|
"gzip"
|
|
|
|
"bzip2"
|
|
|
|
"lzip"
|
|
|
|
"lzma"
|
|
|
|
"xz"
|
|
|
|
"brotli"
|
|
|
|
"compress"
|
|
|
|
"zstd"
|
|
|
|
"lz4"
|
|
|
|
"archive_color"
|
|
|
|
"bat"
|
|
|
|
"batcat"
|
|
|
|
"pygmentize"
|
|
|
|
"source-highlight"
|
|
|
|
"vimcolor"
|
|
|
|
"code2color"
|
|
|
|
|
|
|
|
"w3m"
|
|
|
|
"lynx"
|
|
|
|
"elinks"
|
|
|
|
"html2text"
|
|
|
|
"dtc"
|
|
|
|
"pdftotext"
|
|
|
|
"pdftohtml"
|
|
|
|
"pdfinfo"
|
|
|
|
"ps2ascii"
|
|
|
|
"procyon"
|
|
|
|
"ccze"
|
|
|
|
"mdcat"
|
|
|
|
"pandoc"
|
|
|
|
"docx2txt"
|
|
|
|
"libreoffice"
|
|
|
|
"pptx2md"
|
|
|
|
"mdcat"
|
|
|
|
"xlscat"
|
|
|
|
"odt2txt"
|
|
|
|
"wvText"
|
|
|
|
"antiword"
|
|
|
|
"catdoc"
|
|
|
|
"broken_catppt"
|
|
|
|
"sxw2txt"
|
|
|
|
"groff"
|
|
|
|
"mandoc"
|
|
|
|
"unrtf"
|
|
|
|
"dvi2tty"
|
|
|
|
"pod2text"
|
|
|
|
"perldoc"
|
|
|
|
"h5dump"
|
|
|
|
"ncdump"
|
|
|
|
"matdump"
|
|
|
|
"djvutxt"
|
|
|
|
"openssl"
|
|
|
|
"gpg"
|
|
|
|
"plistutil"
|
|
|
|
"plutil"
|
|
|
|
"id3v2"
|
|
|
|
"csvlook"
|
|
|
|
"jq"
|
|
|
|
"zlib-flate"
|
|
|
|
"lessfilter"
|
2024-06-07 16:14:12 +00:00
|
|
|
]
|
|
|
|
++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isFreeBSD) [
|
|
|
|
# resholve only identifies this on darwin/bsd
|
|
|
|
# call site is guarded by || so it's safe to leave dynamic
|
2023-09-10 12:25:02 +00:00
|
|
|
"locale"
|
|
|
|
];
|
|
|
|
builtin = [ "setopt" ];
|
|
|
|
};
|
|
|
|
execer = [
|
|
|
|
"cannot:${iconv}/bin/iconv"
|
|
|
|
];
|
|
|
|
}}
|
|
|
|
${resholve.phraseSolution "lesscomplete" {
|
|
|
|
scripts = [ "bin/lesscomplete" ];
|
|
|
|
interpreter = "${bash}/bin/bash";
|
|
|
|
inputs = [
|
|
|
|
coreutils
|
|
|
|
file
|
|
|
|
gnugrep
|
|
|
|
gnused
|
|
|
|
gnutar
|
|
|
|
];
|
|
|
|
keep = [
|
|
|
|
"$prog"
|
|
|
|
"$c1"
|
|
|
|
"$c2"
|
|
|
|
"$c3"
|
|
|
|
"$c4"
|
|
|
|
"$c5"
|
|
|
|
"$cmd"
|
|
|
|
];
|
|
|
|
fake = {
|
|
|
|
# script guards usage behind has_cmd test function, it's safe to leave these external and optional
|
|
|
|
external = [
|
|
|
|
"cpio"
|
|
|
|
"isoinfo"
|
|
|
|
"cabextract"
|
|
|
|
"bsdtar"
|
|
|
|
"rpm2cpio"
|
|
|
|
"bsdtar"
|
|
|
|
"unzip"
|
|
|
|
"ar"
|
|
|
|
"unrar"
|
|
|
|
"rar"
|
|
|
|
"7zr"
|
|
|
|
"7za"
|
|
|
|
"isoinfo"
|
|
|
|
"gzip"
|
|
|
|
"bzip2"
|
|
|
|
"lzip"
|
|
|
|
"lzma"
|
|
|
|
"xz"
|
|
|
|
"brotli"
|
|
|
|
"compress"
|
|
|
|
"zstd"
|
|
|
|
"lz4"
|
|
|
|
];
|
|
|
|
builtin = [ "setopt" ];
|
|
|
|
};
|
|
|
|
}}
|
2022-07-01 13:31:42 +00:00
|
|
|
'';
|
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 = "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;
|
2024-04-26 11:35:31 +00:00
|
|
|
license = licenses.gpl2Only;
|
2016-05-09 14:59:26 +00:00
|
|
|
maintainers = [ maintainers.martijnvermaat ];
|
|
|
|
};
|
|
|
|
}
|