public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Jerry James <loganjerry@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/virt-top] rawhide: OCaml 5.5.0 rebuild
Date: Fri, 10 Jul 2026 14:51:53 GMT	[thread overview]
Message-ID: <178369511323.1.13262918153233737828.rpms-virt-top-11655f4771eb@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/virt-top
            Branch : rawhide
            Commit : 11655f4771eba7ea116c90a025b00d7547582ace
            Author : Jerry James <loganjerry@gmail.com>
            Date   : 2026-07-10T08:51:41-06:00
            Stats  : +49/-3 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/virt-top/c/11655f4771eba7ea116c90a025b00d7547582ace?branch=rawhide

            Log:
            OCaml 5.5.0 rebuild

- Add patch to adapt to ocaml-curses 1.0.12

---
diff --git a/virt-top-1.1.2-curses.patch b/virt-top-1.1.2-curses.patch
new file mode 100644
index 0000000..5524bbf
--- /dev/null
+++ b/virt-top-1.1.2-curses.patch
@@ -0,0 +1,38 @@
+--- virt-top-1.1.2/src/top.ml.orig	2022-11-23 07:10:48.000000000 -0700
++++ virt-top-1.1.2/src/top.ml	2026-07-09 14:32:11.943607218 -0600
+@@ -284,26 +284,18 @@ let sleep = Unix.sleep
+ let millisleep n =
+   ignore (Unix.select [] [] [] (float n /. 1000.))
+ 
+-(* The curses getstr/getnstr functions are just weird.
+- * This helper function also enables echo temporarily.
+- *)
++(* This helper function enables echo temporarily. *)
+ let get_string maxlen =
+   ignore (echo ());
+-  let str = Bytes.create maxlen in
+-  (* Safe because binding calls getnstr.  However the unsafe cast
+-   * to string is required because ocaml-curses needs to be fixed.
+-   *)
+-  let ok = getstr (Obj.magic str) in
++  let ret = match getstr() with
++  | Error _ -> ""
++  | Ok str -> (* Chop at first `\0'. *)
++    match String.index_opt str '\000' with
++    | Some(index) -> String.sub str 0 index
++    | None -> str (* it is full maxlen bytes *)
++  in
+   ignore (noecho ());
+-  if not ok then ""
+-  else (
+-    (* Chop at first '\0'. *)
+-    try
+-      let i = Bytes.index str '\000' in
+-      Bytes.sub_string str 0 i
+-    with
+-      Not_found -> Bytes.to_string str (* it is full maxlen bytes *)
+-  )
++  ret
+ 
+ (* Main loop. *)
+ let rec main_loop ((conn, batch_mode, script_mode, csv_enabled, stream_mode, _, _, _)

diff --git a/virt-top.spec b/virt-top.spec
index 5bfa009..49fedce 100644
--- a/virt-top.spec
+++ b/virt-top.spec
@@ -3,7 +3,7 @@ ExcludeArch: %{ix86}
 
 Name:           virt-top
 Version:        1.1.2
-Release:        7%{?dist}
+Release:        8%{?dist}
 Summary:        Utility like top(1) for displaying virtualization stats
 License:        GPL-2.0-or-later
 
@@ -27,11 +27,13 @@ Source4:        libguestfs.keyring
 # included in RHEL builds.
 Patch1:         virt-top-1.0.9-processcsv-documentation.patch
 
+# Adapt to ocaml-curses 1.0.12, which fixed the getstr/getnstr weirdness
+Patch2:         virt-top-1.1.2-curses.patch
+
 BuildRequires:  gcc
 BuildRequires:  make
 BuildRequires:  ocaml >= 3.10.2
-BuildRequires:  ocaml-ocamldoc
-BuildRequires:  ocaml-findlib-devel
+BuildRequires:  ocaml-findlib
 # Need the ncurses / ncursesw (--enable-widec) fix.
 BuildRequires:  ocaml-curses-devel >= 1.0.3-7
 BuildRequires:  ocaml-calendar-devel
@@ -67,6 +69,8 @@ different virtualization systems.
 %patch -P1 -p1
 %endif
 
+%patch -P2 -p1
+
 # "ocamlfind byte" has been removed as an alias
 sed -i 's/\(OCAMLBEST=\)byte/\1ocamlc/' configure
 
@@ -118,6 +122,10 @@ install -m 0644 processcsv.py.1 $RPM_BUILD_ROOT%{_mandir}/man1/
 
 
 %changelog
+* Thu Jul 09 2026 Jerry James <loganjerry@gmail.com> - 1.1.2-8
+- OCaml 5.5.0 rebuild
+- Add patch to adapt to ocaml-curses 1.0.12
+
 * Fri Feb 20 2026 Richard W.M. Jones <rjones@redhat.com> - 1.1.2-7
 - OCaml 5.4.1 rebuild
 

                 reply	other threads:[~2026-07-10 14:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178369511323.1.13262918153233737828.rpms-virt-top-11655f4771eb@fedoraproject.org \
    --to=loganjerry@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox