2015-06-17 23:37:09 +01:00
|
|
|
{ stdenv, fetchurl, ocaml, findlib, mysql, camlp4 }:
|
2010-12-31 17:48:55 +00:00
|
|
|
|
|
|
|
# TODO: la versione stabile da' un errore di compilazione dovuto a
|
|
|
|
# qualche cambiamento negli header .h
|
|
|
|
# TODO: compilazione di moduli dipendenti da zip, ssl, tcl, gtk, gtk2
|
|
|
|
|
|
|
|
let
|
|
|
|
ocaml_version = (builtins.parseDrvName ocaml.name).version;
|
|
|
|
pname = "ocaml-mysql";
|
2013-06-16 21:25:08 +01:00
|
|
|
version = "1.1.1";
|
2010-12-31 17:48:55 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2013-06-16 21:25:08 +01:00
|
|
|
url = "https://forge.ocamlcore.org/frs/download.php/870/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "f896fa101a05d81b85af8122fe1c2809008a5e5fdca00f9ceeb7eec356369e3a";
|
2010-12-31 17:48:55 +00:00
|
|
|
};
|
|
|
|
|
2013-06-16 21:25:08 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--prefix=$out"
|
|
|
|
"--libdir=$out/lib/ocaml/${ocaml_version}/site-lib/mysql"
|
|
|
|
];
|
|
|
|
|
2015-06-17 23:37:09 +01:00
|
|
|
buildInputs = [ocaml findlib mysql.lib camlp4 ];
|
2010-12-31 17:48:55 +00:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
2015-07-20 08:15:35 +01:00
|
|
|
propagatedBuildInputs = [ mysql.lib ];
|
2010-12-31 17:48:55 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
2015-04-02 00:39:50 +01:00
|
|
|
export LDFLAGS="-L${mysql.lib}/lib/mysql"
|
2010-12-31 17:48:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
make opt
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2013-06-16 21:25:08 +01:00
|
|
|
homepage = http://ocaml-mysql.forge.ocamlcore.org;
|
2010-12-31 17:48:55 +00:00
|
|
|
description = "Bindings for interacting with MySQL databases from ocaml";
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.lgpl21Plus;
|
2010-12-31 17:48:55 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.roconnor ];
|
|
|
|
};
|
|
|
|
}
|