Code Monkey home page Code Monkey logo

lablgtk's People

Contributors

acondolu avatar adrien-n avatar an146 avatar bobot avatar btj avatar camaradetux avatar cedlemo avatar ejgallego avatar garrigue avatar herbelin avatar hermierjules avatar jamesjer avatar julow avatar kit-ty-kate avatar martindemello avatar nguermond avatar oandrieu avatar ppedrot avatar rwmjones avatar sacerdot avatar silene avatar skyskimmer avatar talex5 avatar vprevosto avatar xvilka avatar zoggy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lablgtk's Issues

GLib list

Some examples depend on GList that you removed in the lablgtk2on3 branch. I started to reimport from the master branch but it seems that in Gtk2 GList are used with GtkList. I don't know how worked Gtk2 and GtkList, I just know that Gtk3 uses GList like this:

GList *
gtk_container_get_children (GtkContainer *container);

Have you got any advices on this ?

Segfault when initializing class using window

I have a simple program which works with lablgtk2 but segfaults with lablgtk3. The program

class wrapper =
  let window = GWindow.window ~title: "demo" ~show: false ()
  in
  object (_self)
    inherit GObj.widget window#as_widget

    method window  = window 
  end

let _ =
  let _locale = GMain.init () in
  let wrapper =  new wrapper in
  ignore@@ wrapper#window#connect#destroy ~callback: GMain.quit;

  wrapper#window#present ();
  GMain.main ()

And I compile it using

ocamlfind ocamlc -package lablgtk3 -linkpkg -thread -g -o demo demo.ml

And when I run it segfaults wtih the following stack trace

systemd-coredump[60499]: Process 60497 (demo) of user 1000 dumped core.
                                                    
Stack trace of thread 60497:
#0  0x00007f56c2ae4acc n/a (libgtk-3.so.0 + 0x112acc)
#1  0x00007f56c2b04b3c n/a (libgtk-3.so.0 + 0x132b3c)
#2  0x00007f56c2aef175 n/a (libgtk-3.so.0 + 0x11d175)
#3  0x00007f56c263c687 g_type_create_instance (libgobject-2.0.so.0 + 0x30687)
#4  0x00007f56c262ce9e n/a (libgobject-2.0.so.0 + 0x20e9e)
#5  0x00007f56c262dfdd g_object_new_with_properties (libgobject-2.0.so.0 + 0x21fdd)
#6  0x00007f56c262eae2 g_object_new (libgobject-2.0.so.0 + 0x22ae2)
#7  0x00007f56c2d088e3 n/a (libgtk-3.so.0 + 0x3368e3)
#8  0x00007f56c263c687 g_type_create_instance (libgobject-2.0.so.0 + 0x30687)
#9  0x00007f56c262ce9e n/a (libgobject-2.0.so.0 + 0x20e9e)
#10 0x00007f56c262e251 g_object_newv (libgobject-2.0.so.0 + 0x22251)
#11 0x00007f56c31ad8c0 ml_g_object_new (dlllablgtk3_stubs.so + 0x378c0)
#12 0x0000558742baba9d caml_interprete (ocamlrun + 0x32a9d)
#13 0x0000558742bae897 caml_main (ocamlrun + 0x35897)
#14 0x0000558742b8d70c main (ocamlrun + 0x1470c)
#15 0x00007f56c3d91002 __libc_start_main (libc.so.6 + 0x27002)
#16 0x0000558742b8d74e _start (ocamlrun + 0x1474e)

fails to compile on ocaml 4.02.3

README says that one needs ocaml-3.11 or more (4.06 is preferred)

When compiling on a debian stable machine (ocaml 4.02.3):

ocamlc.opt   -w s-3+52 -warn-error A-52 -c  gutf8.ml
File "gutf8.ml", line 71, characters 26-27:
Error: The function applied to this argument has type int -> int -> string
This argument cannot be applied with label ~pos
Makefile:192: recipe for target 'gutf8.cmo' failed

For debian it would be fine to require ocaml >= 4.05, but then please say so and adapt the check in
configure.in accordingly.

-Ralf.

Windows Dune Build

I am opening this issue to track:

  • the windows build using Dune
  • and how to add Travis support.

First question is what should the right windows environment be, we got some interesting comments here: https://discuss.ocaml.org/t/preferred-ocaml-windows-environments-mainly-for-continuous-integration/3299/3 but I am not sure I fully understand all the nuances here. See also ocaml/ocaml-ci-scripts#284

I tried to setup up Travis, however my knowledge of windows is too limited and the Travis windows environment is too bare-bones for me to know how to do it.

Regarding the Windows Dune build @MSoegtropIMC has commented:

I would say the issue is the option "-Wl,-luuid" in \build\lablgtk-3.0.beta4\_build\default\src\clink-gtk+-3.0.sexp. I think the option should be either "-ldopt "-link \"-Wl,-s\"" or just "-link -Wl,-s" so that flexlink forwards it to the system linker (see my comments in the lablgtk2 build in an old makecoq_mingw.sh). But the sexp file is auto generated on each build and I couldn't find out which magic leads to the effect that these options are in there. I searched the lablgtk and dune sources for uuid without success. So I don't know what to change in order to change these options.

Problem with GPack.layout adjustments

Here is the layout definition from gPack.ml

let layout ?hadjustment ?vadjustment ?layout_width ?layout_height =
  Layout.make_params []
    ?hadjustment:(may_map GData.as_adjustment hadjustment)
    ?vadjustment:(may_map GData.as_adjustment hadjustment)
    ?width:layout_width ?height:layout_height ~cont:(
  pack_container ~create:(fun p -> new layout (Layout.create p)))

It looks wrong because the vadjustment parameter is never used, but hadjustment is used twice. I've tried to create a simple example to see what happens and something is wrong even if not exactly what I was expecting.

let main () = 
  let _local = GMain.init () in
  let window = GWindow.window ~title: "Layout Demo" ~width: 450 ~height: 450 () in
  ignore@@ window#misc#connect#destroy ~callback: GMain.quit;

  let sw = GBin.scrolled_window ~packing: window#add () in
  let layout = GPack.layout 
      ~hadjustment: sw#hadjustment ~vadjustment: sw#vadjustment 
      ~layout_width: 600 ~layout_height: 600 
      ~packing: sw#add () in

  let a = GMisc.label ~text: "A" () in
  layout#put a#coerce ~x: 20 ~y: 20;

  let b = GMisc.label ~text: "B" () in
  layout#put b#coerce ~x: 500 ~y: 500;

  window#show ();
  GMain.main ()

let _ = main ()

What happens when I compile and run this code is that the vertical scrolling works and horizontal scrolling doesn't.
However if I scroll horizontally and then vertically then it jumps to to the correct position.

Hope this helps

src/propcc.ml and src/propcc.ml4 are out of sync in lablgtk3 branch

Commit a0c89b2 did update src/propcc.ml with a new boxed type, but left src/propcc.ml4 untouched. This results in potential issue when using a fresh clone, as make might consider that src/propcc.ml needs to be regenerated from the obsolete src/propcc.ml4. This in turn leads later to a compilation error:

ocamlc.opt   -w s-3+52 -warn-error A-52 -c  gObj.ml
File "gObj.ml", line 224, characters 29-41:
Error: Unbound value Signals.draw

Why are properties of Widget (et alt.) not "wrap"ped?

Dear @garrigue or whoever knows,
I don't understand why the flag "wrap" is not set on some widgets in .props files, with the result that getter and setter for properties are not generated.

Example: class Widget in GtkBase has no wrap flag and all of its properties are unavailable.

In particular, the setter for the "events" property is not and it is necessary to make "drawing_area"s reactive
to button touches, in order to restore functionalities of no-longer-there widgets.

What is the expected way to restore those props? Write stubs by hand? Use "wrap" everywhere?

Thanks,
C.S.C.

Linking issues with gcc-10

I'm unable to compile labgtk3 3.1.0 since I've upgraded my gcc version, with ld reporting multiple definitions of ml_table_extension_events, declared in src/ml_gdk.h on line 89. The symptom looks similar as an issue reported against OCaml itself, and replacing CAMLexport by CAMLextern in the declaration (which technically, without the extern, is a "tentative definition"), as suggested there, indeed fixes the issue.

lablgtk3 beta6 build-depends on camlp4

Hi,

somewhere between beta3 and beta6 a build-dependency on camlp4 seems to have creeped in, or at least dune thinks so:

dune build
        bash src/propcc.ml (exit 127)
(cd _build/default/src && /bin/bash -e -u -o pipefail -c 'camlp4o pr_o.cmo -impl propcc.ml4 -o propcc.ml')
/bin/bash: camlp4o: command not found
        bash src/varcc.ml (exit 127)
(cd _build/default/src && /bin/bash -e -u -o pipefail -c 'camlp4o pr_o.cmo -impl varcc.ml4 -o varcc.ml')
/bin/bash: camlp4o: command not found
File "src/dune", line 11, characters 12-29:
11 |  (libraries dune.configurator))
                 ^^^^^^^^^^^^^^^^^
