1{ lib, stdenv, fetchurl,
2 pkgconfig, pure, glpk, gmp, libtool, libmysql, libiodbc, zlib }:
3
4stdenv.mkDerivation rec {
5 baseName = "glpk";
6 version = "0.5";
7 name = "pure-${baseName}-${version}";
8
9 src = fetchurl {
10 url = "https://bitbucket.org/purelang/pure-lang/downloads/${name}.tar.gz";
11 sha256 = "5d6dc11706985dda02d96d481ea5f164c9e95ee446432fc4fc3d0db61a076346";
12 };
13
14 glpkWithExtras = lib.overrideDerivation glpk (attrs: {
15 propagatedNativeBuildInputs = [ gmp libtool libmysql libiodbc ];
16
17 preConfigure = ''
18 substituteInPlace configure \
19 --replace /usr/include/mysql ${libmysql}/include/mysql
20 '';
21 configureFlags = [ "--enable-dl"
22 "--enable-odbc"
23 "--enable-mysql"
24 "--with-gmp=yes" ];
25 });
26
27 buildInputs = [ pkgconfig ];
28 propagatedBuildInputs = [ pure glpkWithExtras ];
29 makeFlags = "libdir=$(out)/lib prefix=$(out)/";
30 setupHook = ../generic-setup-hook.sh;
31
32 meta = {
33 description = "GLPK interface for the Pure Programming Language";
34 homepage = http://puredocs.bitbucket.org/pure-glpk.html;
35 license = stdenv.lib.licenses.gpl3Plus;
36 platforms = stdenv.lib.platforms.linux;
37 maintainers = with stdenv.lib.maintainers; [ asppsa ];
38 };
39}