Bug 237567 - devel/glib20 - upgrade, improve
Summary: devel/glib20 - upgrade, improve
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gnome (Nobody)
Depends on:
Reported: 2019-04-25 19:20 UTC by Mikhail Teterin
Modified: 2020-10-11 11:08 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (gnome)

Upgrade to 2.56.4, add TEST_target (2.55 KB, patch)
2019-04-25 19:20 UTC, Mikhail Teterin
no flags Details | Diff
Enable setting and getting of threads' names (2.52 KB, patch)
2019-04-25 19:21 UTC, Mikhail Teterin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Teterin freebsd_committer 2019-04-25 19:20:00 UTC
Created attachment 204018 [details]
Upgrade to 2.56.4, add TEST_target

I'm not sure, why our version of glib20 is still at 2.56 -- 2.61 is currently the latest available -- but there may be good reasons.

Still, within 2.56 we are on 2.56.3, whereas 2.56.4 is out since December 18th and promises the following improvements:

* Various buffer overflow fixes in GMarkup/GVariant/GDBus (#1582)

* Bug fixes:
 #1588 Moving a bookmark item to the same URI causes a crash
 #1582 Backport GMarkup/GVariant/GDBus fixes to glib-2-58 and glib-2-56

In addition to upgrading, I also set the TEST_TARGET (some tests fail) and provide for the thread-naming functionality by teaching glib about BSD-specific pthread_set_name_np and pthread_get_name_np calls.
Comment 1 Mikhail Teterin freebsd_committer 2019-04-25 19:21:39 UTC
Created attachment 204019 [details]
Enable setting and getting of threads' names

This patch can be dropped, verbatim, into the ports files/ independent of the proposed upgrade. It is applicable to both 2.56.3 and 2.56.4.
Comment 2 daniel.engberg.lists 2020-03-16 17:19:40 UTC
Jan and/or Koop and you have a look at this?
Comment 3 loic.blot 2020-03-16 17:34:13 UTC
i started to port the current glib we have on archlinux (2.64) from scratch because of ninja. I just have a linking issue i cannot fix currently, if you are interested we may upgrade that, that will unlock gtk update
Comment 4 Jan Beich freebsd_committer 2020-03-16 18:19:16 UTC
Comment on attachment 204019 [details]
Enable setting and getting of threads' names

Needs to be submitted upstream as configure bits look wrong.

> +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFlyBSD__)

DragonFly only defines __DragonFly__ but not __DragonFlyBSD__. Also, sort systems alphabetically.

> +#	include <pthread_np.h>

Does not exist on NetBSD.

> +#	if defined(__NetBSD__)
> +#		define pthread_setname_np(t, s) pthread_set_name_np(t, s, NULL)

pthread_set_name_np doesn't exist on NetBSD while pthread_setname_np[1] does but requires 3 arguments. Additionally, the 3rd argument needs to be explicitly cast to (void *) to avoid compile error. See graphics/vkd3d/files/patch-libs_vkd3d_vkd3d__private.h for a simple example.

[1] https://netbsd.gw.com/cgi-bin/man-cgi?pthread_setname_np+3+NetBSD-current
Comment 5 Ting-Wei Lan 2020-03-21 07:18:16 UTC
(In reply to loic.blot from comment #3)
If you meant the 'undefined reference to environ' issue, just add -Db_lundef=false to the meson command line.

(In reply to Jan Beich from comment #4)
This patch is no longer needed if we want to upgrade to GLib 2.62 or higher versions. My patch is already merged upstream during the 2.62 cycle: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1072.
Comment 6 loic.blot 2020-03-21 18:48:09 UTC
I think if we can to ensure we can port recent gnome 3 we need upper glib, same for GTK3.
Is this possible to update to latest glib2 available ? 2.64.1 is the current version.
Comment 7 Ting-Wei Lan 2020-03-22 04:13:32 UTC
(In reply to loic.blot from comment #6)
If you mean whether it is possible to build the latest GLib on FreeBSD, then the answer is yes. FreeBSD is included in upstream CI setup, so build failure and test failure on FreeBSD can be caught very early.

If you mean whether it is possible to update GLib in FreeBSD ports, then I don't know the answer because I am not a maintainer. GLib is usually updated with GNOME in FreeBSD ports, but the version of GNOME in FreeBSD ports is very old. You can find development versions of GNOME ports on GitHub: https://github.com/freebsd/freebsd-ports-gnome/blob/gnome-3.32/devel/glib20/Makefile.
Comment 8 loic.blot 2020-03-22 11:35:06 UTC
Glib 2.64.0 compiled fine with your flag, thanks. 
I fixed the libintl conflict install but now i have missing symbols to fix, maybe a previous patch fixed them :) (note, i compiled a vanilla glib)
Comment 9 loic.blot 2020-03-24 07:36:36 UTC
Thanks for linking the tree.
I used the in place files for 2.62 and updated to 2.64 and the compilation works fine, gdm refuses to startup but i think it's due to the fact it's gdm 3.26 :) i may need a more recent gdk version now
Comment 10 loic.blot 2020-03-24 09:10:49 UTC
Following my previous comment, i dropped by error 3 lines on the previous pkg-plist, now they have been computed, i can confirm the glib 2.64.0 works properly with gnome 3.26 (i don't tested all, but gnome apps works, and gdm too).
you can find the PR here:
Comment 12 daniel.engberg.lists 2020-08-25 18:25:18 UTC
Sorry, wrong link to bugzilla