I'm not sure if this patch can be applied as is, but there is a problem
with gtk_init.
gtk_init will terminate the program if the GUI cannot be initialized.
This can make syntax check impossible, which is too bad a consequence.
Hack gtk_init to invoke gtk_init_check in syntax check mode.
(old behaviour)
$ env -i perl -c -e 'use Gtk2 -init'
Gtk-WARNING **: cannot open display: at /usr/lib/perl5/vendor_perl/x86_64-linux/Gtk2.pm line 138.
$
(new behaviour)
$ env -i perl -c -e 'use Gtk2 -init' -Mblib
-e syntax OK
$
---
xs/Gtk2.xs | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/xs/Gtk2.xs b/xs/Gtk2.xs
index 8fc0699..c9c06ff 100644
--- a/xs/Gtk2.xs
+++ b/xs/Gtk2.xs
@@ -328,7 +328,7 @@ gtk_init (class=NULL)
CODE:
pargv = gperl_argv_new ();
- if (ix == 2) {
+ if (ix == 2 || PL_minus_c) {
RETVAL = gtk_init_check (&pargv->argc, &pargv->argv);
} else {
gtk_init (&pargv->argc, &pargv->argv);