2022-07-19 20:28:50 +00:00
|
|
|
{ lib, fetchurl, stdenv
|
|
|
|
, ocaml, findlib, ocamlbuild
|
2021-01-24 03:22:59 +00:00
|
|
|
, ctypes, mariadb, libmysqlclient }:
|
|
|
|
|
2022-07-19 20:28:50 +00:00
|
|
|
lib.throwIfNot (lib.versionAtLeast ocaml.version "4.07")
|
|
|
|
"mariadb is not available for OCaml ${ocaml.version}"
|
2021-01-24 03:22:59 +00:00
|
|
|
|
2022-07-19 20:28:50 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ocaml${ocaml.version}-mariadb";
|
|
|
|
version = "1.1.6";
|
2021-01-24 03:22:59 +00:00
|
|
|
|
2022-07-19 20:28:50 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/andrenth/ocaml-mariadb/releases/download/${version}/ocaml-mariadb-${version}.tar.gz";
|
|
|
|
sha256 = "sha256-3/C1Gz6luUzS7oaudLlDHMT6JB2v5OdbLVzJhtayHGM=";
|
2021-01-24 03:22:59 +00:00
|
|
|
};
|
|
|
|
|
2022-07-19 20:28:50 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild ];
|
2021-01-24 03:22:59 +00:00
|
|
|
buildInputs = [ mariadb libmysqlclient ];
|
|
|
|
propagatedBuildInputs = [ ctypes ];
|
|
|
|
|
2022-07-19 20:28:50 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
preInstall = "mkdir -p $OCAMLFIND_DESTDIR/stublibs";
|
|
|
|
|
2021-01-24 03:22:59 +00:00
|
|
|
meta = {
|
|
|
|
description = "OCaml bindings for MariaDB";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ bcc32 ];
|
|
|
|
homepage = "https://github.com/andrenth/ocaml-mariadb";
|
2022-07-19 20:28:50 +00:00
|
|
|
inherit (ocaml.meta) platforms;
|
2021-01-24 03:22:59 +00:00
|
|
|
};
|
|
|
|
}
|