2023-02-09 11:40:11 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
|
|
|
|
, fetchurl
|
|
|
|
|
, fetchpatch
|
|
|
|
|
, ncurses
|
|
|
|
|
, pcre2
|
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "less";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
version = "608";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
|
# Only tarballs on the website are valid releases,
|
|
|
|
|
# other versions, e.g. git tags are considered snapshots.
|
2020-04-24 23:36:52 +00:00
|
|
|
|
src = fetchurl {
|
2022-01-22 01:22:15 +00:00
|
|
|
|
url = "https://www.greenwoodsoftware.com/less/less-${version}.tar.gz";
|
2023-02-09 11:40:11 +00:00
|
|
|
|
hash = "sha256-ppq+LgoSZ3fgIdO3OqMiLhsmHxDmRiTUHsB5aFpqwgk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
|
patches = [
|
|
|
|
|
(fetchpatch {
|
|
|
|
|
# https://github.com/advisories/GHSA-5xw7-xf7p-gm82
|
|
|
|
|
name = "CVE-2022-46663.patch";
|
|
|
|
|
url = "https://github.com/gwsw/less/commit/a78e1351113cef564d790a730d657a321624d79c.patch";
|
|
|
|
|
hash = "sha256-gWgCzoMt1WyVJVKYzkMq8HfaTlU1XUtC8fvNFUQT0sI=";
|
|
|
|
|
})
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
|
configureFlags = [
|
|
|
|
|
# Look for ‘sysless’ in /etc.
|
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
|
"--with-regex=pcre2"
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
|
ncurses
|
|
|
|
|
pcre2
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
|
meta = with lib; {
|
2021-06-28 23:13:55 +00:00
|
|
|
|
homepage = "https://www.greenwoodsoftware.com/less/";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "A more advanced file pager than ‘more’";
|
|
|
|
|
platforms = platforms.unix;
|
2021-08-05 21:33:18 +00:00
|
|
|
|
license = licenses.gpl3Plus;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
maintainers = with maintainers; [ eelco dtzWill ];
|
|
|
|
|
};
|
|
|
|
|
}
|