summary refs log tree commit diff
path: root/pkgs/development/pure-modules/glpk/default.nix
blob: a70dbbd047a28f21486b1a8d3615b148efc01141 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ lib, stdenv, fetchurl,
  pkgconfig, pure, glpk, gmp, libtool, libmysqlclient, libiodbc }:

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: {
    propagatedBuildInputs = [ gmp libtool libmysqlclient libiodbc ];

    CPPFLAGS = "-I${gmp.dev}/include";

    preConfigure = ''
      substituteInPlace configure \
        --replace /usr/include/mysql ${libmysqlclient}/include/mysql
    '';
    configureFlags = [ "--enable-dl"
                       "--enable-odbc"
                       "--enable-mysql"
                       "--with-gmp=yes" ];
  });

  nativeBuildInputs = [ pkgconfig ];
  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 ];
  };
}