1{
2 stdenv,
3 lib,
4 fetchurl,
5 fetchpatch,
6 ocaml,
7 findlib,
8 libmysqlclient,
9}:
10
11# TODO: la versione stabile da' un errore di compilazione dovuto a
12# qualche cambiamento negli header .h
13# TODO: compilazione di moduli dipendenti da zip, ssl, tcl, gtk, gtk2
14
15let
16 pname = "ocaml-mysql";
17in
18
19stdenv.mkDerivation rec {
20 name = "${pname}-${version}";
21 version = "1.2.1";
22
23 src = fetchurl {
24 url = "http://ygrek.org.ua/p/release/ocaml-mysql/${name}.tar.gz";
25 sha256 = "06mb2bq7v37wn0lza61917zqgb4bsg1xxb73myjyn88p6khl6yl2";
26 };
27
28 configureFlags = [
29 "--prefix=$out"
30 "--libdir=$out/lib/ocaml/${ocaml.version}/site-lib/mysql"
31 ];
32
33 nativeBuildInputs = [
34 ocaml
35 findlib
36 ];
37
38 createFindlibDestdir = true;
39
40 propagatedBuildInputs = [ libmysqlclient ];
41
42 strictDeps = true;
43
44 patches = [
45 (fetchpatch {
46 url = "https://github.com/ygrek/ocaml-mysql/compare/v1.2.1...d6d1b3b262ae2cf493ef56f1dd7afcf663a70a26.patch";
47 sha256 = "0018s2wcrvbsw9yaqmwq500qmikwffrgdp5xg9b8v7ixhd4gi6hn";
48 })
49 ];
50
51 meta = {
52 homepage = "http://ocaml-mysql.forge.ocamlcore.org";
53 description = "Bindings for interacting with MySQL databases from ocaml";
54 license = lib.licenses.lgpl21Plus;
55 maintainers = [ lib.maintainers.roconnor ];
56 };
57}