diff --git a/pkgs/applications/virtualization/virt-top/default.nix b/pkgs/applications/virtualization/virt-top/default.nix new file mode 100644 index 000000000000..f411ea5c83e6 --- /dev/null +++ b/pkgs/applications/virtualization/virt-top/default.nix @@ -0,0 +1,23 @@ +{ stdenv, fetchurl, ocamlPackages }: + +stdenv.mkDerivation rec { + name = "virt-top-${version}"; + version = "1.0.8"; + + src = fetchurl { + url = "https://people.redhat.com/~rjones/virt-top/files/virt-top-${version}.tar.gz"; + sha256 = "04i1sf2d3ghilmzvr2vh74qcy009iifyc2ymj9kxnbkp97lrz13w"; + }; + + buildInputs = with ocamlPackages; [ ocaml findlib ocaml_extlib ocaml_libvirt ocaml_gettext curses csv xml-light ]; + + buildPhase = "make opt"; + + meta = with stdenv.lib; { + description = "A top-like utility for showing stats of virtualized domains"; + homepage = https://people.redhat.com/~rjones/virt-top/; + license = licenses.gpl2; + maintainers = [ maintainers.volth ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/development/ocaml-modules/curses/default.nix b/pkgs/development/ocaml-modules/curses/default.nix new file mode 100644 index 000000000000..4fd75e7aac53 --- /dev/null +++ b/pkgs/development/ocaml-modules/curses/default.nix @@ -0,0 +1,31 @@ +{ stdenv, fetchurl, ocaml, findlib, ncurses }: + +stdenv.mkDerivation rec { + name = "ocaml-curses-${version}"; + version = "1.0.3"; + + src = fetchurl { + url = "http://ocaml.phauna.org/distfiles/ocaml-curses-${version}.ogunden1.tar.gz"; + sha256 = "0fxya4blx4zcp9hy8gxxm2z7aas7hfvwnjdlj9pmh0s5gijpwsll"; + }; + + propagatedBuildInputs = [ ncurses ]; + + buildInputs = [ ocaml findlib ]; + + createFindlibDestdir = true; + + postPatch = '' + substituteInPlace curses.ml --replace "pp gcc" "pp $CC" + ''; + + buildPhase = "make all opt"; + + meta = with stdenv.lib; { + description = "OCaml Bindings to curses/ncurses"; + homepage = https://opam.ocaml.org/packages/curses/curses.1.0.3/; + license = licenses.gpl2; + maintainers = [ maintainers.volth ]; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-gettext/default.nix b/pkgs/development/ocaml-modules/ocaml-gettext/default.nix new file mode 100644 index 000000000000..d8a874a7e2f5 --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-gettext/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchurl, ocaml, findlib, camlp4, ounit, gettext, fileutils, camomile }: + +stdenv.mkDerivation rec { + name = "ocaml-gettext-${version}"; + version = "0.3.5"; + + src = fetchurl { + url = "https://forge.ocamlcore.org/frs/download.php/1433/ocaml-gettext-${version}.tar.gz"; + sha256 = "0s625h7y9xxqvzk4bnw45k4wvl4fn8gblv56bp47il0lgsx8956i"; + }; + + propagatedBuildInputs = [ gettext fileutils camomile ]; + + buildInputs = [ ocaml findlib camlp4 ounit ]; + + postPatch = stdenv.lib.optionalString (camlp4 != null) '' + substituteInPlace test/test.ml --replace "+camlp4" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4" + substituteInPlace ocaml-gettext/OCamlGettext.ml --replace "+camlp4" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4" + substituteInPlace ocaml-gettext/Makefile --replace "+camlp4" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4" + substituteInPlace ocaml-gettext/Makefile --replace "unix.cma" "" + substituteInPlace libgettext-ocaml/Makefile --replace "+camlp4" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4" + substituteInPlace libgettext-ocaml/Makefile --replace "\$(shell ocamlc -where)" "${camlp4}/lib/ocaml/${ocaml.version}/site-lib" + ''; + + configureFlags = [ "--disable-doc" ]; + + createFindlibDestdir = true; + + meta = with stdenv.lib; { + description = "OCaml Bindings to gettext"; + homepage = https://forge.ocamlcore.org/projects/ocaml-gettext; + license = licenses.gpl2; + maintainers = [ maintainers.volth ]; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix b/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix new file mode 100644 index 000000000000..439beaa24ffc --- /dev/null +++ b/pkgs/development/ocaml-modules/ocaml-libvirt/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, libvirt, ocaml, findlib }: + +stdenv.mkDerivation rec { + name = "ocaml-libvirt-${version}"; + version = "0.6.1.4"; + + src = fetchurl { + url = "http://libvirt.org/sources/ocaml/ocaml-libvirt-${version}.tar.gz"; + sha256 = "06q2y36ckb34n179bwczxkl82y3wrba65xb2acg8i04jpiyxadjd"; + }; + + propagatedBuildInputs = [ libvirt ]; + + buildInputs = [ ocaml findlib ]; + + createFindlibDestdir = true; + + buildPhase = if stdenv.cc.isClang then "make all opt CPPFLAGS=-Wno-error" else "make all opt"; + + installPhase = "make install-opt"; + + meta = with stdenv.lib; { + description = "OCaml bindings for libvirt"; + homepage = https://libvirt.org/ocaml/; + license = licenses.gpl2; + maintainers = [ maintainers.volth ]; + platforms = ocaml.meta.platforms or []; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9f870bc76eaa..05f903b8d807 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15400,6 +15400,8 @@ with pkgs; spice_gtk = spice_gtk; }; + virt-top = callPackage ../applications/virtualization/virt-top { }; + virtmanager = callPackage ../applications/virtualization/virt-manager { vte = gnome3.vte; dconf = gnome3.dconf; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index c55c3a5a0685..bcca2aaf0f8f 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -142,6 +142,8 @@ let csv = callPackage ../development/ocaml-modules/csv { }; + curses = callPackage ../development/ocaml-modules/curses { }; + custom_printf = callPackage ../development/ocaml-modules/custom_printf { }; ctypes = callPackage ../development/ocaml-modules/ctypes { }; @@ -309,10 +311,14 @@ let ocamlfuse = callPackage ../development/ocaml-modules/ocamlfuse { }; + ocaml_gettext = callPackage ../development/ocaml-modules/ocaml-gettext { }; + ocamlgraph = callPackage ../development/ocaml-modules/ocamlgraph { }; ocaml_http = callPackage ../development/ocaml-modules/http { }; + ocaml_libvirt = callPackage ../development/ocaml-modules/ocaml-libvirt { }; + ocamlify = callPackage ../development/tools/ocaml/ocamlify { }; ocaml_lwt = callPackage ../development/ocaml-modules/lwt { };