about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/math/eigenmath/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science/math/eigenmath/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/science/math/eigenmath/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/math/eigenmath/default.nix b/nixpkgs/pkgs/applications/science/math/eigenmath/default.nix
new file mode 100644
index 000000000000..358e491b2f4a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/eigenmath/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, buildPackages
+, unstableGitUpdater
+}:
+
+stdenv.mkDerivation rec {
+  pname = "eigenmath";
+  version = "unstable-2024-03-20";
+
+  src = fetchFromGitHub {
+    owner = "georgeweigt";
+    repo = pname;
+    rev = "262a6525225be7bcef52c3072b1061db3c238055";
+    hash = "sha256-QH8mLlcCOuq77vLer8RsSnD9VeJu9kAVv2qWAH3ky6I=";
+  };
+
+  checkPhase = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
+    runHook preCheck
+
+    for testcase in selftest1 selftest2; do
+      ${emulator} ./eigenmath "test/$testcase"
+    done
+
+    runHook postCheck
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm555 eigenmath "$out/bin/eigenmath"
+    runHook postInstall
+  '';
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = unstableGitUpdater { };
+  };
+
+  meta = with lib;{
+    description = "Computer algebra system written in C";
+    mainProgram = "eigenmath";
+    homepage = "https://georgeweigt.github.io";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ nickcao ];
+    platforms = platforms.unix;
+  };
+}