Error: Library "dune.configurator" not found.
Hint: try: dune external-lib-deps --missing @@default

This the release of lablgtk3 tagged 3.0.beta6.

-Ralf.

GTK3 branches cleanup

As it was indicated in the bug #34 it is not clear which one is "real" GTK 3 branch, so it makes sense to remove or rename irrelevant branches, something like "legacy_blabla" or "old_blabla".

move lablgtk2 examples into a subdirectory in the lablgtk3 branch

It is currently unclear which examples have been updated to gtk3. Moving everything into a gtk2/ subdirectory and then copying them back as they are updated would both make things easier to find, and be a valuable guide to updating code (since we could then diff foo.ml gtk2/foo.ml to see what changed between 2 and 3).

I'd be happy to do this if people think it's a good idea.

[lablgtk3 beta6] Install does not use stublibs/

I am packaging lablgtk3 for Arch Linux and running in a number of issues.

When using the ocamlfind-based build system, so-files are installed in usr/lib/ocaml/lablgtk3/ instead of usr/lib/ocaml/stublibs/. Besides, it overrides usr/lib/ocaml/ld.conf which looks like a really bad idea and is a no-go for packaging... (possibly related to #18 ?)

Here is an example of so-file installed in the wrong location:

-rwxr-xr-x root/root    376352 2019-11-01 14:19 usr/lib/ocaml/lablgtk3/dlllablgtk3.so
-rwxr-xr-x root/root     60648 2019-11-01 14:19 usr/lib/ocaml/lablgtk3/dlllablgtksourceview3.so

Here is the content of the overwritten ld.conf, which is completely wrong:

/build/lablgtk3/pkg/lablgtk3/usr/lib/ocaml/lablgtk3

Here is how I build lablgtk3:

./configure --prefix=/usr \
  --without-gtkspell \
  --with-gtksourceview3
make world
make opt

and then install with:

make DESTDIR="/build/lablgtk3/pkg/lablgtk3" install

When using the old-install target, the libs are installed in usr/lib/ocaml/stublibs/ as expected.

lablgtk does not to compile with ocaml trunk

While testing for ocaml/ocaml#1320 I stumble on an error for lablgtk, the commit used are in the log.

2017-09-12 17:30:54.267233+02:00 Info Check the revspecs:
2017-09-12 17:31:09.902720+02:00 Info configuration: --rootfs 4  --commit=camlp4,a4d0d56b74a1cb641ca087788f4e1790714e5dd9 --commit=lablgtk,6afecb181d69451f5488ee137c289740bbaafd36 --commit=ocaml,52b9a71ff14ba86d20b2bd788a29310caa0dc063 --commit=ocamlbuild,e0207b2b87dfe26c696c06926d12ed7354794b54 --commit=ocamlfind,10eb35a79c2579c1d481cdf7741bb2e190c57a4c --url=camlp4,https://github.com/ocaml/camlp4.git --url=lablgtk,https://forge.ocamlcore.org/anonscm/git/lablgtk/lablgtk.git --url=ocaml,https://github.com/ocaml/ocaml.git --url=ocamlbuild,https://github.com/ocaml/ocamlbuild.git --url=ocamlfind,https://gitlab.camlcity.org/gerd/lib-findlib.git
[17:31:09] dispatch master Oci_Generic_Masters.compile_git_repo camlp4
[17:31:09] dispatch master Oci_Generic_Masters.compile_git_repo ocaml
[17:31:09] dispatch master Oci_Generic_Masters.compile_git_repo ocamlbuild
[17:31:09] dispatch master Oci_Generic_Masters.compile_git_repo ocamlfind
[17:31:09] Dependency ocamlbuild done
[17:31:09] Dependency ocamlfind done
[17:31:09] Dependency camlp4 done
[17:31:09] Dependency ocaml done
[17:31:10] dispatch runner Oci_Generic_Masters.compile_git_repo_runner
[17:31:10] Link Artefacts
[17:31:10] Link artefact 33483 to /
[17:31:14] Link artefact 39932 to /
[17:31:14] Link artefact 39934 to /
[17:31:14] Link artefact 39931 to /
[17:31:14] Link artefact 39942 to /
[17:31:14] mount -t, tmpfs, tmpfs, /checkout
[17:31:14] Clone repository at 6afecb181d69451f5488ee137c289740bbaafd36
[17:31:14] Git clone https://forge.ocamlcore.org/anonscm/git/lablgtk/lablgtk.git in /oci/git_clone/0
[17:31:15] git -C, /checkout, -c, advice.detachedHead=false, checkout, --detach, 6afecb181d69451f5488ee137c289740bbaafd36
[17:31:15] HEAD is now at 6afecb1... fix comment
[Result] Start
[17:31:15] ./configure 
[17:31:15] checking for ocamlc... ocamlc
[17:31:15] ocaml version is 4.06.0+dev1-2017-06-23
[17:31:15] ocaml library path is /usr/local/lib/ocaml
[17:31:15] Default install dirs are : /usr/local/lib/ocaml/lablgtk2 and /usr/local/lib/ocaml/stublibs
[17:31:15] Compile with ocamlc -I +lablgtk2
[17:31:15] checking for ocamlopt... ocamlopt
[17:31:15] checking ocamlopt version... ok
[17:31:15] checking for ocamlc.opt... ocamlc.opt
[17:31:15] checking ocamlc.opt version... ok
[17:31:15] checking for ocamlopt.opt... ocamlopt.opt
[17:31:15] checking ocamlc.opt version... ok
[17:31:15] checking for ocamlrun... ocamlrun
[17:31:15] checking for ocamldep... ocamldep
[17:31:15] checking for ocamldoc... ocamldoc
[17:31:15] checking for ocamllex... ocamllex
[17:31:15] checking for ocamlyacc... ocamlyacc
[17:31:15] checking for ocamlmktop... ocamlmktop
[17:31:15] checking for ocamlmklib... ocamlmklib
[17:31:15] checking for camlp4o... camlp4o
[17:31:15] checking for ocaml threads... use system threads
[17:31:15] checking for ocaml dll support... yes
[17:31:15] checking for ranlib... ranlib
[17:31:15] OCaml uses gcc to compile C files
[17:31:15] checking for gcc... gcc
[17:31:15] checking for C compiler default output file name... a.out
[17:31:15] checking whether the C compiler works... yes
[17:31:15] checking whether we are cross compiling... no
[17:31:15] checking for suffix of executables... 
[17:31:15] checking for suffix of object files... o
[17:31:15] checking whether we are using the GNU C compiler... yes
[17:31:15] checking whether gcc accepts -g... yes
[17:31:15] checking for gcc option to accept ISO C89... none needed
[17:31:15] checking platform... Unix
[17:31:15] checking native dynlink... checking for pkg-config... /usr/bin/pkg-config
[17:31:23] checking for GTK+ - version >= 2.0.0... yes (version 2.24.31)
[17:31:23] checking pkg-config is at least version 0.9.0... yes
[17:31:23] checking for GTKGL... no
[17:31:23] checking for GLADE... no
[17:31:23] checking for RSVG... no
[17:31:23] checking for GNOMECANVAS... yes
[17:31:23] checking for GNOMEUI... no
[17:31:23] checking for PANEL... no
[17:31:23] checking for GTKSPELL... no
[17:31:23] checking for GTKSOURCEVIEW... no
[17:31:23] checking for GTKSOURCEVIEW2... yes
[17:31:23] checking for GTKQUARTZ... no
[17:31:23] checking for GTKALL... yes
[17:31:23] configure: creating ./config.status
[17:31:23] config.status: creating config.make
[17:31:23] 
[17:31:23] LablGTK configuration:
[17:31:23] 	threads  	system
[17:31:23] 	native dynlink 	yes
[17:31:23] 	GtkGLArea 	not found
[17:31:23] 	libglade 	not found
[17:31:23] 	librsvg  	not found
[17:31:23] 	libgnomecanvas 	yes
[17:31:23] 	libgnomeui 	not found
[17:31:23] 	libpanelapplet 	not found
[17:31:23] 	gtkspell 	not found
[17:31:23] 	gtksourceview 1 	not found
[17:31:23] 	gtksourceview 2 	yes
[17:31:23] 	quartz    	not found
[17:31:23] 
[17:31:23] 	debug   	no
[17:31:23] 	C compiler	gcc
[Result] Ok in {kernel:156ms; user:384ms; wall:7.91317s}
[Result] Start
[17:31:23] make --jobs=1, world
[17:31:23] /usr/bin/make -C src world
[17:31:23] make[1]: Entering directory '/checkout/src'
[17:31:23] ocamlc.opt -c -pp "camlp4o -impl" -impl varcc.ml4
[17:31:23] File "varcc.ml4", line 25, characters 25-39:
[17:31:23] Warning 3: deprecated: Char.lowercase
[17:31:23] Use Char.lowercase_ascii instead.
[17:31:23] File "varcc.ml4", line 113, characters 12-31:
[17:31:23] Warning 3: deprecated: StdLabels.String.uncapitalize
[17:31:23] Use String.uncapitalize_ascii instead.
[17:31:23] File "varcc.ml4", line 115, characters 12-28:
[17:31:23] Warning 3: deprecated: StdLabels.String.uppercase
[17:31:23] Use String.uppercase_ascii instead.
[17:31:23] File "varcc.ml4", line 119, characters 6-23:
[17:31:23] Warning 3: deprecated: StdLabels.String.capitalize
[17:31:23] Use String.capitalize_ascii instead.
[17:31:23] ocamlc.opt   -o varcc varcc.cmo
[17:31:23] rm -f *_tags.h *_tags.c
[17:31:23] ./varcc gdkpixbuf_tags.var
[17:31:23] ./varcc gdk_tags.var
[17:31:23] ocamlc.opt -c -ccopt '-DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0 -I/usr/include/libart-2.0 -I/usr/include/gtksourceview-2.0 -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -imacros ml_domain.h -O' -verbose ml_gdkpixbuf.c
[17:31:23] + gcc -O2 -fno-strict-aliasing -fwrapv -fPIC -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c  -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0 -I/usr/include/libart-2.0 -I/usr/include/gtksourceview-2.0 -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -imacros ml_domain.h -O  -I'/usr/local/lib/ocaml' 'ml_gdkpixbuf.c'
[17:31:23] ml_gdkpixbuf.c: In function 'ml_GdkPixbuf_serialize':
[17:31:23] ml_gdkpixbuf.c:67:3: warning: 'gdk_pixdata_from_pixbuf' is deprecated [-Wdeprecated-declarations]
[17:31:23]    pixels = gdk_pixdata_from_pixbuf (&pixdata, pb, pixbuf_marshal_use_rle);
[17:31:23]    ^~~~~~
[17:31:23] In file included from ml_gdkpixbuf.c:28:0:
[17:31:23] /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixdata.h:115:10: note: declared here
[17:31:23]  gpointer gdk_pixdata_from_pixbuf (GdkPixdata  *pixdata,
[17:31:23]           ^~~~~~~~~~~~~~~~~~~~~~~
[17:31:23] ml_gdkpixbuf.c:68:3: warning: 'gdk_pixdata_serialize' is deprecated [-Wdeprecated-declarations]
[17:31:23]    stream = gdk_pixdata_serialize (&pixdata, &len);
[17:31:23]    ^~~~~~
[17:31:23] In file included from ml_gdkpixbuf.c:28:0:
[17:31:23] /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixdata.h:107:10: note: declared here
[17:31:23]  guint8*  gdk_pixdata_serialize (const GdkPixdata *pixdata,
[17:31:23]           ^~~~~~~~~~~~~~~~~~~~~
[17:31:23] ml_gdkpixbuf.c: In function 'ml_GdkPixbuf_deserialize':
[17:31:23] ml_gdkpixbuf.c:88:3: warning: 'gdk_pixdata_deserialize' is deprecated [-Wdeprecated-declarations]
[17:31:23]    gdk_pixdata_deserialize (&pixdata, len, stream, &error);
[17:31:23]    ^~~~~~~~~~~~~~~~~~~~~~~
[17:31:23] In file included from ml_gdkpixbuf.c:28:0:
[17:31:23] /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixdata.h:110:10: note: declared here
[17:31:23]  gboolean gdk_pixdata_deserialize (GdkPixdata  *pixdata,
[17:31:23]           ^~~~~~~~~~~~~~~~~~~~~~~
[17:31:23] ml_gdkpixbuf.c:90:3: warning: 'gdk_pixbuf_from_pixdata' is deprecated [-Wdeprecated-declarations]
[17:31:23]    pb = gdk_pixbuf_from_pixdata (&pixdata, TRUE, &error);
[17:31:23]    ^~
[17:31:23] In file included from ml_gdkpixbuf.c:28:0:
[17:31:23] /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixdata.h:119:12: note: declared here
[17:31:23]  GdkPixbuf* gdk_pixbuf_from_pixdata (const GdkPixdata *pixdata,
[17:31:23]             ^~~~~~~~~~~~~~~~~~~~~~~
[17:31:23] ./varcc pango_tags.var
[17:31:23] ocamlc.opt -c -ccopt '-DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0 -I/usr/include/libart-2.0 -I/usr/include/gtksourceview-2.0 -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -imacros ml_domain.h -O' -verbose ml_gdk.c
[17:31:23] + gcc -O2 -fno-strict-aliasing -fwrapv -fPIC -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c  -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0 -I/usr/include/libart-2.0 -I/usr/include/gtksourceview-2.0 -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -imacros ml_domain.h -O  -I'/usr/local/lib/ocaml' 'ml_gdk.c'
[17:31:24] ./varcc glib_tags.var
[17:31:24] ocamlc.opt -c -ccopt '-DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0 -I/usr/include/libart-2.0 -I/usr/include/gtksourceview-2.0 -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -imacros ml_domain.h -O' -verbose ml_glib.c
[17:31:24] + gcc -O2 -fno-strict-aliasing -fwrapv -fPIC -D_FILE_OFFSET_BITS=64 -D_REENTRANT -c  -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS -pthread -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0 -I/usr/include/libart-2.0 -I/usr/include/gtksourceview-2.0 -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -imacros ml_domain.h -O  -I'/usr/local/lib/ocaml' 'ml_glib.c'
[17:31:24] In file included from ml_glib.c:37:0:
[17:31:24] ml_glib.c: In function 'ml_raise_gerror_exn':
[17:31:24] /usr/local/lib/ocaml/caml/memory.h:341:12: error: 'caml__frame' undeclared (first use in this function)
[17:31:24]      (void) caml__frame, \
[17:31:24]             ^
[17:31:24] /usr/local/lib/ocaml/caml/memory.h:414:3: note: in expansion of macro 'CAMLxparam2'
[17:31:24]    CAMLxparam2 (x, y)
[17:31:24]    ^~~~~~~~~~~
[17:31:24] ml_glib.c:165:3: note: in expansion of macro 'CAMLlocal2'
[17:31:24]    CAMLlocal2(b, msg);
[17:31:24]    ^~~~~~~~~~
[17:31:24] /usr/local/lib/ocaml/caml/memory.h:341:12: note: each undeclared identifier is reported only once for each function it appears in
[17:31:24]      (void) caml__frame, \
[17:31:24]             ^
[17:31:24] /usr/local/lib/ocaml/caml/memory.h:414:3: note: in expansion of macro 'CAMLxparam2'
[17:31:24]    CAMLxparam2 (x, y)
[17:31:24]    ^~~~~~~~~~~
[17:31:24] ml_glib.c:165:3: note: in expansion of macro 'CAMLlocal2'
[17:31:24]    CAMLlocal2(b, msg);
[17:31:24]    ^~~~~~~~~~
[17:31:24] ml_glib.c: In function 'ml_g_io_channel_read':
[17:31:24] ml_glib.c:348:3: warning: 'g_io_channel_read' is deprecated: Use 'g_io_channel_read_chars' instead [-Wdeprecated-declarations]
[17:31:24]    switch (g_io_channel_read(GIOChannel_val(io),
[17:31:24]    ^~~~~~
[17:31:24] In file included from /usr/include/glib-2.0/glib.h:54:0,
[17:31:24]                  from ml_glib.c:33:
[17:31:24] /usr/include/glib-2.0/glib/giochannel.h:166:13: note: declared here
[17:31:24]  GIOError    g_io_channel_read   (GIOChannel    *channel,
[17:31:24]              ^~~~~~~~~~~~~~~~~
[17:31:24] Makefile:180: recipe for target 'ml_glib.o' failed
[17:31:24] make[1]: *** [ml_glib.o] Error 2
[17:31:24] make[1]: Leaving directory '/checkout/src'
[17:31:24] Makefile:5: recipe for target 'world' failed
[17:31:24] make: *** [world] Error 2
[Result] Failed with exited with code 2 in {kernel:80ms; user:1.04s; wall:1.16578s}: 
         make [--jobs=%i] [world]
         
[17:31:24] umount -l, /checkout

[build] gtkdoc support?

gtkdoc is an ocamldoc plugin that allows to link to GTK upstream documentation, with the move to Dune, ocamldoc is now deprecated in favor of odoc as a documentation generator and we have lost this functionality. There are two ways we could fix this:

  • add an ocamldoc rule to the dune rules that generates old-style docs again
  • tweak odoc output so we add the links back.

I think both of them should be reasonably easy to do for someone motivated.

3.0.beta6: compilation fails in invocation of ocamlmktop

Hello,

my attempts to compile version 3.0.beta6 fail when building the toplevel:

ocamlfind ocamlmktop -package cairo2 cairo.cma  -thread  -o lablgtktop unix.cma threads.cma  \
   -I . lablgtk.cma lablgtkspell.cma lablgtksourceview3.cma gtkThread.cmo
File "_none_", line 1:
Error: Error on dynamically loaded library: /usr/lib/ocaml/stublibs/dllcairo_stubs.so: /usr/lib/ocaml/stublibs/dllcairo_stubs.so: undefined symbol: caml_ba_alloc

Configuration options: --with-gtkspell --with-gtksourceview3
Ocaml: 4.05
Findlib: 1.7.3
Dune: 1.6.2

-Ralf.

Linking failure on MacOS (darwin) and gtk+3-3.24.10

CoqIDE has been using lablgtk3 (3.0.beta6) since a few month. It used to build fine on MacOS with GTK 3 at version 3.24.9.

With version 3.24.10 of GTK3, there is the following linking error:

OCAMLOPT -o bin/coqide
Undefined symbols for architecture x86_64:
  "_GTK_SOCKET", referenced from:
      _ml_gtk_socket_add_id in liblablgtk3_stubs.a(ml_gtk.o)
      _ml_gtk_socket_get_id in liblablgtk3_stubs.a(ml_gtk.o)
      _ml_gtk_socket_get_plug_window in liblablgtk3_stubs.a(ml_gtk.o)
  "_gtk_plug_get_type", referenced from:
      _ml_gtkwindow_init in liblablgtk3_stubs.a(ml_gtk.o)
  "_gtk_plug_new", referenced from:
      _ml_gtk_plug_new in liblablgtk3_stubs.a(ml_gtk.o)
     (maybe you meant: _ml_gtk_plug_new)
  "_gtk_socket_add_id", referenced from:
      _ml_gtk_socket_add_id in liblablgtk3_stubs.a(ml_gtk.o)
     (maybe you meant: _ml_gtk_socket_add_id)
  "_gtk_socket_get_id", referenced from:
      _ml_gtk_socket_get_id in liblablgtk3_stubs.a(ml_gtk.o)
     (maybe you meant: _ml_gtk_socket_get_id)
  "_gtk_socket_get_plug_window", referenced from:
      _ml_gtk_socket_get_plug_window in liblablgtk3_stubs.a(ml_gtk.o)
     (maybe you meant: _ml_gtk_socket_get_plug_window)
  "_gtk_socket_get_type", referenced from:
      _ml_gtkwindow_init in liblablgtk3_stubs.a(ml_gtk.o)
ld: symbol(s) not found for architecture x86_64

These missing functions belong to the GtkPlug and GtkSocket APIs which are supposedly only available on X11 platforms (as described there: https://developer.gnome.org/gtk3/stable/GtkPlug.html). So the error is somehow expected. What is strange is that it did not show up before.

NB: I get the same error when trying to build the “example3” test program (from https://github.com/garrigue/lablgtk/blob/lablgtk3/examples/sourceview/example3.ml).

Expose GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR

Hi,

I was wondering if it would be possible to expose access to GDK_MODIFIER_INTENT_PRIMARY_ACCELERATOR in lablgtk?
It would enable application developers to have native feeling shortcuts on mac where the default modifier is not control.

dune 2.7.0 says: Error: "dialog-thread" is an invalid module name.

+ dune build -j5
File "examples/dune", line 11, characters 3-16:
11 |    dialog-thread drawing
        ^^^^^^^^^^^^^
Error: "dialog-thread" is an invalid module name.
Module names must be non-empty and composed only of the following characters:
'A'..'Z', 'a'..'z', '_', ''' or '0'..'9'.
Hint: dialog_thread would be a correct module name

Fix is to rename the example.

"make install" should create missing directories

"make install: should create missing directories (usr/lib etc.). This is important when using a nonempty value for DESTDIR since then one cannot assume any already existing directories. Packagers from software distributions use this to install into an empty staging directory.

For instance :

% DESTDIR=/home/treinen make install
make -C src install
make[1]: Entering directory '/home/treinen/projects/lablgtk/src'
mkdir -p "/home/treinen/usr/local/bin"
mkdir -p "/home/treinen/usr/local/lib/ocaml/4.05.0"
touch: cannot touch '/home/treinen/usr/lib/ocaml/ld.conf': No such file or directory
make[1]: *** [Makefile:382: findlib-install] Error 1
make[1]: Leaving directory '/home/treinen/projects/lablgtk/src'
make: *** [Makefile:5: install] Error 2

Here the problem is that /home/treinen/usr/lib does not exist (not the missing "local")

Automatic generation of lablgtk bindings

Hi everybody,

lablgtk bindings are (mostly) hand-written. The Haskell guys instead made a much better job, automatically generating their bindings from GI (GObject Introspection). I have assigned to a master student of mine the task of trying to adapt the Haskell code to spit-out "lablgtk"-like bindings.

The student worked extremely well and there is now a working prototype at:
https://github.com/illbexyz/ocaml-gi-gtk

The prototype is not fully completed: some ad-hoc Gtk types (eg. GArrays) still need some code. However it can already generate twice the number of methods of the current bindings and it should work on any GI library. I have tried a few examples and they work.

The student has now ended his master period and I need to decide if investing more resources on the project or not. Here I list some pros&cons of automatic generation:

PROS

  • full coverage of Gtk libs and additional GI libs
  • code better aligned to the C API (easier to understand the doc)
  • "front-end" code, i.e. the code to parse the GI format, shared with the Haskell community and thus better maintained

CONS

  • dependency on Haskell code; it could be removed by porting all the generation code to OCaml
  • no more ad-hoc stuff: for example some methods now have labels, but not in a systematic way; a lot of other small changes here and there exist now to provide a more camlish API and they would disappear
  • need to port (again) all existing code (Coq, etc.) to the new API. The student tried to stay as close as possible to current lablgtk, but some changes here and there must be applied (e.g. right now the mapping from widgets to files is arbitrary, e.g. some in GMisc, etc.)

What are your opinions?

Cheers,
C.S.C.

Unable to build the lablgtk2on3 branch

I use ArchLinux with both Gtk2, Gtk3 and the gtksourceview libs installed.

λ › yaourt -Qi gtksourceview2                                                                                                                                                                                     OCaml/lablgtk  lablgtk2on3
Nom                      : gtksourceview2
Version                  : 2.10.5-3
Description              : A text widget adding syntax highlighting and more to GNOME
Architecture             : x86_64
URL                      : http://www.gnome.org
Licences                 : GPL
Groupes                  : --
Fournit                  : --
Dépend de                : gtk2>=2.22.0  libxml2>=2.7.7
Dépendances opt.         : --
Requis par               : --
Optionnel pour           : --
Est en conflit avec      : --
Remplace                 : --
Taille installée         : 5,05 MiB
Paqueteur                : Felix Yan <[email protected]>
Compilé le               : mar. 01 juil. 2014 17:42:55 CEST
Installé le              : mar. 24 mai 2016 22:45:51 CEST
Motif d’installation     : Explicitement installé
Script d’installation    : Non
Validé par               : Signature

When I try to build the lablgtk2onbranch3 with the following command ./configure && make world it fails with:

make -C src world                                                                                                                                                                                                                            
make[1]: Entering directory '/home/cedlemo/Projets/OCaml/lablgtk/src'                                                                                                                                                                        
ocamlc.opt -c -ccopt '-DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS -fno-unwind-tables -pthread -I/usr/include/gtksourceview-3.0 -I/usr/include/libxml2 -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/i
nclude/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/libdrm -I/usr/include/cloudproviders -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo
 -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wno-deprecated-declarations -imacros
 ml_domain.h -O' -verbose ml_gtksourceview2.c                                                                                                                                                                                                
+ gcc -O2 -fno-strict-aliasing -fwrapv -fPIC -D_FILE_OFFSET_BITS=64 -D_REENTRANT   -c  -DG_DISABLE_ASSERT -DG_DISABLE_CAST_CHECKS -fno-unwind-tables -pthread -I/usr/include/gtksourceview-3.0 -I/usr/include/libxml2 -I/usr/include/gtk-3.0 
-I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/libdrm -I/usr/include/cloudproviders -I/
usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 
-I/usr/lib/glib-2.0/include -Wno-deprecated-declarations -imacros ml_domain.h -O  -I'/home/cedlemo/.opam/4.06.0/lib/ocaml' 'ml_gtksourceview2.c'                                                                                             
In file included from ml_gtksourceview2.c:46:0:                                                                                                                                                                                              
sourceView2_tags.c:4:25: error: 'GTK_SOURCE_SEARCH_VISIBLE_ONLY' undeclared here (not in a function); did you mean 'GTK_TEXT_SEARCH_VISIBLE_ONLY'?                                                                                           
   { MLTAG_VISIBLE_ONLY, GTK_SOURCE_SEARCH_VISIBLE_ONLY },                                                                                                                                                                                   
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                      
                         GTK_TEXT_SEARCH_VISIBLE_ONLY                                                                                                                                                                                        
sourceView2_tags.c:5:22: error: 'GTK_SOURCE_SEARCH_TEXT_ONLY' undeclared here (not in a function); did you mean 'GTK_TEXT_SEARCH_TEXT_ONLY'?                                                                                                 
   { MLTAG_TEXT_ONLY, GTK_SOURCE_SEARCH_TEXT_ONLY },                                                                                                                                                                                         
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
                      GTK_TEXT_SEARCH_TEXT_ONLY
sourceView2_tags.c:6:29: error: 'GTK_SOURCE_SEARCH_CASE_INSENSITIVE' undeclared here (not in a function); did you mean 'GTK_TEXT_SEARCH_CASE_INSENSITIVE'?
   { MLTAG_CASE_INSENSITIVE, GTK_SOURCE_SEARCH_CASE_INSENSITIVE },
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                             GTK_TEXT_SEARCH_CASE_INSENSITIVE
ml_gtksourceview2.c: In function 'custom_completion_provider_get_type':
ml_gtksourceview2.c:376:67: error: 'GTK_TYPE_SOURCE_COMPLETION_PROVIDER' undeclared (first use in this function); did you mean 'GTK_SOURCE_COMPLETION_PROVIDER'?
     g_type_add_interface_static (custom_completion_provider_type, GTK_TYPE_SOURCE_COMPLETION_PROVIDER, &source_completion_provider_info);
                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                   GTK_SOURCE_COMPLETION_PROVIDER
ml_gtksourceview2.c:376:67: note: each undeclared identifier is reported only once for each function it appears in
ml_gtksourceview2.c:376:67: warning: passing argument 2 of 'g_type_add_interface_static' makes integer from pointer without a cast [-Wint-conversion]
In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0,
                 from /usr/include/glib-2.0/gobject/gbinding.h:29,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28,
                 from /usr/include/gtk-3.0/gdk/gdk.h:32,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from /usr/include/gtksourceview-3.0/gtksourceview/gtksourcecompletionprovider.h:34,
                 from /usr/include/gtksourceview-3.0/gtksourceview/completion-providers/words/gtksourcecompletionwords.h:33,
                 from /usr/include/gtksourceview-3.0/gtksourceview/gtksource.h:25,
                 from ml_gtksourceview2.c:24:
/usr/include/glib-2.0/gobject/gtype.h:1287:7: note: expected 'GType {aka long unsigned int}' but argument is of type 'const lookup_info * {aka const struct <anonymous> *}'
 void  g_type_add_interface_static (GType        instance_type,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ml_gtksourceview2.c:34:0:                                                                                                                                                                                              
ml_gtksourceview2.c: In function 'ml_gtk_source_completion_info_set_sizing':
ml_gtksourceview2.c:421:7: warning: implicit declaration of function 'gtk_source_completion_info_set_sizing'; did you mean 'ml_gtk_source_completion_info_set_sizing'? [-Wimplicit-function-declaration]
 ML_5 (gtk_source_completion_info_set_sizing,
       ^
wrappers.h:245:25: note: in definition of macro 'Unit'
 #define Unit(x) (((void)x), Val_unit)
                         ^
ml_gtksourceview2.c:421:1: note: in expansion of macro 'ML_5'
 ML_5 (gtk_source_completion_info_set_sizing,
 ^~~~
ml_gtksourceview2.c: In function 'ml_gtk_source_completion_info_process_resize':
ml_gtksourceview2.c:427:7: warning: implicit declaration of function 'gtk_source_completion_info_process_resize'; did you mean 'ml_gtk_source_completion_info_process_resize'? [-Wimplicit-function-declaration]
 ML_1 (gtk_source_completion_info_process_resize,
       ^
wrappers.h:245:25: note: in definition of macro 'Unit'
 #define Unit(x) (((void)x), Val_unit)
                         ^
ml_gtksourceview2.c:427:1: note: in expansion of macro 'ML_1'
 ML_1 (gtk_source_completion_info_process_resize,
 ^~~~
ml_gtksourceview2.c: In function 'custom_undo_manager_get_type':
ml_gtksourceview2.c:686:60: error: 'GTK_TYPE_SOURCE_UNDO_MANAGER' undeclared (first use in this function); did you mean 'GTK_SOURCE_UNDO_MANAGER'?
     g_type_add_interface_static (custom_undo_manager_type, GTK_TYPE_SOURCE_UNDO_MANAGER, &source_undo_manager_info);
                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                            GTK_SOURCE_UNDO_MANAGER
ml_gtksourceview2.c:686:60: warning: passing argument 2 of 'g_type_add_interface_static' makes integer from pointer without a cast [-Wint-conversion]
In file included from /usr/include/glib-2.0/gobject/gobject.h:24:0,
                 from /usr/include/glib-2.0/gobject/gbinding.h:29,
                 from /usr/include/glib-2.0/glib-object.h:23,
                 from /usr/include/glib-2.0/gio/gioenums.h:28,
                 from /usr/include/glib-2.0/gio/giotypes.h:28,
                 from /usr/include/glib-2.0/gio/gio.h:26,
                 from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:28,
                 from /usr/include/gtk-3.0/gdk/gdk.h:32,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from /usr/include/gtksourceview-3.0/gtksourceview/gtksourcecompletionprovider.h:34,
                 from /usr/include/gtksourceview-3.0/gtksourceview/completion-providers/words/gtksourcecompletionwords.h:33,
                 from /usr/include/gtksourceview-3.0/gtksourceview/gtksource.h:25,
                 from ml_gtksourceview2.c:24:
/usr/include/glib-2.0/gobject/gtype.h:1287:7: note: expected 'GType {aka long unsigned int}' but argument is of type 'const lookup_info * {aka const struct <anonymous> *}'
 void  g_type_add_interface_static (GType        instance_type,
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ml_gtksourceview2.c:26:0:
ml_gtksourceview2.c: In function 'ml_gtk_source_view_get_mark_category_priority':
ml_gtksourceview2.c:740:7: warning: implicit declaration of function 'gtk_source_view_get_mark_category_priority'; did you mean 'ml_gtk_source_view_get_mark_category_priority'? [-Wimplicit-function-declaration]
 ML_2 (gtk_source_view_get_mark_category_priority,
       ^
/home/cedlemo/.opam/4.06.0/lib/ocaml/caml/mlvalues.h:73:47: note: in definition of macro 'Val_long'
 #define Val_long(x)     ((intnat) (((uintnat)(x) << 1)) + 1)
                                               ^
wrappers.h:110:10: note: in expansion of macro 'Val_int'
 { return conv (cname (conv1(arg1), conv2(arg2))); }
          ^~~~
ml_gtksourceview2.c:740:1: note: in expansion of macro 'ML_2'
 ML_2 (gtk_source_view_get_mark_category_priority,
 ^~~~
In file included from ml_gtksourceview2.c:34:0:
ml_gtksourceview2.c: In function 'ml_gtk_source_view_set_mark_category_priority':
ml_gtksourceview2.c:742:7: warning: implicit declaration of function 'gtk_source_view_set_mark_category_priority'; did you mean 'ml_gtk_source_view_set_mark_category_priority'? [-Wimplicit-function-declaration]
 ML_3 (gtk_source_view_set_mark_category_priority,
       ^
wrappers.h:245:25: note: in definition of macro 'Unit'
 #define Unit(x) (((void)x), Val_unit)
                         ^
ml_gtksourceview2.c:742:1: note: in expansion of macro 'ML_3'
 ML_3 (gtk_source_view_set_mark_category_priority,
 ^~~~
ml_gtksourceview2.c: In function 'ml_gtk_source_view_set_mark_category_pixbuf':
ml_gtksourceview2.c:744:7: warning: implicit declaration of function 'gtk_source_view_set_mark_category_pixbuf'; did you mean 'ml_gtk_source_view_set_mark_category_pixbuf'? [-Wimplicit-function-declaration]
 ML_3 (gtk_source_view_set_mark_category_pixbuf, GtkSourceView_val,
       ^
wrappers.h:245:25: note: in definition of macro 'Unit'
 #define Unit(x) (((void)x), Val_unit)
                         ^
ml_gtksourceview2.c:744:1: note: in expansion of macro 'ML_3'
 ML_3 (gtk_source_view_set_mark_category_pixbuf, GtkSourceView_val,
 ^~~~
ml_gtksourceview2.c: In function 'ml_gtk_source_view_get_mark_category_pixbuf':
ml_gtksourceview2.c:746:7: warning: implicit declaration of function 'gtk_source_view_get_mark_category_pixbuf'; did you mean 'ml_gtk_source_view_get_mark_category_pixbuf'? [-Wimplicit-function-declaration]
 ML_2 (gtk_source_view_get_mark_category_pixbuf, GtkSourceView_val,
       ^
wrappers.h:110:16: note: in definition of macro 'ML_2'
 { return conv (cname (conv1(arg1), conv2(arg2))); }
                ^~~~~
ml_gtksourceview2.c:746:7: warning: passing argument 1 of 'Val_option_GdkPixbuf' makes pointer from integer without a cast [-Wint-conversion]
 ML_2 (gtk_source_view_get_mark_category_pixbuf, GtkSourceView_val,
       ^
wrappers.h:110:16: note: in definition of macro 'ML_2'
 { return conv (cname (conv1(arg1), conv2(arg2))); }
                ^~~~~
                ^~~~~
In file included from ml_gtksourceview2.c:39:0:
ml_gdkpixbuf.h:29:7: note: expected 'GdkPixbuf * {aka struct _GdkPixbuf *}' but argument is of type 'int'
 value Val_option_GdkPixbuf (GdkPixbuf *);
       ^~~~~~~~~~~~~~~~~~~~
In file included from ml_gtksourceview2.c:34:0:
ml_gtksourceview2.c: In function 'ml_gtk_source_view_set_mark_category_background':
ml_gtksourceview2.c:748:7: warning: implicit declaration of function 'gtk_source_view_set_mark_category_background'; did you mean 'ml_gtk_source_view_set_mark_category_background'? [-Wimplicit-function-declaration]
 ML_3 (gtk_source_view_set_mark_category_background,
       ^
wrappers.h:245:25: note: in definition of macro 'Unit'
 #define Unit(x) (((void)x), Val_unit)
                         ^
ml_gtksourceview2.c:748:1: note: in expansion of macro 'ML_3'
 ML_3 (gtk_source_view_set_mark_category_background,
 ^~~~
ml_gtksourceview2.c: In function 'ml_gtk_source_view_get_mark_category_background':
ml_gtksourceview2.c:757:10: warning: implicit declaration of function 'gtk_source_view_get_mark_category_background'; did you mean 'ml_gtk_source_view_get_mark_category_background'? [-Wimplicit-function-declaration]
      if (gtk_source_view_get_mark_category_background(
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          ml_gtk_source_view_get_mark_category_background
ml_gtksourceview2.c: In function 'get_widget_name':
ml_gtksourceview2.c:791:40: warning: implicit declaration of function 'GTK_WIDGET_TYPE'; did you mean 'GTK_WIDGET'? [-Wimplicit-function-declaration]
         if (strcmp (name, g_type_name (GTK_WIDGET_TYPE (w))) == 0)
                                        ^~~~~~~~~~~~~~~
                                        GTK_WIDGET
ml_gtksourceview2.c: In function 'ml_gtk_source_iter_forward_search':
ml_gtksourceview2.c:872:5: warning: implicit declaration of function 'gtk_source_iter_forward_search'; did you mean 'ml_gtk_source_iter_forward_search'? [-Wimplicit-function-declaration]
   b=gtk_source_iter_##dir##_search(GtkTextIter_val(ti),\
     ^
ml_gtksourceview2.c:886:1: note: in expansion of macro 'Make_search'
 Make_search(forward);
 ^~~~~~~~~~~
ml_gtksourceview2.c: In function 'ml_gtk_source_iter_backward_search':
ml_gtksourceview2.c:872:5: warning: implicit declaration of function 'gtk_source_iter_backward_search'; did you mean 'ml_gtk_source_iter_backward_search'? [-Wimplicit-function-declaration]
   b=gtk_source_iter_##dir##_search(GtkTextIter_val(ti),\
     ^
ml_gtksourceview2.c:887:1: note: in expansion of macro 'Make_search'
 Make_search(backward);
 ^~~~~~~~~~~
make[1]: *** [Makefile:187: ml_gtksourceview2.o] Error 2
make[1]: Leaving directory '/home/cedlemo/Projets/OCaml/lablgtk/src'
make: *** [Makefile:5: world] Error 2

Any ideas what I am missing ? I wanted to try your examples to see if I can be of any help.(#2 (comment))

cannot build the lablgtk3 pango example

I tried installing both via the released version on opam, and from github using opam pin .. Copying the pango1.ml example into a new project and trying to build it gives

$ dune build pango.exe
File "pango.ml", line 1:
Error: The files /home/mdemello/.opam/4.07.1/lib/lablgtk3/gPango.cmi
       and /home/mdemello/.opam/4.07.1/lib/lablgtk3/cairo_pango.cmi
       make inconsistent assumptions over interface Pango

lablgtk3 fails to compile with OCaml 4.10 [pre-release]

Changes in the runtime produce this error:

      ocamlc src/ml_gpointer.o (exit 2)
(cd _build/default/src && /home/egallego/.opam/4.10.0+trunk/bin/ocamlc.opt -g -I /home/egallego/.opam/4.10.0+trunk/lib/cairo2 -I /home/egallego/.opam/4.10.0+trunk/lib/ocaml/threads -ccopt -pthread -ccopt -I/usr/include/gtk-3.0 -ccopt -I/usr/include/at-spi2-atk/2.0 -ccopt -I/usr/include/at-spi-2.0 -ccopt -I/usr/include/dbus-1.0 -ccopt -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -ccopt -I/usr/include/gtk-3.0 -ccopt -I/usr/include/gio-unix-2.0 -ccopt -I/usr/include/cairo -ccopt -I/usr/include/libdrm -ccopt -I/usr/include/pango-1.0 -ccopt -I/usr/include/harfbuzz -ccopt -I/usr/include/pango-1.0 -ccopt -I/usr/include/fribidi -ccopt -I/usr/include/atk-1.0 -ccopt -I/usr/include/cairo -ccopt -I/usr/include/pixman-1 -ccopt -I/usr/include/freetype2 -ccopt -I/usr/include/libpng16 -ccopt -I/usr/include/gdk-pixbuf-2.0 -ccopt -I/usr/include/libmount -ccopt -I/usr/include/blkid -ccopt -I/usr/include/uuid -ccopt -I/usr/include/glib-2.0 -ccopt -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -ccopt -Wno-deprecated-declarations -ccopt -g -o ml_gpointer.o ml_gpointer.c)
In file included from /home/egallego/.opam/4.10.0+trunk/lib/ocaml/caml/mlvalues.h:20,
                 from ml_gpointer.c:25:
/home/egallego/.opam/4.10.0+trunk/lib/ocaml/caml/compatibility.h:245:32: error: expected ‘)’ before ‘->’ token
 #define young_start (Caml_state->_young_start)
                                ^~
wrappers.h:36:18: note: in expansion of macro ‘young_start’
 CAMLextern char *young_start, *young_end; /* from minor_gc.h */
                  ^~~~~~~~~~~
ml_gpointer.c: In function ‘ml_stable_copy’:
ml_gpointer.c:36:35: warning: comparison of distinct pointer types lacks a cast
     if (Is_block(v) && (char*)(v) < young_end && (char*)(v) > young_start)
                                   ^
ml_gpointer.c:36:61: warning: comparison of distinct pointer types lacks a cast
     if (Is_block(v) && (char*)(v) < young_end && (char*)(v) > young_start)

lablgtk fails to compile with gcc-10

GCC will reject multiple definition of global variables starting from gcc-10

A fix could be:
--- a/src/ml_gdk.h 2020-05-14 22:19:59.045394874 +0200
+++ b/src/ml_gdk.h 2020-05-14 22:20:06.694277819 +0200
@@ -102,7 +102,7 @@
CAMLexport int OptFlags_GdkModifier_val (value);
CAMLexport int Flags_GdkModifier_val (value);
CAMLexport int Flags_Event_mask_val (value);
-CAMLexport lookup_info *ml_table_extension_events;
+extern lookup_info *ml_table_extension_events;
#define Extension_events_val(key) ml_lookup_to_c(ml_table_extension_events,key)

#define GdkDragContext_val(val) check_cast(GDK_DRAG_CONTEXT,val)
--- a/src/ml_gdk.c 2020-05-14 22:21:39.244861128 +0200
+++ b/src/ml_gdk.c 2020-05-14 22:21:57.571580518 +0200
@@ -55,6 +55,8 @@
#define GDK_WINDOW_TYPE_HINT_DOCK GDK_WINDOW_TYPE_HINT_NORMAL
#endif

+lookup_info *ml_table_extension_events;
+
CAMLprim void ml_raise_gdk (const char *errmsg)
{
static const value * exn = NULL;

gBuilder.cm* no longer distributed in beta4

Hi,

gBuilder.ml* is no longer compiled in beta4. Therefore the code generated by lablgladecc does not
work either.

Sorry for not having check before, I was on mission and I am just back.

please clarify licence of examples/*

Hi,

most of the files under examples/ have a header "There is no specific licensing policy, but you may freely take inspiration from the code, and copy parts of it in your application." It is not clear what that means.
For instance, is one allowed to redistribute the code, or derived works of this code ? If yes, under
which licence?

If you wish that there are no copyright restrictions on the code then please state this clearly, or otherwise choose one of the existing permissive licences thar are around.

-Ralf

Debugging and update examples.

Here is a list of the examples to test the lablgtk2on3 (#2 ) ordered on their number of lines. It will help to keep track of what has been done and what remains to do.

  • working
  • not working

Tested

  • (19) examples/curve.ml
  • (19) examples/entry2.ml
  • (19) examples/seppala.ml
  • (25) examples/socket.ml
  • (27) examples/hello.ml
  • (28) examples/spin.ml
  • (30) examples/calendar.ml
  • (30) examples/drawing.ml
  • (30) examples/runthread.ml
  • (32) examples/combo.ml
  • (32) examples/link_button.ml
  • (33) examples/expander.ml
  • (33) examples/nihongo.ml
  • (36) examples/about.ml
  • (36) examples/assistant.ml
  • (37) examples/dialog-thread.ml
  • (39) examples/events2.ml
  • (39) examples/fixpoint.ml
  • (39) examples/giotest.ml
  • (39) examples/notebook.ml
  • (41) examples/pixview.ml
  • (42) examples/buttons.ml
  • (43) examples/text/unicode_viewer.ml
  • (44) examples/GL/simple.ml
  • (44) examples/progressbar.ml
  • (44) examples/scrolledwin.ml
  • (45) examples/counter.ml
  • (45) examples/glade/glade_demo.ml
  • (45) examples/rsvg/test_rsvg.ml
  • (46) examples/signal_override.ml
  • (47) examples/GL/simple_th.ml
  • (48) examples/cputs.ml
  • (48) examples/radiobuttons.ml
  • (49) examples/text/unicode_table.ml
  • (57) examples/label.ml
  • (57) examples/lissajous.ml
  • (59) examples/entry.ml
  • (59) examples/sourceview/sourceview2.ml
  • (61) examples/clist.ml
  • (63) examples/cgets.ml
  • (69) examples/gioredirect.ml
  • (70) examples/slide_show.ml
  • (71) examples/filechooser.ml
  • (78) examples/GL/aargb.ml
  • (78) examples/eventbox.ml

Remain to test:

  • (78) examples/glade/gladecalc.ml
  • (79) examples/canvas/canvas-richtext.ml
  • (81) examples/canvas/canvas-features.ml
  • (83) examples/canvas/toroid.png
  • (85) examples/tree.ml
  • (86) examples/spell.ml
  • (92) examples/test.xpm
  • (94) examples/entrycompletion.ml
  • (104) examples/events.ml
  • (106) examples/GL/tutorial-2.ml
  • (106) examples/sourceview/test2.ml
  • (107) examples/fifteen.ml
  • (107) examples/image.ml
  • (112) examples/editor.ml
  • (113) examples/druid.ml
  • (113) examples/sourceview/test.ml
  • (114) examples/GL/tutorial-3.ml
  • (123) examples/calc.ml
  • (123) examples/sourceview/example2.ml
  • (124) examples/combobox.ml
  • (125) examples/GL/tutorial-4.ml
  • (131) examples/GL/texturesurf.ml
  • (132) examples/GL/scene.ml
  • (132) examples/sourceview/ocaml.lang
  • (133) examples/panel/applet.ml
  • (134) examples/editor2.ml
  • (134) examples/rpn.ml
  • (136) examples/GL/planet.ml
  • (141) examples/kaimono.ml
  • (144) examples/tooltip.ml
  • (145) examples/canvas/canvas-fifteen.ml
  • (146) examples/assistant_tutorial.ml
  • (146) examples/timer.ml
  • (153) examples/action.ml
  • (153) examples/iconview.ml
  • (173) examples/tree_model.ml
  • (176) examples/canvas/canvas-curve.ml
  • (179) examples/GL/tutorial-5.ml
  • (184) examples/text/test_text.ml
  • (185) examples/custom_list_generic.ml
  • (192) examples/custom_tree.ml
  • (199) examples/tree_store.ml
  • (207) examples/text/test.txt
  • (210) examples/accel_tree.ml
  • (210) examples/pousse.ml
  • (212) examples/tron.ml
  • (241) examples/csview.ml
  • (260) examples/dcalendar.ml
  • (264) examples/custom_tree_generic.ml
  • (266) examples/GL/gears.ml
  • (277) examples/toolbar.ml
  • (283) examples/text/text-demo.ml
  • (291) examples/fixed_editor.ml
  • (331) examples/canvas/canvas-arrowhead.ml
  • (346) examples/glade/project2.glade
  • (453) examples/canvas/canvas-primitives.ml
  • (518) examples/testdnd.ml
  • (618) examples/GL/morph3d.ml
  • (1130) examples/testgtk.ml

It appears that "make doc" still depends on camlp4

Howdy! The following lines seem to be in the Makefile, and they prevent a build on a machine without camlp4 installed.

gtkdoc.cmo : gtkdoc.ml
        $(CAMLC) -I +ocamldoc -pp "$(CAMLP4O) pa_macro.cmo $(ODOC_DEF)" -c $<

leftover .cvsignore files

a minor issue : there are some leftover .cvsignore files, it would be nice if you could delete them:

$ find . -name .cvsignore
./doc/.cvsignore
./applications/browser/.cvsignore
./applications/unison/.cvsignore
./applications/camlirc/.cvsignore
./examples/text/.cvsignore
./examples/glade/.cvsignore

findlib lablgtk3-sourceview3 vs lablgtk3.sourceview

I'm on lablgtk3-beta6
When installing lablgtk3-sourceview3 via dune it is found by ocamlfind as lablgtk3-sourceview.
But when installing / building via the Makefile it will show up as lablgtk3.sourceview.
I suspect only the former can be sustained, so probably the Makefile based build should be either removed or adapted to install in the same way as dune does.

Custom widget

Is it possible to create a custom widget using lablgtk3? If it is possible I beg for some hints, since reading the library code I'm unable to understand

Documenation for GWindow.window is not up to date

The documentation for GWindow.window in src/gWindow.mli#L142 is not up date.

There are parameters which are not longer present and actual parameters are missing. Here are what the correct values seems to be

(** @param kind default value is [`TOPLEVEL]
    @param title default value is [""] (but the title of main window of program is set to program name)
    @param decorated default value is [true]
    @param deletable default value is [true]
    @param icon default value is [false]
    @param icon_name default value is [""]    
    @param modal default value is [false]
    @param position default value is [`NONE]
    @param resizable default value is [true]
    @param screen default value is is [None] (most probably is set to [Gdk.Screen.defaualt ()] but I was unable to check it)
    @param type_hint default value is [`NORMAL]
    @param urgency default value is [false]
    @param wmclass default value is [None] (deprecated since 3.22)
    @param border_width default value is [0]
    @param width default value is [0] (but set to [200] for an empty window)
    @param height default value is [0] (but set to [200] for an empty window)
    @param show default value is [false]
*)

I've got most of those by creating an empty window and checking its properties.

[opam | macOS] lablgtk3 seems to need both libffi.6.dylib and libffi.7.dylib

Hi,

I was installing lablgtk3 for CoqIDE using opam on my Mac Book.
I got errors said some codes need libffi.7.dylib but others need libffi.6.dylib also.
I have both of libffi in homebrew. I switched libffi.7.dylib (libffi 3.3) into libffi.6.dylib (libffi 3.2.1)
but just ends up with error as I said above.
I also got the same error when I built from the source code.

Is this my environment's problem?

The following is a long error log:

using libffi.7.dylib (libffi 3.3)

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[coqide.8.11.1] found in cache
[lablgtk3.3.1.0] found in cache
[lablgtk3-sourceview3.3.1.0] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of lablgtk3 failed at "/Users/user/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 3".

#=== ERROR while compiling lablgtk3.3.1.0 =====================================#
# context     2.0.6 | macos/x86_64 | ocaml-base-compiler.4.09.1 | https://opam.ocaml.org#e7c98c54
# path        ~/.opam/4.09.1/.opam-switch/build/lablgtk3.3.1.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 3
# exit-code   1
# env-file    ~/.opam/log/lablgtk3-71044-0a5907.env
# output-file ~/.opam/log/lablgtk3-71044-0a5907.out
### output ###
# [...]
# dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
#   Referenced from: /usr/local/Cellar/llvm/10.0.0_1/lib/libLLVM.dylib
#   Reason: image not found
# File "src/gutf8.ml", line 1:
# Error: Assembler error, input left in file /var/folders/nz/vdfnf67j235_q6gc3gc2k7v40000gn/T/camlasm87355a.s
#     ocamlopt tools/.varcc.eobjs/native/varcc.{cmx,o} (exit 2)
# (cd _build/default && /Users/user/.opam/4.09.1/bin/ocamlopt.opt -w -40 -g -I tools/.varcc.eobjs/byte -I tools/.varcc.eobjs/native -intf-suffix .ml -no-alias-deps -o tools/.varcc.eobjs/native/varcc.cmx -c -impl tools/varcc.ml)
# dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
#   Referenced from: /usr/local/Cellar/llvm/10.0.0_1/lib/libLLVM.dylib
#   Reason: image not found
# File "tools/varcc.ml", line 1:
# Error: Assembler error, input left in file /var/folders/nz/vdfnf67j235_q6gc3gc2k7v40000gn/T/camlasm087cfb.s



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build lablgtk3 3.1.0
+-
- No changes have been performed

using libffi.6.dylib (libffi 3.2.1)

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[coqide.8.11.1] found in cache
[lablgtk3.3.1.0] found in cache
[lablgtk3-sourceview3.3.1.0] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of lablgtk3 failed at "/Users/user/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 3".

#=== ERROR while compiling lablgtk3.3.1.0 =====================================#
# context     2.0.6 | macos/x86_64 | ocaml-base-compiler.4.09.1 | https://opam.ocaml.org#e7c98c54
# path        ~/.opam/4.09.1/.opam-switch/build/lablgtk3.3.1.0
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p lablgtk3 -j 3
# exit-code   1
# env-file    ~/.opam/log/lablgtk3-70028-0a5907.env
# output-file ~/.opam/log/lablgtk3-70028-0a5907.out
### output ###
# ml_gtktree.c:551:23: warning: assigning to 'gchar *' (aka 'char *') from 'unsigned char *' converts between pointers to integer types with different sign [-Wpointer-sign]
# [...]
#                       ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2 warnings generated.
#   ocamlmklib src/dlllablgtk3_stubs.so,src/liblablgtk3_stubs.a (exit 2)
# (cd _build/default && /Users/user/.opam/4.09.1/bin/ocamlmklib.opt -g -o src/lablgtk3_stubs src/cairo_pango_stubs.o src/ml_gdk.o src/ml_gdkpixbuf.o src/ml_glib.o src/ml_gobject.o src/ml_gpointer.o src/ml_gtk.o src/ml_gtkaction.o src/ml_gtkassistant.o src/ml_gtkbin.o src/ml_gtkbuilder.o src/ml_gtkbutton.o src/ml_gtkedit.o src/ml_gtkfile.o src/ml_gtkmenu.o src/ml_gtkmisc.o src/ml_gtkpack.o src/m[...]
# ld: file not found: /usr/local/opt/libffi/lib/libffi.7.dylib for architecture x86_64
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
#     ocamlopt src/.lablgtk3.objs/native/gtkMain.{cmx,o}
# File "src/gtkMain.ml", line 49, characters 4-16:
# 49 |     Obj.truncate (Obj.repr Sys.argv) (Array.length argv) [@warnerror "-3"];
#          ^^^^^^^^^^^^
# Alert deprecated: Stdlib.Obj.truncate



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build lablgtk3 3.1.0
+-
- No changes have been performed

This is my environment:

  • macOS Catalina 10.15.3 x86_64
  • opam 2.0.6
  • OCaml 4.09.1
  • Homebrew 2.2.13

Thank you.

Changes in dune >= 1.7.2 break reporting pkg-config errors in lablgtk3 beta5 on macosx

Hi, the semantics of query in Configurator.V1 changed in dune 1.7.2 (see ocaml/dune#1842). As a consequence, a query to query of the form gtk+-3.0 >= 3.18, as generated by Dune_config.gen_pkg is not anymore valid under macosx (package has >= in it and line let p = sprintf "%s/opt/%s/lib/pkgconfig" (quote_if_needed prefix) package of V1.ml produces an unexpected path). No query is thus sent to pkg-config.

On my installation, this had the effect of dune failing to report that libffi is not found by pkg-config.

So, querying pkg-config about gtk+-3.0 >= 3.18 as it is done in beta5 does not work with dune >= 1.7.2. Afaiu, this does not mean that installation will necessarily fail, but, that it would fail without reporting the cause if pkg-config and PKG_CONFIG_PATH are not configurated correctly enough.

I see two possible fixes: either requiring dune < 1.7.0 (since dune 1.7.0 and 1.7.1 are also to avoid), or requiring dune >= 1.8.0 (so as to also include ocaml/dune#1886) together with a modified dune_config.ml.

For instance, the attached patch seems to fix the problem by calling the query API of dune 1.8.0 as expected.

patch.txt

Towards an official release of lablgtk3 ?

(I'm not sure an issue is the right communication tool, but since GitHub provides no mailing lists...)

I have just released lablgtk3-3.0.beta7, which switches to a dune only build system, includes a variety of fixes, and uses a new layout for the source files.
If there is no major problem I suppose this could be a good timing to finally release an official 3.0.x.

Please report any new issue.

Various installation issues

Hi,

I tried to build the library and run the examples and got various compile errors.

First set could be solved by installing the following packages using the Linux package manager - in my case for Ubuntu, using apt:

sudo apt install libexpat1-dev libgtk2.0-dev 

Second set could be solved by installing the following OCaml packages using opam:

opam install lablgtk
opam install cairo2
opam install camlp4 # fixing: camlp4o: command not found

Then I got the following issues:

dune_config src/cflag-gtkspell3-3.0.sexp,src/clink-gtkspell3-3.0.sexp (exit 1)
(cd _build/default/src && ./dune_config.exe -pkg gtkspell3-3.0 -version 3.0.4)
Warning: Package name "gtkspell3-3.0 >= 3.0.4" contains invalid characters. Use Pkg_config.query_expr to construct proper queries
configure error: gtkspell3-3.0 >= 3.0.4 not found.

dune_config src/cflag-gtksourceview-3.0.sexp,src/clink-gtksourceview-3.0.sexp (exit 1)
(cd _build/default/src && ./dune_config.exe -pkg gtksourceview-3.0 -version 3.18)
Warning: Package name "gtksourceview-3.0 >= 3.18" contains invalid characters. Use Pkg_config.query_expr to construct proper queries
configure error: gtksourceview-3.0 >= 3.18 not found.

What I did is probably just a workaround and it might be necessary to fix the package definition (I know next to nothing about dune...):

sudo apt install libgtkspell3-3-dev libgtksourceview-3.0-dev

Thanks for your efforts, Frank

`opam` install failing for lablgtk 2.18.8

I'm trying to install 'lablgtk' in order to compile the graphic version of unison. Unfortunately, I'm getting a deprecation error:

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
$ opam --version
2.0.4
$ opam switch
#  switch        compiler                     description
   4.07.0        ocaml-base-compiler.4.07.0   4.07.0
→  4.07.0+32bit  ocaml-variants.4.07.0+32bit  4.07.0+32bit
   system        ocaml-system.4.05.0
$ ocaml --version
The OCaml toplevel, version 4.07.0
$ sudo apt install libexpat1-dev libgtk2.0-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libexpat1-dev is already the newest version (2.2.5-3).
libgtk2.0-dev is already the newest version (2.24.32-1ubuntu1).
0 upgraded, 0 newly installed, 0 to remove and 43 not upgraded.
$ opam install lablgtk
The following actions will be performed:
  ∗ install lablgtk 2.18.8

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[lablgtk.2.18.8] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of lablgtk failed at "/home/toor/.opam/opam-init/hooks/sandbox.sh build make world".

#=== ERROR while compiling lablgtk.2.18.8 =====================================#
# context     2.0.4 | linux/x86_64 | ocaml-variants.4.07.0+32bit | https://opam.ocaml.org/#9fbe2b53
# path        ~/.opam/4.07.0+32bit/.opam-switch/build/lablgtk.2.18.8
# command     ~/.opam/opam-init/hooks/sandbox.sh build make world
# exit-code   2
# env-file    ~/.opam/log/lablgtk-15264-a00279.env
# output-file ~/.opam/log/lablgtk-15264-a00279.out
### output ###
# [...]
# ml_gdkpixbuf.c:90:3: warning: ‘gdk_pixbuf_from_pixdata’ is deprecated [-Wdeprecated-declarations]
#    pb = gdk_pixbuf_from_pixdata (&pixdata, TRUE, &error);
#    ^~
# In file included from ml_gdkpixbuf.c:28:0:
# /usr/include/gdk-pixbuf-2.0/gdk-pixbuf/gdk-pixdata.h:119:12: note: declared here
#  GdkPixbuf* gdk_pixbuf_from_pixdata (const GdkPixdata *pixdata,
#             ^~~~~~~~~~~~~~~~~~~~~~~
# Makefile:187: recipe for target 'ml_gdkpixbuf.o' failed
# make[1]: *** [ml_gdkpixbuf.o] Error 2
# make[1]: Leaving directory '/home/toor/.opam/4.07.0+32bit/.opam-switch/build/lablgtk.2.18.8/src'
# Makefile:5: recipe for target 'world' failed
# make: *** [world] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build lablgtk 2.18.8
└─
╶─ No changes have been performed

<><> lablgtk.2.18.8 troubleshooting <><><><><><><><><><><><><><><><><><><><><><>
=> This package requires gtk+ 2.0 development packages installed on your system

The packages you requested declare the following system dependencies. Please make sure they are installed before
retrying:
    libexpat1-dev libgtk2.0-dev

# Run eval $(opam env) to update the current shell environment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.