summary refs log tree commit diff
path: root/pkgs/development/libraries/glpk/default.nix
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2018-07-29 20:53:56 +0200
committerxeji <36407913+xeji@users.noreply.github.com>2018-07-29 20:53:56 +0200
commitae821e09e7c039d72ed633d345576c467cf4d712 (patch)
tree71a305ed44dad8b06dcbd67968fa95c53bb34ded /pkgs/development/libraries/glpk/default.nix
parent2791900608041a4557097d671856a3eb11655bf9 (diff)
downloadnixlib-ae821e09e7c039d72ed633d345576c467cf4d712.tar
nixlib-ae821e09e7c039d72ed633d345576c467cf4d712.tar.gz
nixlib-ae821e09e7c039d72ed633d345576c467cf4d712.tar.bz2
nixlib-ae821e09e7c039d72ed633d345576c467cf4d712.tar.lz
nixlib-ae821e09e7c039d72ed633d345576c467cf4d712.tar.xz
nixlib-ae821e09e7c039d72ed633d345576c467cf4d712.tar.zst
nixlib-ae821e09e7c039d72ed633d345576c467cf4d712.zip
glpk: adopt error recovery patch (#44201)
This makes it possible to use "vanilla" glpk for sage and shouldn't
affect anything else.
Diffstat (limited to 'pkgs/development/libraries/glpk/default.nix')
-rw-r--r--pkgs/development/libraries/glpk/default.nix21
1 files changed, 20 insertions, 1 deletions
diff --git a/pkgs/development/libraries/glpk/default.nix b/pkgs/development/libraries/glpk/default.nix
index 5b9296608d45..481ae32bdc61 100644
--- a/pkgs/development/libraries/glpk/default.nix
+++ b/pkgs/development/libraries/glpk/default.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetchurl
+, fetchpatch
 # Excerpt from glpk's INSTALL file:
 # This feature allows the exact simplex solver to use the GNU MP
 # bignum library. If it is disabled, the exact simplex solver uses the
@@ -28,6 +29,24 @@ stdenv.mkDerivation rec {
     "--with-gmp"
   ];
 
+  patches = [
+    # GLPK makes it possible to customize its message printing behaviour. Sage
+    # does that and needs to differentiate between printing regular messages and
+    # printing errors. Unfortunately there is no way to tell and glpk upstream
+    # rejected this patch. All it does is set the variable pointing to the error
+    # file back to NULL before glpk calls abort(). In sage's case, abort won't
+    # actually be called because the error handler jumps out of the function.
+    # This shouldn't affect everybody else, since glpk just calls abort()
+    # immediately afterwards anyways.
+    # See the sage trac ticket for more details:
+    # https://trac.sagemath.org/ticket/20710#comment:18
+    (fetchpatch {
+      name = "error_recovery.patch";
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/glpk/patches/error_recovery.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0z99z9gd31apb6x5n5n26411qzx0ma3s6dnznc4x61x86bhq31qf";
+    })
+  ];
+
   doCheck = true;
 
   meta = {
@@ -43,7 +62,7 @@ stdenv.mkDerivation rec {
     homepage = http://www.gnu.org/software/glpk/;
     license = stdenv.lib.licenses.gpl3Plus;
 
-    maintainers = with stdenv.lib.maintainers; [ bjg ];
+    maintainers = with stdenv.lib.maintainers; [ bjg timokau ];
     platforms = stdenv.lib.platforms.all;
   };
 }