nixpkgs/pkgs/by-name/le/less/package.nix
2025-06-22 17:42:21 +05:30

64 lines
1.4 KiB
Nix

{
lib,
fetchurl,
fetchpatch,
ncurses,
pcre2,
stdenv,
versionCheckHook,
# Boolean options
withSecure ? false,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "less";
version = "679";
# `less` is provided by the following sources:
# - meta.homepage
# - GitHub: https://github.com/gwsw/less/
# The releases recommended for general consumption are only those from
# homepage, and only those not marked as beta.
src = fetchurl {
url = "https://www.greenwoodsoftware.com/less/less-${finalAttrs.version}.tar.gz";
hash = "sha256-m2iCDDT6igr2sOAbdPApi83UCgSJxhZJtHBYkIoVPXg=";
};
buildInputs = [
ncurses
pcre2
];
outputs = [
"out"
"man"
];
configureFlags = [
"--sysconfdir=/etc" # Look for 'sysless' in /etc
(lib.withFeatureAs true "regex" "pcre2")
(lib.withFeature withSecure "secure")
];
strictDeps = true;
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = "--version";
doInstallCheck = true;
meta = {
homepage = "https://www.greenwoodsoftware.com/less/";
description = "More advanced file pager than 'more'";
changelog = "https://www.greenwoodsoftware.com/less/news.${finalAttrs.version}.html";
license = lib.licenses.gpl3Plus;
mainProgram = "less";
maintainers = with lib.maintainers; [
# not active
dtzWill
];
platforms = lib.platforms.unix;
};
})