LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Is it doable to have two glib2 versions installed? (https://www.linuxquestions.org/questions/slackware-14/is-it-doable-to-have-two-glib2-versions-installed-4175649816/)

Didier Spaier 03-08-2019 02:41 PM

Is it doable to have two glib2 versions installed?
 
Hello,

Currently glib2-2.46.2 is included in Slackware version 14.2

However I want to upgrade a software to a version that needs glib2 >= 2.48.0.

Upgrading glib2 is easy but I fear that would break other software that depend on it. Am I right?

If the answer is yes, is there a way to make two versions of glib2 coexist, and then how?

Maybe something like installing the newer version in another location and indicate it to the dependent software that needs this one at build time, although that'd make maintenance harder.

Any clue appreciated.

dugan 03-08-2019 02:50 PM

Install the newer glib2 to /usr/lib64/theSoftware/, and have it in the same package as theSoftware. Set "-Wl,-rpath" when building theSoftware to get it to load glib2 from there.

Didier Spaier 03-08-2019 02:59 PM

Thanks Dugan. But if I have several software needing a newer glib2 version, I would have to do it for each?

dugan 03-08-2019 04:32 PM

That's what I'd recommend, yeah.

Didier Spaier 03-09-2019 03:23 AM

Well, actually I just need glib2-2.48.2 to be able to upgrade the whole a11y stack from ftp.gnome.org including pygobject which is what I want to do. The commit that brings the bump of required glib2 from 2.38.0 to 2.48.0 in the setup.py of pygobject says:
Quote:

build: bump glib requirement to 2.48

It's the one shipped with Ubuntu 16.04, which is the oldest distro we run test on
As the NEWS file in the source archive of glib2 does not mention any backward incompatible change between 2.46 and 2.48.2, I feel safe to just upgrade to this version, applying among the patches applied by Ubuntu at least those that address a CVE.

I don't mark this thread as [SOLVED] though as this does not the address the question asked in its title.

ehartman 03-09-2019 07:11 AM

Quote:

Originally Posted by Didier Spaier (Post 5971819)
Upgrading glib2 is easy but I fear that would break other software that depend on it. Am I right?

If the answer is yes, is there a way to make two versions of glib2 coexist, and then how?

I think it will not break anything, but, of course, you could install both, versioned. Just the symlinks will stay pointed to one of them only so by default all applications will use that one:
Code:

/usr/lib/libglib-2.0.so -> libglib-2.0.so.0.<version>
/usr/lib/libglib-2.0.so.0 -> libglib-2.0.so.0.<version>

so all applications that need the other will need to have the exact version specified, either when compiling/linking or when executing, as by default the references are to the links, not to the actual specific library.

Edit:
What you could try is save the info of the current symbolic links and then install, not upgrade, the newer version. Then the links will point to the newer one but when you do get problems you can always restore the original symlinks.
The glib2-2.<version> script will also do this.


All times are GMT -5. The time now is 07:15 AM.