about summary refs log tree commit diff
path: root/pkgs/tools/misc
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2023-02-20 21:23:13 -0300
committerGitHub <noreply@github.com>2023-02-20 21:23:13 -0300
commita22eedee79e91f70ae209bbaf515274b82aadcec (patch)
tree42c21f84bf29f8317dd7a26402ddc8f47f5d751f /pkgs/tools/misc
parentf0ee3b1a2e3d6d534f3aeefab4d4bafa18b6f628 (diff)
parentd37bd519ba0dffd075dfd4b67b5caec0d020ef0f (diff)
Merge pull request #216417 from atorres1985-contrib/gavin-bc
gavin-bc: new package
Diffstat (limited to 'pkgs/tools/misc')
-rw-r--r--pkgs/tools/misc/gavin-bc/default.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/pkgs/tools/misc/gavin-bc/default.nix b/pkgs/tools/misc/gavin-bc/default.nix
new file mode 100644
index 0000000000000..ade42a7d0d3a8
--- /dev/null
+++ b/pkgs/tools/misc/gavin-bc/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, stdenv
+, fetchFromGitea
+, editline
+, readline
+, historyType ? "internal"
+, predefinedBuildType ? "BSD"
+}:
+
+assert lib.elem historyType [ "editline" "readline" "internal" ];
+assert lib.elem predefinedBuildType [ "BSD" "GNU" "GDH" "DBG" ];
+stdenv.mkDerivation (self: {
+  pname = "gavin-bc";
+  version = "6.2.4";
+
+  src = fetchFromGitea {
+    domain = "git.gavinhoward.com";
+    owner = "gavin";
+    repo = "bc";
+    rev = self.version;
+    hash = "sha256-KQheSyBbxh2ROOvwt/gqhJM+qWc+gDS/x4fD6QIYUWw=";
+  };
+
+  buildInputs =
+    (lib.optional (historyType == "editline") editline)
+    ++ (lib.optional (historyType == "readline") readline);
+
+  configureFlags = [
+    "--disable-nls"
+    "--predefined-build-type=${historyType}"
+  ]
+  ++ (lib.optional (historyType == "editline") "--enable-editline")
+  ++ (lib.optional (historyType == "readline") "--enable-readline");
+
+  meta = {
+    homepage = "https://git.gavinhoward.com/gavin/bc";
+    description = "Gavin Howard's BC calculator implementation";
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.AndersonTorres ];
+    platforms = lib.platforms.unix;
+    broken = stdenv.isDarwin;
+  };
+})