Viber not finding correct set of Qt5 libs...(SOLVED - kinda)

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

Viber not finding correct set of Qt5 libs...(SOLVED - kinda)

#1 Post by Mike Walsh »

Evening, all.

This evening, some advice about the 'LD_LIBRARY_PATH' would be much appreciated....at least, I think that's going to be the solution here. Or is it 'export LD_PRELOAD'? I confess, however, I'm not at all certain how you implement it.

---------------------------------------

I'm having a go at getting the Viber video-calling app to run in Xenialpup64 7.5. It comes as a .deb package, and installs without issue. Getting it to run, however, is proving a bit of a headache.....

Like so many of today's current crop of apps, it wants Qt5 in order to run. And, opening the .deb up with UExtract, I know exactly what the problem is. Viber installs to /opt/viber. All the required Qt5 libs are within the /opt/viber/libs directory. But it's not seeing them......and here's why.

I already have Qt5 installed in Xenial64 for the I-Nex system specs app to run (but's it not the particular version Viber wants.) I've already figured out this much about Qt stuff; correct versions are critical, and if more than one version exists, invariably the app gets confused...and quits in a huff with a 'segfault', or a 'stacktrace', or summat similar. So Viber is looking no further than /opt/qt5, and is finding the 'wrong' version. Which is exactly what running it from the terminal tells me.

"..../opt/qt5/xxxxxxx; xxxxxxx not found..."

From experience I know that what it really means is it can't find the specific version it wants, not that it doesn't exist!

-----------------------------------------

So, boys & girls; here's tonight's homework 'assignment' for ya. Explain to Uncle Mike how the 'LD_LIBRARY_PATH' variable stuff works, please.... (*bats eyelashes*) I've dissected a few Puppy apps that I know use this in one form or another, including the work battleshooter did to help me with the current Chrome packages (the self-contained NSS stuff).....but I'm no closer to figuring it out. For one, simple reason; in every single case, it seems to have been implemented in a different way..!!!

What would be the simplest way to 'point' Viber at the correct directory for its own Qt5 stuff, rather than stopping short at the 'system' one? Does every single Qt5 lib need to be individually named when you do this.....'cos that's what some people seem to have done..?

TIA. Any & all advice is very much appreciated, as always.


Mike. :wink:
Last edited by Mike Walsh on Tue 18 Dec 2018, 23:30, edited 2 times in total.

User avatar
6502coder
Posts: 677
Joined: Mon 23 Mar 2009, 18:07
Location: Western United States

#2 Post by 6502coder »

Hi Mike,

You are correct about how LD_LIBRARY_PATH works. Linux searches the directories listed in this environment variable, in order, stopping at the first place where it finds what it's looking for.

The standard solution, if you know the terminal command that runs Viber, is to run Viber from a shell script that looks like this:

Code: Select all

#!/bin/sh
LD_LIBRARY_PATH=/opt/viber/libs:$LD_LIBARARY_PATH viber whatever_args_needed
I'm assuming for the sake of argument that "viber whatever_args_needed" is the normal command line syntax for running viber. The script alters the LD_LIBRARY_PATH by inserting /opt/viber/libs to the head of the line, so to speak. But this change is ONLY effective for the command that follows on the same line. This is the safest solution because nothing else in your system is affected.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#3 Post by Mike Walsh »

Hi, 6502coder:-

O-kay. Well, the 'command' for running viber is simply /opt/viber/Viber, AFAIK. So; would I be right in thinking something like the following, then?

Code: Select all

#!/bin/sh
LD_LIBRARY_PATH=/opt/viber/lib:$LD_LIBRARY_PATH /opt/viber/Viber
Does that look like it would do what I want it to? Would I also be right in thinking that I could place this script in /usr/bin, and then 'call it' with the .desktop entry from /usr/share/applications.....and then with a bit of luck it'll do what I want it to and start Viber?

Hmm....

---------------------------

Right. Well, starting it from the terminal with the line I outlined above ends up with this:-

Code: Select all

root# LD_LIBRARY_PATH=/opt/viber/lib:$LD_LIBRARY_PATH /opt/viber/Viber
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
sh: xdg-mime: command not found
Qt WebEngine ICU data not found at /opt/viber/resources. Trying parent directory...
Qt WebEngine resources not found at /opt/viber/resources. Trying parent directory...
Qt WebEngine ICU data not found at /opt/viber/resources. Trying parent directory...
Qt WebEngine resources not found at /opt/viber/resources. Trying parent directory...
Segmentation fault
root#
For several seconds, I thought it was going to run.....then this lot all appeared in a hurry. Funny thing is, /opt/viber/resources doesn't actually appear to exist.....and a segfault is never good news.

I might give it a try in Bionicpup64.....but I'm not hopeful.

I hate Qt. Grrr...!


Mike. :wink:

User avatar
norgo
Posts: 388
Joined: Fri 13 Nov 2015, 17:19
Location: Germany
Contact:

qtwebengine

#4 Post by norgo »

Hey Mike don't be so aggressive ;-)

Are you sure that Qtwebengine is installed ?
Qtwebengine NOT be confused with Qtwebkit !

depending on QT installation path you should find somewhere

...../resources/qtwebengine_resources_100p.pak
...../resources/qtwebengine_resources_200p.pak
...../resources/qtwebengine_resources.pak
...../resources/icudtl.dat

where from you downloaded Viber ?
I've compiled qtwebengine under Slacko 700 (32bit) and could do a test.

btw. ( time for compilation ) with intel i7 and 100 percent cpu load all the time incredible 72 minutes

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#5 Post by Mike Walsh »

Hi. norgo.

Yep; qtwebengine is very definitely there. This is in the /opt/viber/lib directory:-


Image


And this is in /opt/viber itself:-


Image


There's your 'resources.pak' thingamajigs (plus a binary for the QtWebEngineProcess - whatever that is).

Download came from the viber.com downloads page, here:-

https://www.viber.com/download/

However.....

---------------------------

Your 'libqtwebengine' wouldn't be a lot of good, unfortunately, since this app, like many nowadays, is 64-bit only. And I've just noticed something, anyway; Viber, like certain others, will only allow the desktop app to work if you already have a mobile a/c up-and-running & activated.

I rather thought this was like the Telegram messaging app, that would work simply by the use of a mobile no. This, however, wants an a/c activated & working on a smartphone. I don't have a smartphone.....and I'm in no hurry to go out and get one. I don't even like them. I'm certainly not going to get one just on the off-chance I could get a desktop app working..!

So; I think I'm going to give this one a miss. Sorry to have wasted your time, boys & girls.....although I do at least have a handle on how this LD_LIBRARY_PATH stuff works now. :oops: But I'm going to mark it as 'Solved', since my original question has been answered.

Mike. :wink:

shungabubus
Posts: 3
Joined: Wed 22 Jun 2011, 18:02

Any update?

#6 Post by shungabubus »

Hello all, it is funny with Viber that their intellect ends at putting the same file (viber.deb) with different content so you never know what you download. Any luck with the latest version? Issue is similar but not the same exactly...

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

Re: Any update?

#7 Post by 666philb »

shungabubus wrote:Hello all, it is funny with Viber that their intellect ends at putting the same file (viber.deb) with different content so you never know what you download. Any luck with the latest version? Issue is similar but not the same exactly...
hi shungabubus,

the new viber.deb fires up now for me in bionicpup64 don't know if fully functional though as don't use it...

needed this script to run as spot

Code: Select all

#!/bin/sh
export LD_LIBRARY_PATH=/opt/viber/lib:$LD_LIBRARY_PATH
   APP=/opt/viber/Viber
#script to run $APP as spot...
ARGS=""
[ "$1" ] && while [ "$1" ]; do ARGS="$ARGS "$1""; shift; done
if [ $(id -u) -eq 0 ]; then
 [ $XAUTHORITY ] && cp $XAUTHORITY /root/spot/.Xauthority 2>/dev/null
 touch /root/spot/.Xauthority
 #following line is mostly there to catch any root:root files that may have got copied in...
 find /root/spot \( -not -user spot -or -not -group spot \) -exec chown -h spot:spot {} \; &
 export XAUTHORITY=/root/spot/.Xauthority  
 export XDG_CONFIG_HOME=/root/spot/.config
 export XDG_CACHE_HOME=/root/spot/.cache
 export XDG_DATA_HOME=/root/spot/.local/share
 exec su spot -s /bin/sh -c ""$APP" $ARGS"
else #precaution
 exec "$APP" "$ARGS"
fi
if no sound you might need to launch the script with apulse

Code: Select all

apulse /path/to/script
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

shungabubus
Posts: 3
Joined: Wed 22 Jun 2011, 18:02

Re: Any update?

#8 Post by shungabubus »

Hello 666philb BRILLIANT! works like a charm till chat, and I don't need more on this machine :D

Note: Audio is not available by design so I can't test the call function.

kuman11
Posts: 248
Joined: Tue 26 Dec 2017, 09:32

#9 Post by kuman11 »

Mike,

do u think Viber would work in Slacko 5.7 CE?

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#10 Post by Mike Walsh »

kuman11 wrote:Mike,

do u think Viber would work in Slacko 5.7 CE?
Nope. Definitely not. Read the thread; it's 64-bit only....

Nothing you can do about that, I'm afraid.


Mike. :wink:

Post Reply