diff --git a/pkgs/development/ocaml-modules/pgocaml/default.nix b/pkgs/development/ocaml-modules/pgocaml/default.nix index cf3cd3272a8..8896675f63c 100644 --- a/pkgs/development/ocaml-modules/pgocaml/default.nix +++ b/pkgs/development/ocaml-modules/pgocaml/default.nix @@ -1,34 +1,27 @@ -{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, camlp4 -, ppx_tools_versioned, result, rresult +{ lib, fetchFromGitHub, buildDunePackage , calendar, csv, hex, re }: -if !stdenv.lib.versionAtLeast ocaml.version "4.05" -then throw "pgocaml is not available for OCaml ${ocaml.version}" -else - -stdenv.mkDerivation rec { - name = "ocaml${ocaml.version}-pgocaml-${version}"; - version = "3.2"; +buildDunePackage rec { + pname = "pgocaml"; + version = "4.0"; src = fetchFromGitHub { owner = "darioteixeira"; repo = "pgocaml"; rev = "v${version}"; - sha256 = "0jxzr5niv8kdh90pr57b1qb500zkkasxb8b8l7w9cydcfprnlk24"; + sha256 = "1s8c5prr7jb9k76bz990m836czm6k8rv5bvp6s2zg9ra0w19w90j"; }; - buildInputs = [ ocaml findlib ocamlbuild camlp4 ppx_tools_versioned result rresult ]; + minimumOCamlVersion = "4.05"; + + preConfigure = "patchShebangs src/genconfig.sh"; + propagatedBuildInputs = [ calendar csv hex re ]; - configureFlags = [ "--enable-p4" "--enable-ppx" ]; - - createFindlibDestdir = true; - - meta = with stdenv.lib; { + meta = with lib; { description = "An interface to PostgreSQL databases for OCaml applications"; - homepage = http://pgocaml.forge.ocamlcore.org/; + inherit (src.meta) homepage; license = licenses.lgpl2; maintainers = with maintainers; [ vbgl ]; - inherit (ocaml.meta) platforms; }; }