Viber is current distributed as a closed-source .deb package for Ubuntu.
Here is my (UPDATED: second) attempt to repackage it as a snap package.
name: viber-unofficial
version: '0.1'
summary: Free and secure calls and messages to anyone, anywhere
description: |
Authentic conversations, the way you like them
Deepen your relationships with Viber’s wide range
of communication features.
This is an unofficial snap package for Viber based on viber.deb
grade: stable
confinement: strict
apps:
viber:
command: desktop-launch $SNAP/opt/viber/Viber
plugs:
- x11
- desktop
- desktop-legacy
- wayland
- unity7
- network-bind
- network-observe
- home
- opengl
- gsettings
parts:
viber:
plugin: dump
source: http://download.cdn.viber.com/cdn/desktop/Linux/viber.deb
source-type: deb
after: [desktop-qt5]
build-attributes: [keep-execstack]
stage-packages:
- xdg-utils
- libxss1
- libpulse0
I am building now on Ubuntu 16.04 (in a LXD container, container image: ubuntu:16.04
).
Here is the output,
$ snapcraft
Preparing to pull desktop-qt5
Hit http://archive.ubuntu.com/ubuntu xenial InRelease
Hit http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit http://security.ubuntu.com/ubuntu xenial-security InRelease
Fetched 0 B in 0s (0 B/s)
Hit http://security.ubuntu.com/ubuntu xenial-security InRelease
Hit http://archive.ubuntu.com/ubuntu xenial InRelease
Hit http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Fetched 0 B in 0s (0 B/s)
Pulling desktop-qt5
Cloning into '/home/ubuntu/viber/parts/desktop-qt5/src'...
remote: Counting objects: 1142, done.
remote: Total 1142 (delta 0), reused 0 (delta 0), pack-reused 1142
Receiving objects: 100% (1142/1142), 188.26 KiB | 0 bytes/s, done.
Resolving deltas: 100% (597/597), done.
Checking connectivity... done.
'viber' has prerequisites that need to be staged: desktop-qt5
Preparing to build desktop-qt5
Building desktop-qt5
make FLAVOR=qt5 -j4
make FLAVOR=qt5 install DESTDIR=/home/ubuntu/viber/parts/desktop-qt5/install
install -D -m755 desktop-launch /home/ubuntu/viber/parts/desktop-qt5/install/bin/desktop-launch
install -D -m644 snappy-qt5.conf \
/home/ubuntu/viber/parts/desktop-qt5/install/etc/xdg/qtchooser/snappy-qt5.conf
install -D -m644 snappy-qt4.conf \
/home/ubuntu/viber/parts/desktop-qt5/install/etc/xdg/qtchooser/snappy-qt4.conf
install -D -m644 flavor-select /home/ubuntu/viber/parts/desktop-qt5/install/
Staging desktop-qt5
Preparing to pull viber
Hit http://archive.ubuntu.com/ubuntu xenial InRelease
Hit http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Hit http://security.ubuntu.com/ubuntu xenial-security InRelease
Fetched 0 B in 0s (0 B/s)
Get:1 libxss1_1.2.2-1_amd64.deb [8582 B]
Fetched 8582 B in 0s (0 B/s)
Pulling viber
Downloading 'viber.deb'[==================================================] 100%
Preparing to build viber
Building viber
Staging viber
Priming desktop-qt5
Priming viber
The execstacks are going to be cleared for the following files:
- /home/ubuntu/viber/prime/opt/viber/lib/libQt5WebEngineCore.so.5
To disable this behavior set `build-attributes: [keep-execstack]` for the part.
Snapping 'viber-unofficial' |
Snapped viber-unofficial_0.1_amd64.snap
When trying to run Viber, I get errors about missing libraries. It needs some additional tries to figure out the full list of missing libraries, so that I can add them to the staged package list in snapcraft.yaml.
Update: The following are the old error messages when trying to build the snap on 18.04. Still, do not know what I would get that issue but since snapcraft
can create packages on 16.04, I am using that one.
Here is the error message when trying to build in a Ubuntu 18.04 LXD container (ubuntu:18.04 container image).
$ snapcraft Skipping pull desktop-qt5 (already ran) Skipping build desktop-qt5 (already ran) Skipping stage desktop-qt5 (already ran) Skipping pull viber (already ran) Skipping build viber (already ran) Skipping stage viber (already ran) Priming desktop-qt5 The GLIBC version of the targeted core is 2.23. A newer libc will be required for the following files: - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/vmwgfx_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/virtio_gpu_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/nouveau_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/r600_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/r200_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/r300_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/lib/x86_64-linux-gnu/libbsd.so.0.8.7 (requires GLIBC 2.25) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/libexpatw.so.1.6.7 (requires GLIBC 2.25) - /home/ubuntu/viber/prime/lib/x86_64-linux-gnu/libexpat.so.1.6.7 (requires GLIBC 2.25) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/i965_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/i915_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/libxshmfence.so.1.0.0 (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/nouveau_vieux_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/radeon_dri.so (requires GLIBC 2.27) - /home/ubuntu/viber/prime/usr/lib/x86_64-linux-gnu/dri/kms_swrast_dri.so (requires GLIBC 2.27) 'libc6' is required inside the snap for this part to work properly. Add it as a `stage-packages` entry for this part.
Ubuntu 18.04 comes with GLIBC 2.27. The message says that the
core
image has GLIBC 2.23.
The required versions of GLIBC as shown in the messages are 2.27 and also 2.25.