From b03dc802e80b70e066aa70d25c0fd670cf615428 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Wed, 18 Sep 2024 18:34:03 -0300 Subject: [PATCH] less: adopt and rewrite - nixfmt-rfc-style - a better comment about source provenance - strictDeps - marking dtzWill as not active --- pkgs/by-name/le/less/package.nix | 42 +++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/le/less/package.nix b/pkgs/by-name/le/less/package.nix index 679bf278a6a5..ba57f5460ccd 100644 --- a/pkgs/by-name/le/less/package.nix +++ b/pkgs/by-name/le/less/package.nix @@ -1,17 +1,22 @@ -{ lib -, stdenv -, fetchurl -, ncurses -, pcre2 -, withSecure ? false +{ + lib, + fetchurl, + ncurses, + pcre2, + stdenv, + # Boolean options + withSecure ? false, }: stdenv.mkDerivation (finalAttrs: { pname = "less"; version = "668"; - # Only tarballs on the website are valid releases, - # other versions, e.g. git tags are considered snapshots. + # `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-KBn1VWTYbVQqu+yv2C/2HoGaPuyWf6o2zT5o8VlqRLg="; @@ -22,13 +27,18 @@ stdenv.mkDerivation (finalAttrs: { pcre2 ]; - outputs = [ "out" "man" ]; + outputs = [ + "out" + "man" + ]; configureFlags = [ - # Look for 'sysless' in /etc. - "--sysconfdir=/etc" - "--with-regex=pcre2" - ] ++ lib.optional withSecure "--with-secure"; + "--sysconfdir=/etc" # Look for 'sysless' in /etc + (lib.withFeatureAs true "regex" "pcre2") + (lib.withFeature withSecure "secure") + ]; + + strictDeps = true; meta = { homepage = "https://www.greenwoodsoftware.com/less/"; @@ -36,7 +46,11 @@ stdenv.mkDerivation (finalAttrs: { changelog = "https://www.greenwoodsoftware.com/less/news.${finalAttrs.version}.html"; license = lib.licenses.gpl3Plus; mainProgram = "less"; - maintainers = with lib.maintainers; [ dtzWill ]; + maintainers = with lib.maintainers; [ + AndersonTorres + # not active + dtzWill + ]; platforms = lib.platforms.unix; }; })