nixpkgs/pkgs/tools/misc/gavin-bc/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

47 lines
1.4 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitea
2023-02-12 22:03:44 +01:00
, editline
, readline
, historyType ? "internal"
, predefinedBuildType ? "BSD"
}:
2023-02-12 22:03:44 +01:00
assert lib.elem historyType [ "editline" "readline" "internal" ];
2023-04-17 01:35:50 +02:00
assert lib.elem predefinedBuildType [ "BSD" "GNU" "GDH" "DBG" "" ];
2023-04-16 23:17:39 +02:00
stdenv.mkDerivation (finalAttrs: {
pname = "gavin-bc";
2023-04-17 01:35:50 +02:00
version = "6.5.0";
src = fetchFromGitea {
domain = "git.gavinhoward.com";
owner = "gavin";
repo = "bc";
2023-04-16 23:17:39 +02:00
rev = finalAttrs.version;
2023-04-17 01:35:50 +02:00
hash = "sha256-V0L5OmpcI0Zu5JvESjuhp4wEs5Bu/CvjF6B5WllTEqo=";
};
2023-02-12 22:03:44 +01:00
buildInputs =
(lib.optional (historyType == "editline") editline)
++ (lib.optional (historyType == "readline") readline);
configureFlags = [
"--disable-nls"
]
2023-04-17 01:35:50 +02:00
++ (lib.optional (predefinedBuildType != "") "--predefined-build-type=${predefinedBuildType}")
2023-02-12 22:03:44 +01:00
++ (lib.optional (historyType == "editline") "--enable-editline")
2023-04-17 01:35:50 +02:00
++ (lib.optional (historyType == "readline") "--enable-readline")
++ (lib.optional (historyType == "internal") "--enable-internal-history");
2023-02-12 22:03:44 +01:00
meta = {
homepage = "https://git.gavinhoward.com/gavin/bc";
description = "Gavin Howard's BC calculator implementation";
2023-04-17 00:53:00 +02:00
changelog = "https://git.gavinhoward.com/gavin/bc/raw/tag/${finalAttrs.version}/NEWS.md";
license = lib.licenses.bsd2;
maintainers = [ lib.maintainers.AndersonTorres ];
platforms = lib.platforms.unix;
2023-02-12 23:38:54 +01:00
broken = stdenv.isDarwin;
};
})
2023-04-17 01:35:50 +02:00
# TODO: cover most of configure settings