(lang dune 3.20)
(name posix-bindings)
(source (github savonet/ocaml-posix))
(license MIT)
(authors "Romain Beauxis")
(maintainers "romain.beauxis@gmail.com")
(maintenance_intent "(latest)")

(version 4.0.1)
(generate_opam_files true)
(opam_file_location inside_opam_directory)

(package
 (name posix-base)
 (synopsis "Base module for the posix bindings")
 (description "posix-base provides base tools for the posix binding modules.")
 (depends
  (ocaml (>= 4.08))
  (integers (>= 0.3.0))
  (ctypes (>= 0.24.0)))
)

(package
 (name posix-errno)
 (synopsis "POSIX errno handling and Unix error conversion")
 (description "posix-errno provides comprehensive errno handling.")
 (depends
  (ocaml (>= 4.08))
  (posix-base (= :version))
  ctypes)
)

(package
 (name posix-signal)
 (synopsis "Bindings for the types defined in <signal.h>")
 (description "posix-signal provides an API to the types and bindings defined in <signal.h>")
 (depends
  (posix-base (= :version))
  (posix-errno (= :version))
  ctypes)
)

(package
 (name posix-types)
 (synopsis "Bindings for the types defined in <sys/types.h>")
 (description "posix-types provides an API to the types defined in <sys/types.h>")
 (depends
  (ocaml (>= 4.03))
  (posix-base (= :version))
  ctypes)
)

(package
 (name posix-time2)
 (synopsis "Bindings for posix time functions")
 (description "posix-time2 provides the types and bindings for posix time APIs.")
 (depends
  ctypes
  (posix-base (= :version))
  (posix-types (= :version))
  (posix-errno (= :version)))
)

(package
 (name posix-unistd)
 (synopsis "Bindings for posix unistd.h functions")
 (description "posix-unistd provides comprehensive OCaml bindings to POSIX unistd.h functions.")
 (depends
  ctypes
  (posix-base (= :version))
  (posix-types (= :version))
  (posix-errno (= :version))))

(package
 (name posix-socket)
 (synopsis "Bindings for posix sockets")
 (description "posix-socket provides the types and bindings of posix sockets APIs available on both unix and windows.")
 (depends
  (ocaml (>= 4.12))
  dune-configurator
  (posix-base (= :version))
  ctypes)
)

(package
 (name posix-socket-unix)
 (synopsis "Bindings for posix sockets")
 (description "posix-socket-unix provides unix-specific types and bindings for posix sockets.")
 (depends
  ctypes
  (posix-base (= :version))
  (posix-socket (= :version))
  (posix-errno (= :version)))
)

(package
 (name posix-uname)
 (synopsis "Bindings for posix uname")
 (description "posix-uname provides a simple interface for POSIX uname.")
 (depends
  ctypes
  (posix-base (= :version))
  (posix-errno (= :version)))
)

(package
 (name posix-getopt)
 (synopsis "Bindings for posix getopt/getopt_long")
 (description "posix-getopt provides a simple interface for the POSIX getopt and its extensions, getopt_long and getopt_long_only.")
 (depends
  dune-configurator
  (ounit2 :with-test)
  (process :with-test)
  (posix-uname (and :with-test (= :version)))
  ctypes
  (posix-base (= :version))
  (posix-errno (= :version)))
)

(package
 (name posix-math2)
 (synopsis "Bindings for posix math")
 (description "posix-math2 provides a simple interface for POSIX math functions.")
 (depends
  ctypes
  (posix-base (= :version)))
)

(package
 (name posix-stat)
 (synopsis "Bindings for posix stat")
 (description "posix-stat provides types and bindings for POSIX sys/stat.h APIs.")
 (depends
  ctypes
  (posix-base (= :version))
  (posix-types (= :version))
  (posix-time2 (= :version))
  (posix-errno (= :version)))
)

(package
 (name posix-resource)
 (synopsis "Bindings for posix resource limits and usage")
 (description "posix-resource provides types and bindings for POSIX sys/resource.h APIs.")
 (depends
  ctypes
  (posix-base (= :version))
  (posix-types (= :version))
  (posix-time2 (= :version))
  (posix-errno (= :version)))
)

(package
 (name posix-bindings)
 (synopsis "POSIX bindings")
 (description "install all available posix bindings")
 (allow_empty)
 (depends
  posix-types
  posix-socket
  posix-socket-unix
  posix-time2
  posix-unistd
  posix-uname
  posix-math2
  posix-getopt
  posix-stat
  posix-resource)
)
