diff --git a/pkgs/development/ocaml-modules/ctypes/default.nix b/pkgs/development/ocaml-modules/ctypes/default.nix new file mode 100644 index 000000000000..43c7ddbb2904 --- /dev/null +++ b/pkgs/development/ocaml-modules/ctypes/default.nix @@ -0,0 +1,32 @@ +{stdenv, buildOcaml, fetchurl, libffi, pkgconfig, ncurses}: + +buildOcaml rec { + name = "ctypes"; + version = "0.4.1"; + + src = fetchurl { + url = "https://github.com/ocamllabs/ocaml-ctypes/archive/${version}.tar.gz"; + sha256 = "74564e049de5d3c0e76ea284c225cb658ac1a2b483345be1efb9be4b3c1702f5"; + }; + + buildInputs = [ ncurses pkgconfig ]; + propagatedBuildInputs = [ libffi ]; + + hasSharedObjects = true; + + buildPhase = '' + make XEN=false libffi.config ctypes-base ctypes-stubs + make XEN=false ctypes-foreign + ''; + + installPhase = '' + make install XEN=false + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/ocamllabs/ocaml-ctypes; + description = "Library for binding to C libraries using pure OCaml"; + license = licenses.mit; + maintainers = [ maintainers.ericbmerritt ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fcea3eb8c206..acc7ccbee333 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4134,6 +4134,8 @@ let custom_printf = callPackage ../development/ocaml-modules/custom_printf { }; + ctypes = callPackage ../development/ocaml-modules/ctypes { }; + deriving = callPackage ../development/tools/ocaml/deriving { }; dolog = callPackage ../development/ocaml-modules/dolog { };