Date: Wed, 7 Apr 2021 19:03:21 GMT From: Santhosh Raju <fox@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 3a9193de7272 - main - net-im/coyim: Applies the correct fix for gotk3 from upstream. Message-ID: <202104071903.137J3LaJ002374@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by fox: URL: https://cgit.FreeBSD.org/ports/commit/?id=3a9193de7272af328956a7cb2af49f5354580691 commit 3a9193de7272af328956a7cb2af49f5354580691 Author: Santhosh Raju <fox@FreeBSD.org> AuthorDate: 2021-04-07 19:01:25 +0000 Commit: Santhosh Raju <fox@FreeBSD.org> CommitDate: 2021-04-07 19:03:06 +0000 net-im/coyim: Applies the correct fix for gotk3 from upstream. As of Golang 1.16, the cgo tool will no longer try to translate C struct bitfields into Go struct fields, even if their size can be represented in Go. The order in which C bitfields appear in memory is implementation dependent, so in some cases the cgo tool produced results that were silently incorrect. In this case "accel_flags" is the bitwise field in question. A new declaration for GtkAccelKey structure that does not explicitly access to 'accel_flags' has been addressed in the patch. https://github.com/gotk3/gotk3/pull/730 Patch will be removed when vendor library will be updated. --- ...atch-vendor_github.com_gotk3_gotk3_gtk_accel.go | 134 +++++++++++++++++++-- 1 file changed, 121 insertions(+), 13 deletions(-) diff --git a/net-im/coyim/files/patch-vendor_github.com_gotk3_gotk3_gtk_accel.go b/net-im/coyim/files/patch-vendor_github.com_gotk3_gotk3_gtk_accel.go index 60ca114c7f5f..14ffe87739d1 100644 --- a/net-im/coyim/files/patch-vendor_github.com_gotk3_gotk3_gtk_accel.go +++ b/net-im/coyim/files/patch-vendor_github.com_gotk3_gotk3_gtk_accel.go @@ -1,22 +1,130 @@ -Remove the missing accel_flags field to prevent build failure. +Solve GtkAccelKey issue with golang 1.16. -XXX: Investigate this further. +https://github.com/gotk3/gotk3/pull/730 ---- vendor/github.com/gotk3/gotk3/gtk/accel.go.orig 2021-04-07 12:07:51 UTC +--- vendor/github.com/gotk3/gotk3/gtk/accel.go.orig 2019-03-22 10:58:51 UTC +++ vendor/github.com/gotk3/gotk3/gtk/accel.go -@@ -244,7 +244,6 @@ func (v *AccelKey) native() *C.struct__GtkAccelKey { - var val C.struct__GtkAccelKey - val.accel_key = C.guint(v.key) - val.accel_mods = C.GdkModifierType(v.mods) -- val.accel_flags = v.flags - return &val +@@ -69,6 +69,20 @@ func AcceleratorSetDefaultModMask(mods gdk.ModifierTyp + } + + /* ++ * GtkAccelLabel ++ */ ++ ++// TODO: ++// gtk_accel_label_new(). ++// gtk_accel_label_set_accel_closure(). ++// gtk_accel_label_get_accel_widget(). ++// gtk_accel_label_set_accel_widget(). ++// gtk_accel_label_get_accel_width(). ++// gtk_accel_label_set_accel(). since GTK 3.6 ++// gtk_accel_label_get_accel(). since GTK 3.12 ++// gtk_accel_label_refetch(). ++ ++/* + * GtkAccelGroup + */ + +@@ -93,6 +107,10 @@ func marshalAccelGroup(p uintptr) (interface{}, error) + } + + func wrapAccelGroup(obj *glib.Object) *AccelGroup { ++ if obj == nil { ++ return nil ++ } ++ + return &AccelGroup{obj} } -@@ -253,7 +252,6 @@ func wrapAccelKey(obj *C.struct__GtkAccelKey) *AccelKe +@@ -191,6 +209,9 @@ func AccelGroupsFromObject(obj *glib.Object) *glib.SLi + if res == nil { + return nil + } ++ ++ // TODO: call DataWrapper on SList and wrap them to gtk.AccelGroup ++ + return (*glib.SList)(unsafe.Pointer(res)) + } + +@@ -219,6 +240,10 @@ func marshalAccelMap(p uintptr) (interface{}, error) { + } - v.key = uint(obj.accel_key) - v.mods = gdk.ModifierType(obj.accel_mods) + func wrapAccelMap(obj *glib.Object) *AccelMap { ++ if obj == nil { ++ return nil ++ } ++ + return &AccelMap{obj} + } + +@@ -230,43 +255,24 @@ func AccelMapAddEntry(path string, key uint, mods gdk. + C.gtk_accel_map_add_entry((*C.gchar)(cstr), C.guint(key), C.GdkModifierType(mods)) + } + +-type AccelKey struct { +- key uint +- mods gdk.ModifierType +- flags uint16 +-} ++type AccelKey C.GtkAccelKey + +-func (v *AccelKey) native() *C.struct__GtkAccelKey { ++func (v *AccelKey) native() *C.GtkAccelKey { + if v == nil { + return nil + } +- +- var val C.struct__GtkAccelKey +- val.accel_key = C.guint(v.key) +- val.accel_mods = C.GdkModifierType(v.mods) +- val.accel_flags = v.flags +- return &val ++ return (*C.GtkAccelKey)(v) + } + +-func wrapAccelKey(obj *C.struct__GtkAccelKey) *AccelKey { +- var v AccelKey +- +- v.key = uint(obj.accel_key) +- v.mods = gdk.ModifierType(obj.accel_mods) - v.flags = uint16(obj.accel_flags) +- +- return &v +-} +- + // AccelMapLookupEntry is a wrapper around gtk_accel_map_lookup_entry(). + func AccelMapLookupEntry(path string) *AccelKey { + cstr := C.CString(path) + defer C.free(unsafe.Pointer(cstr)) + +- var v *C.struct__GtkAccelKey ++ var v = new(AccelKey) - return &v +- C.gtk_accel_map_lookup_entry((*C.gchar)(cstr), v) +- return wrapAccelKey(v) ++ C.gtk_accel_map_lookup_entry((*C.gchar)(cstr), v.native()) ++ return v } + + // AccelMapChangeEntry is a wrapper around gtk_accel_map_change_entry(). +@@ -417,7 +423,7 @@ func (v *Window) AddAccelGroup(accelGroup *AccelGroup) + C.gtk_window_add_accel_group(v.native(), accelGroup.native()) + } + +-// RemoveAccelGroup() is a wrapper around gtk_window_add_accel_group(). ++// RemoveAccelGroup() is a wrapper around gtk_window_remove_accel_group(). + func (v *Window) RemoveAccelGroup(accelGroup *AccelGroup) { + C.gtk_window_remove_accel_group(v.native(), accelGroup.native()) + } +@@ -432,4 +438,10 @@ func (v *Window) RemoveAccelGroup(accelGroup *AccelGro + // TODO: gtk_accel_map_foreach - can't be done without a function type + + // TODO: gtk_accel_map_load_scanner +-// TODO: gtk_widget_list_accel_closures ++ ++/* ++ * GtkWidget ++ */ ++ ++// TODO: ++// gtk_widget_list_accel_closures
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104071903.137J3LaJ002374>