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