summary refs log tree commit diff
path: root/pkgs/development/libraries/glpk
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2018-04-23 21:13:25 +0200
committerTimo Kaufmann <timokau@zoho.com>2018-04-23 21:13:42 +0200
commit5e548e94e805794d76402d90bc0dc7e887dde8c9 (patch)
tree467b3ed033d85f28950f5f00076e6dcf594771a8 /pkgs/development/libraries/glpk
parent7c3dc2f53fc837be79426f11c9133f73d15a05c4 (diff)
downloadnixpkgs-5e548e94e805794d76402d90bc0dc7e887dde8c9.tar
nixpkgs-5e548e94e805794d76402d90bc0dc7e887dde8c9.tar.gz
nixpkgs-5e548e94e805794d76402d90bc0dc7e887dde8c9.tar.bz2
nixpkgs-5e548e94e805794d76402d90bc0dc7e887dde8c9.tar.lz
nixpkgs-5e548e94e805794d76402d90bc0dc7e887dde8c9.tar.xz
nixpkgs-5e548e94e805794d76402d90bc0dc7e887dde8c9.tar.zst
nixpkgs-5e548e94e805794d76402d90bc0dc7e887dde8c9.zip
glpk: Add gmp support
Diffstat (limited to 'pkgs/development/libraries/glpk')
-rw-r--r--pkgs/development/libraries/glpk/default.nix26
1 files changed, 23 insertions, 3 deletions
diff --git a/pkgs/development/libraries/glpk/default.nix b/pkgs/development/libraries/glpk/default.nix
index b9634e01900..5b9296608d4 100644
--- a/pkgs/development/libraries/glpk/default.nix
+++ b/pkgs/development/libraries/glpk/default.nix
@@ -1,13 +1,33 @@
-{ fetchurl, stdenv }:
+{ stdenv
+, fetchurl
+# 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
+# GLPK bignum module, which provides the same functionality as GNU MP,
+# however, it is much less efficient.
+, withGmp ? true
+, gmp
+}:
+
+assert withGmp -> gmp != null;
 
 stdenv.mkDerivation rec {
-  name = "glpk-4.65";
+  version = "4.65";
+  name = "glpk-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/glpk/${name}.tar.gz";
     sha256 = "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2";
   };
 
+  buildInputs = stdenv.lib.optionals withGmp [
+    gmp
+  ];
+
+  configureFlags = stdenv.lib.optionals withGmp [
+    "--with-gmp"
+  ];
+
   doCheck = true;
 
   meta = {
@@ -23,7 +43,7 @@ stdenv.mkDerivation rec {
     homepage = http://www.gnu.org/software/glpk/;
     license = stdenv.lib.licenses.gpl3Plus;
 
-    maintainers = [ stdenv.lib.maintainers.bjg ];
+    maintainers = with stdenv.lib.maintainers; [ bjg ];
     platforms = stdenv.lib.platforms.all;
   };
 }