From 07aef611d4c977d11655d5f2b49cc8b057e44fbc Mon Sep 17 00:00:00 2001 From: Thierry Delafontaine Date: Thu, 2 Oct 2025 17:26:50 +0200 Subject: [PATCH] gavin-bc: 6.5.0 -> 7.1.0 https://github.com/gavinhoward/bc/blob/7.1.0/NEWS.md - remove configure options; users which want to adjust these should use `overrideAttrs` - fetch source from GitHub (for the time being gavin has moved the sources there) - added `versionCheckHook` - added default update script - update homepage and changelog accordingly - added delafthi as maintainer - remove darwin from the broken platforms --- pkgs/by-name/ga/gavin-bc/package.nix | 52 ++++++++-------------------- 1 file changed, 14 insertions(+), 38 deletions(-) diff --git a/pkgs/by-name/ga/gavin-bc/package.nix b/pkgs/by-name/ga/gavin-bc/package.nix index fe884ea4bf3b..a9ef151d2908 100644 --- a/pkgs/by-name/ga/gavin-bc/package.nix +++ b/pkgs/by-name/ga/gavin-bc/package.nix @@ -1,57 +1,33 @@ { lib, stdenv, - fetchFromGitea, - editline, - readline, - historyType ? "internal", - predefinedBuildType ? "BSD", + fetchFromGitHub, + nix-update-script, + versionCheckHook, }: - -assert lib.elem historyType [ - "editline" - "readline" - "internal" -]; -assert lib.elem predefinedBuildType [ - "BSD" - "GNU" - "GDH" - "DBG" - "" -]; stdenv.mkDerivation (finalAttrs: { pname = "gavin-bc"; - version = "6.5.0"; + version = "7.1.0"; - src = fetchFromGitea { - domain = "git.gavinhoward.com"; - owner = "gavin"; + src = fetchFromGitHub { + owner = "gavinhoward"; repo = "bc"; rev = finalAttrs.version; - hash = "sha256-V0L5OmpcI0Zu5JvESjuhp4wEs5Bu/CvjF6B5WllTEqo="; + hash = "sha256-bIQk0HzUzL1Ju4+iDpFj1n+GKCj9a3AUAbYA3yX5TNg="; }; - buildInputs = - (lib.optional (historyType == "editline") editline) - ++ (lib.optional (historyType == "readline") readline); + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgram = "${placeholder "out"}/bin/bc"; + doInstallCheck = true; - configureFlags = [ - "--disable-nls" - ] - ++ (lib.optional (predefinedBuildType != "") "--predefined-build-type=${predefinedBuildType}") - ++ (lib.optional (historyType == "editline") "--enable-editline") - ++ (lib.optional (historyType == "readline") "--enable-readline") - ++ (lib.optional (historyType == "internal") "--enable-internal-history"); + passthru.updateScript = nix-update-script { }; meta = { - homepage = "https://git.gavinhoward.com/gavin/bc"; + homepage = "https://github.com/gavinhoward/bc"; description = "Gavin Howard's BC calculator implementation"; - changelog = "https://git.gavinhoward.com/gavin/bc/raw/tag/${finalAttrs.version}/NEWS.md"; + changelog = "https://github.com/gavinhoward/bc/blob/${finalAttrs.version}/NEWS.md"; license = lib.licenses.bsd2; - maintainers = [ ]; + maintainers = with lib.maintainers; [ delafthi ]; platforms = lib.platforms.unix; - broken = stdenv.hostPlatform.isDarwin; }; }) -# TODO: cover most of configure settings