glpk: Add gmp support

This commit is contained in:
Timo Kaufmann 2018-04-23 21:13:25 +02:00
parent 7c3dc2f53f
commit 5e548e94e8

View File

@ -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 { stdenv.mkDerivation rec {
name = "glpk-4.65"; version = "4.65";
name = "glpk-${version}";
src = fetchurl { src = fetchurl {
url = "mirror://gnu/glpk/${name}.tar.gz"; url = "mirror://gnu/glpk/${name}.tar.gz";
sha256 = "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2"; sha256 = "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2";
}; };
buildInputs = stdenv.lib.optionals withGmp [
gmp
];
configureFlags = stdenv.lib.optionals withGmp [
"--with-gmp"
];
doCheck = true; doCheck = true;
meta = { meta = {
@ -23,7 +43,7 @@ stdenv.mkDerivation rec {
homepage = http://www.gnu.org/software/glpk/; homepage = http://www.gnu.org/software/glpk/;
license = stdenv.lib.licenses.gpl3Plus; license = stdenv.lib.licenses.gpl3Plus;
maintainers = [ stdenv.lib.maintainers.bjg ]; maintainers = with stdenv.lib.maintainers; [ bjg ];
platforms = stdenv.lib.platforms.all; platforms = stdenv.lib.platforms.all;
}; };
} }