here is a dirty workaround that could help some other person by increasing the minimal requirement version for GVariant to 2.28 (no guarantee this is high enough)
On Wed Nov 28 12:16:04 2018, atoomic wrote:
Show quoted text> undefined symbol: g_variant_lookup_value
>
> This is probably coming from the fact that Gvariant.xs is not compiled
>
> if (ExtUtils::PkgConfig->atleast_version ('glib-2.0', '2.24.0')) {
> push @xs_files, 'GVariant.xs';
> }
>
> If I bump the requirement to be a higher version (using an arbitrary
> number 2.28.0 for example) this can then be built
> will submit the patch in a few
>
> On Wed Nov 28 12:05:03 2018, atoomic wrote:
> > I can successfully build Glib package on CentOS 7 but the .so file
> > cannot be loaded on a CentOS 6 server
> >
> > ------
> > make test
> > "/usr/local/cpanel/3rdparty/perl/526/bin/perl"
> > -MExtUtils::Command::MM
> > -e 'cp_nonempty' -- Glib.bs blib/arch/auto/Glib/Glib.bs 644
> > PERL_DL_NONLAZY=1 "/usr/local/cpanel/3rdparty/perl/526/bin/perl" "-
> > MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef
> > *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')"
> > t/*.t
> > t/1.t ...................... 1/26
> > # Failed test 'use Glib;'
> > # at t/1.t line 17.
> > # Tried to use 'Glib'.
> > # Error: Can't load '/home/rpmbuild/rpm-build/BUILD/Glib-
> > 1.328/blib/arch/auto/Glib/Glib.so' for module Glib:
> > /home/rpmbuild/rpm-build/BUILD/Glib-
> > 1.328/blib/arch/auto/Glib/Glib.so:
> > undefined symbol: g_variant_lookup_value at
> > /usr/local/cpanel/3rdparty/perl/526/lib64/perl5/5.26.0/x86_64-linux-
> > 64int/DynaLoader.pm line 190.
> > # at t/1.t line 17.
> > # Compilation failed in require at t/1.t line 17.
> > # BEGIN failed--compilation aborted at t/1.t line 17.
> > Bareword "Glib::major_version" not allowed while "strict subs" in use
> > at t/1.t line 21.
> > Bareword "Glib::minor_version" not allowed while "strict subs" in use
> > at t/1.t line 22.
> > Bareword "Glib::micro_version" not allowed while "strict subs" in use
> > at t/1.t line 23.
> > Bareword "Glib::MAJOR_VERSION" not allowed while "strict subs" in use
> > at t/1.t line 29.
> > Bareword "Glib::MINOR_VERSION" not allowed while "strict subs" in use
> > at t/1.t line 30.
> > Bareword "Glib::MICRO_VERSION" not allowed while "strict subs" in use
> > at t/1.t line 31.
> > Bareword "Glib::get_user_name" not allowed while "strict subs" in use
> > at t/1.t line 33.
> > Bareword "Glib::get_real_name" not allowed while "strict subs" in use
> > at t/1.t line 34.
> > Bareword "Glib::get_home_dir" not allowed while "strict subs" in use
> > at t/1.t line 35.
> > Bareword "Glib::get_tmp_dir" not allowed while "strict subs" in use
> > at
> > t/1.t line 36.
> > Execution of t/1.t aborted due to compilation errors.
> > # Looks like your test exited with 255 just after 1.
> > t/1.t ...................... Dubious, test returned 255 (wstat 65280,
> > 0xff00)
> > Failed 26/26 subtests
> > ---------
> >
> > ** Server config **
> > -------------------
> > using CentOS 6 with Perl v5.26.0 & glib2 2.26.1
> >
> > yum info glib2
> > Loaded plugins: fastestmirror
> > Loading mirror speeds from cached hostfile
> > * epel: mirror.compevo.com
> > Installed Packages
> > Name : glib2
> > Arch : x86_64
> > Version : 2.26.1
> > Release : 7.el6_5
> > Size : 6.8 M
> > Repo : installed
> > From repo : updates
> > Summary : A library of handy utility functions
> > URL :
http://www.gtk.org
> > License : LGPLv2+
> > Description : GLib is the low-level core library that forms the basis
> > for projects
> > : such as GTK+ and GNOME. It provides data structure
> > handling for C,
> > : portability wrappers, and interfaces for such runtime
> > functionality
> > : as an event loop, threads, dynamic loading, and an
> > object system.
commit 04d952e94e7944b50b93274f9d2659575e960664 (HEAD -> patches)
Author: Nicolas R <me@eboxr.com>
Date: Wed Nov 28 11:23:12 2018 -0600
Bump minimal requirement for GVariant
Fail to compile Glib on CentOS 6 using
glib2 2.26.1
This commit bump the requirement it to an arbitrary
higher version. (no guarantee it's high enough).
diff --git a/Glib.xs b/Glib.xs
index 8d54088ba..97d0c5702 100644
--- a/Glib.xs
+++ b/Glib.xs
@@ -470,9 +470,9 @@ BOOT:
#if GLIB_CHECK_VERSION (2, 12, 0)
GPERL_CALL_BOOT (boot_Glib__BookmarkFile);
#endif /* GLIB_CHECK_VERSION (2, 12, 0) */
-#if GLIB_CHECK_VERSION (2, 24, 0)
+#if GLIB_CHECK_VERSION (2, 28, 0)
GPERL_CALL_BOOT (boot_Glib__Variant);
-#endif /* GLIB_CHECK_VERSION (2, 24, 0) */
+#endif /* GLIB_CHECK_VERSION (2, 28, 0) */
/* make sure that we're running/linked against a version at least as
* new as we built against, otherwise bad things will happen. */
if ((((int)glib_major_version) < GLIB_MAJOR_VERSION)
diff --git a/Makefile.PL b/Makefile.PL
index 64b05ca01..1eea3b07e 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -89,7 +89,7 @@ if (ExtUtils::PkgConfig->atleast_version ('glib-2.0', '2.12.0')) {
push @xs_files, 'GBookmarkFile.xs';
}
-if (ExtUtils::PkgConfig->atleast_version ('glib-2.0', '2.24.0')) {
+if (ExtUtils::PkgConfig->atleast_version ('glib-2.0', '2.28.0')) {
push @xs_files, 'GVariant.xs';
}
diff --git a/gperl-gtypes.h b/gperl-gtypes.h
index 7c5573ecb..73c1ba0ea 100644
--- a/gperl-gtypes.h
+++ b/gperl-gtypes.h
@@ -79,7 +79,7 @@ GType gperl_spawn_error_get_type (void) G_GNUC_CONST;
#define GPERL_TYPE_THREAD_ERROR gperl_thread_error_get_type ()
GType gperl_thread_error_get_type (void) G_GNUC_CONST;
-#if GLIB_CHECK_VERSION (2, 24, 0)
+#if GLIB_CHECK_VERSION (2, 28, 0)
#define GPERL_TYPE_VARIANT_PARSE_ERROR gperl_variant_parse_error_get_type ()
GType gperl_variant_parse_error_get_type (void);
#endif
diff --git a/gperl.h b/gperl.h
index c32be5b14..9f2b2df85 100644
--- a/gperl.h
+++ b/gperl.h
@@ -364,7 +364,7 @@ SV * newSVGUserDirectory (GUserDirectory dir);
/*
* --- GVariant ---------------------------------------------------------------
*/
-#if GLIB_CHECK_VERSION (2, 24, 0)
+#if GLIB_CHECK_VERSION (2, 28, 0)
typedef GVariant GVariant_noinc;
SV * newSVGVariant (GVariant * variant);
diff --git a/t/variant.t b/t/variant.t
index 717ba2d90..41b51c047 100644
--- a/t/variant.t
+++ b/t/variant.t
@@ -13,10 +13,10 @@ use constant {
MAX_UINT64 => "18446744073709551615"
};
-if (Glib->CHECK_VERSION (2, 24, 0)) {
+if (Glib->CHECK_VERSION (2, 28, 0)) {
plan tests => 223;
} else {
- plan skip_all => 'Need libglib >= 2.24';
+ plan skip_all => 'Need libglib >= 2.28';
}
my @leafs = (