2015-05-26 07:58:18 +01:00
|
|
|
{ lib, stdenv, fetchurl,
|
2018-07-21 01:44:44 +01:00
|
|
|
pkgconfig, pure, glpk, gmp, libtool, mysql, libiodbc }:
|
2015-05-26 07:58:18 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
baseName = "glpk";
|
|
|
|
version = "0.5";
|
|
|
|
name = "pure-${baseName}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://bitbucket.org/purelang/pure-lang/downloads/${name}.tar.gz";
|
|
|
|
sha256 = "5d6dc11706985dda02d96d481ea5f164c9e95ee446432fc4fc3d0db61a076346";
|
|
|
|
};
|
|
|
|
|
|
|
|
glpkWithExtras = lib.overrideDerivation glpk (attrs: {
|
2017-12-22 16:12:05 +00:00
|
|
|
propagatedBuildInputs = [ gmp libtool mysql.connector-c libiodbc ];
|
2015-05-26 07:58:18 +01:00
|
|
|
|
2016-09-10 16:36:59 +01:00
|
|
|
CPPFLAGS = "-I${gmp.dev}/include";
|
|
|
|
|
2015-05-26 07:58:18 +01:00
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace configure \
|
2017-12-27 16:00:39 +00:00
|
|
|
--replace /usr/include/mysql ${mysql.connector-c}/include/mysql
|
2015-05-26 07:58:18 +01:00
|
|
|
'';
|
|
|
|
configureFlags = [ "--enable-dl"
|
|
|
|
"--enable-odbc"
|
|
|
|
"--enable-mysql"
|
|
|
|
"--with-gmp=yes" ];
|
|
|
|
});
|
|
|
|
|
2017-08-14 21:39:03 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2015-05-26 07:58:18 +01:00
|
|
|
propagatedBuildInputs = [ pure glpkWithExtras ];
|
|
|
|
makeFlags = "libdir=$(out)/lib prefix=$(out)/";
|
|
|
|
setupHook = ../generic-setup-hook.sh;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "GLPK interface for the Pure Programming Language";
|
|
|
|
homepage = http://puredocs.bitbucket.org/pure-glpk.html;
|
|
|
|
license = stdenv.lib.licenses.gpl3Plus;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ asppsa ];
|
|
|
|
};
|
|
|
|
}
|