I managed to successfully compile
and run Lazarus with ytk. You can find the changes on gitlab:
I tried to split all changes in smaller pieces, one widget at the time, so reviewing them should not be too hard.
The following changes were necessary:
ytk: unfortunately, the ardour authors made a change that is ABI incompatible with gtk2: they added three new methods in the
middle of the vtable of GtkWidget (instead of appending them). This is no problem for them (because of static linking) but a problem for fpc because the binding on the pascal side makes an assumption on the layout of that vtable. The branch in this repo moves the three methods to the end of the vtable (without this change Lazarus crashes on start).
fpc: Basically a lot of deprecated gtk2 types have been deleted (I just removed the corresponding "include" from the gtk2 package). And the package now links the ytk static libs instead of gtk, of course.
lazarus: Similarly a lot of old code has been removed. It turned out that most parts are not that critical because the code was not used anyway (some old artifacts from gtk1 or so -- some are even there in the gtk3 binding).
There three "bigger" changes:
- GtkCombo has been replaced by GtkComboBoxEntry
- GtkList has been replaced by GtkTreeView
- GtkCalendar has been disabled
The first two may cause some problems. I did my best to change not too much, but I had to remove some workarounds implemented specifically for GtkCombo or GtkList. So components using one of them may behave differently now (or have some bugs).
These changes should (in theory) be compatible with gtk2 (in particular, linking with gtk2 instead of ytk still works). Everything that has been removed has been deprecated in gtk2.
The only exception is GtkCalendar, which is not deprecated but also not part of ytk. I just disabled the widget for now. Possible solutions would be to add the widget to ytk again or to implement the LCL widget without the gtk backend.
With these changes, Lazarus starts (on my system), but only with the classic (i.e. multi-window) IDE. The docked IDE crashes (probably something with the GtkList or so, I do not know, yet).