summary refs log tree commit diff
path: root/pkgs/applications/science/math/symmetrica/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science/math/symmetrica/default.nix')
-rw-r--r--pkgs/applications/science/math/symmetrica/default.nix23
1 files changed, 20 insertions, 3 deletions
diff --git a/pkgs/applications/science/math/symmetrica/default.nix b/pkgs/applications/science/math/symmetrica/default.nix
index a7212299aa63..6123fd7306d9 100644
--- a/pkgs/applications/science/math/symmetrica/default.nix
+++ b/pkgs/applications/science/math/symmetrica/default.nix
@@ -1,14 +1,15 @@
-{stdenv, fetchurl}:
+{ stdenv
+, fetchurl
+, fetchpatch
+}:
 stdenv.mkDerivation rec {
   name = "symmetrica-${version}";
   version = "2.0";
-  # or fetchFromGitHub(owner,repo,rev) or fetchgit(rev)
   src = fetchurl {
     url = "http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/SYM2_0_tar.gz";
     sha256 = "1qhfrbd5ybb0sinl9pad64rscr08qvlfzrzmi4p4hk61xn6phlmz";
     name = "symmetrica-2.0.tar.gz";
   };
-  buildInputs = [];
   sourceRoot = ".";
   installPhase = ''
     mkdir -p "$out"/{lib,share/doc/symmetrica,include/symmetrica}
@@ -18,6 +19,22 @@ stdenv.mkDerivation rec {
     cp *.h "$out/include/symmetrica"
     cp README *.doc "$out/share/doc/symmetrica"
   '';
+  patches = [
+      # don't show banner ("SYMMETRICA VERSION X - STARTING)
+      # it doesn't contain very much helpful information and a banner is not ideal for a library
+      (fetchpatch {
+        url = "https://git.sagemath.org/sage.git/plain/build/pkgs/symmetrica/patches/de.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+        sha256 = "0df0vqixcfpzny6dkhyj87h8aznz3xn3zfwwlj8pd10bpb90k6gb";
+      })
+
+      # use int32_t and uint32_t for type INT
+      # see https://trac.sagemath.org/ticket/13413
+      (fetchpatch {
+        name = "fix_64bit_integer_overflow.patch";
+        url = "https://git.sagemath.org/sage.git/plain/build/pkgs/symmetrica/patches/int32.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+        sha256 = "0p33c85ck4kd453z687ni4bdcqr1pqx2756j7aq11bf63vjz4cyz";
+      })
+  ];
   meta = {
     inherit version;
     description = ''A collection of routines for representation theory and combinatorics'';