lol
at 24.11-pre 49 lines 1.6 kB view raw
1{ lib, fetchurl, stdenv 2, fetchpatch 3, ocaml, findlib, ocamlbuild, camlp-streams 4, ctypes, mariadb, libmysqlclient }: 5 6lib.throwIfNot (lib.versionAtLeast ocaml.version "4.07") 7 "mariadb is not available for OCaml ${ocaml.version}" 8 9stdenv.mkDerivation rec { 10 pname = "ocaml${ocaml.version}-mariadb"; 11 version = "1.1.6"; 12 13 src = fetchurl { 14 url = "https://github.com/andrenth/ocaml-mariadb/releases/download/${version}/ocaml-mariadb-${version}.tar.gz"; 15 sha256 = "sha256-3/C1Gz6luUzS7oaudLlDHMT6JB2v5OdbLVzJhtayHGM="; 16 }; 17 18 patches = lib.lists.map (x: 19 fetchpatch { 20 url = "https://github.com/andrenth/ocaml-mariadb/commit/${x.path}.patch"; 21 inherit (x) hash; 22 }) 23 [ { path = "9db2e4d8dec7c584213d0e0f03d079a36a35d9d5"; 24 hash = "sha256-heROtU02cYBJ5edIHMdYP1xNXcLv8h79GYGBuudJhgE="; } 25 { path = "40cd3102bc7cce4ed826ed609464daeb1bbb4581"; 26 hash = "sha256-YVsAMJiOgWRk9xPaRz2sDihBYLlXv+rhWtQIMOVLtSg="; } 27 ]; 28 29 postPatch = '' 30 substituteInPlace setup.ml --replace '#use "topfind"' \ 31 '#directory "${findlib}/lib/ocaml/${ocaml.version}/site-lib/";; #use "topfind"' 32 ''; 33 34 nativeBuildInputs = [ ocaml findlib ocamlbuild ]; 35 buildInputs = [ mariadb libmysqlclient camlp-streams ocamlbuild ]; 36 propagatedBuildInputs = [ ctypes ]; 37 38 strictDeps = true; 39 40 preInstall = "mkdir -p $OCAMLFIND_DESTDIR/stublibs"; 41 42 meta = { 43 description = "OCaml bindings for MariaDB"; 44 license = lib.licenses.mit; 45 maintainers = with lib.maintainers; [ bcc32 ]; 46 homepage = "https://github.com/andrenth/ocaml-mariadb"; 47 inherit (ocaml.meta) platforms; 48 }; 49}