aports/testing/proverif/use-lablgtk3.patch

90 lines
4.2 KiB
Diff

This patches the build script to use lablgtk3 instead of lablgtk2. In addition,
a few instances of interfaces deprecated in GTK2 and dropped in GTK3 needed
to be fixed to get this compiling.
diff --color -rupN a/build b/build
--- a/build 2023-10-17 15:42:29.000000000 +0200
+++ b/build 2026-01-11 20:29:53.865187175 +0100
@@ -115,7 +115,7 @@ case X$1 in
ocamlopt -o ../addexpectedtags$EXEC $SRCADDTAGS &&\
if [ $INTERACT = true ]
then
- ocamlfind ocamlopt -o ../proverif_interact$EXEC -package lablgtk2 -package unix -package str -linkpkg $SRCINTERACT
+ ocamlfind ocamlopt -o ../proverif_interact$EXEC -package lablgtk3 -package unix -package str -linkpkg $SRCINTERACT
fi;;
Xnative | X )
@@ -134,7 +134,7 @@ case X$1 in
ocamlopt -o ../addexpectedtags$EXEC $SRCADDTAGS &&\
if [ $INTERACT = true ]
then
- ocamlfind ocamlopt -o ../proverif_interact$EXEC -package lablgtk2 -package unix -package str -linkpkg $SRCINTERACT
+ ocamlfind ocamlopt -o ../proverif_interact$EXEC -package lablgtk3 -package unix -package str -linkpkg $SRCINTERACT
fi;;
Xbyte )
@@ -153,7 +153,7 @@ case X$1 in
ocamlc -o ../addexpectedtags$EXEC $SRCADDTAGS &&\
if [ $INTERACT = true ]
then
- ocamlfind ocamlc -o ../proverif_interact$EXEC -custom -package lablgtk2 -package unix -package str -linkpkg $SRCINTERACT
+ ocamlfind ocamlc -o ../proverif_interact$EXEC -custom -package lablgtk3 -package unix -package str -linkpkg $SRCINTERACT
fi;;
Xdebug )
@@ -172,7 +172,7 @@ case X$1 in
ocamlc -g -o ../addexpectedtags$EXEC $SRCADDTAGS &&\
if [ $INTERACT = true ]
then
- ocamlfind ocamlc -g -o ../proverif_interact$EXEC -custom -package lablgtk2 -package unix -package str -linkpkg $SRCINTERACT
+ ocamlfind ocamlc -g -o ../proverif_interact$EXEC -custom -package lablgtk3 -package unix -package str -linkpkg $SRCINTERACT
fi;;
Xclean )
diff --color -rupN a/src/menu_helper.ml b/src/menu_helper.ml
--- a/src/menu_helper.ml 2023-10-17 15:42:31.000000000 +0200
+++ b/src/menu_helper.ml 2026-01-11 20:29:53.866575176 +0100
@@ -722,7 +722,7 @@ let is_auto_reductible state p n =
(* Same as GToolbox.question_box but with pango markup *)
let question_box ~title ~buttons ?(default=1) ?(width=800) ?(height=280) message =
let button_nb = ref 0 in
- let window = GWindow.dialog ~position:`CENTER ~width ~height ~allow_shrink:true ~modal:true ~title () in
+ let window = GWindow.dialog ~position:`CENTER ~width ~height ~modal:true ~title () in
let s_win = GBin.scrolled_window ~packing:(window#vbox#pack ~expand:true) () in
let hbox = GPack.hbox ~border_width:10 ~packing:s_win#add_with_viewport () in
let bbox = window#action_area in
@@ -1289,7 +1289,7 @@ let rec get_recipe_aux pref text =
let state = get_state () in
(* Main window *)
let m_win = GWindow.dialog ~title:"Give recipe"
- ~width:640 ~height:400 ~allow_shrink:true ~border_width:5 () in
+ ~width:640 ~height:400 ~border_width:5 () in
let _ = m_win#connect#destroy ~callback:(fun () ->
begin
m_win#destroy();
diff --color -rupN a/src/menu_interact.ml b/src/menu_interact.ml
--- a/src/menu_interact.ml 2023-10-17 15:42:31.000000000 +0200
+++ b/src/menu_interact.ml 2026-01-11 20:30:53.966424288 +0100
@@ -51,8 +51,7 @@ let window_p = GWindow.window
~position:`CENTER
~width:1000
~height:680
- ~title:"Proverif Interact"
- ~allow_shrink:true ()
+ ~title:"Proverif Interact" ()
let _ = window_p#misc#modify_bg [(`NORMAL,`WHITE)]
(* For displaying traces *)
@@ -760,8 +759,10 @@ let display_trace refresh_img () =
let create_button () =
b_incr := GButton.button ~label:"+" ();
b_decr := GButton.button ~label:"-" ();
+ !b_incr#misc#set_size_request ~width:5 ~height:5 ();
+ !b_decr#misc#set_size_request ~width:5 ~height:5 ();
let bbox = GPack.button_box `HORIZONTAL ~border_width:5 ~layout:`START
- ~child_height:5 ~child_width:5 ~spacing:5 () in
+ ~spacing:5 () in
bbox#add !b_incr#coerce;
bbox#add !b_decr#coerce;
let _ = !b_incr#connect#clicked ~callback:(incr_png !b_incr !b_decr) in