2016-07-14 13:32:54 +01:00
|
|
|
{fetchurl, stdenv, dpkg, makeWrapper,
|
|
|
|
alsaLib, cups, curl, dbus, expat, fontconfig, freetype, glib, gst_all_1, harfbuzz, libcap,
|
2019-11-10 16:44:34 +00:00
|
|
|
libpulseaudio, libxml2, libxslt, libGLU, libGL, nspr, nss, openssl, systemd, wayland, xorg, zlib, ...
|
2016-07-14 13:32:54 +01:00
|
|
|
}:
|
2015-03-28 00:13:12 +00:00
|
|
|
|
2019-08-13 22:52:01 +01:00
|
|
|
stdenv.mkDerivation {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "viber";
|
2017-11-13 19:24:43 +00:00
|
|
|
version = "7.0.0.1035";
|
2015-03-28 00:13:12 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://download.cdn.viber.com/cdn/desktop/Linux/viber.deb";
|
2017-11-13 19:24:43 +00:00
|
|
|
sha256 = "06mp2wvqx4y6rd5gs2mh442qcykjrrvwnkhlpx0lara331i2p0lj";
|
2015-03-28 00:13:12 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ dpkg makeWrapper ];
|
|
|
|
|
2019-06-19 16:45:34 +01:00
|
|
|
dontUnpack = true;
|
2015-03-28 00:13:12 +00:00
|
|
|
|
|
|
|
libPath = stdenv.lib.makeLibraryPath [
|
2016-07-14 13:32:54 +01:00
|
|
|
alsaLib
|
|
|
|
cups
|
|
|
|
curl
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
glib
|
|
|
|
gst_all_1.gst-plugins-base
|
|
|
|
gst_all_1.gstreamer
|
|
|
|
harfbuzz
|
|
|
|
libcap
|
|
|
|
libpulseaudio
|
2017-01-23 12:31:37 +00:00
|
|
|
libxml2
|
|
|
|
libxslt
|
2019-11-10 16:44:34 +00:00
|
|
|
libGLU libGL
|
2016-07-14 13:32:54 +01:00
|
|
|
nspr
|
|
|
|
nss
|
2017-01-23 12:31:37 +00:00
|
|
|
openssl
|
2016-07-14 13:32:54 +01:00
|
|
|
stdenv.cc.cc
|
2016-09-05 17:59:00 +01:00
|
|
|
systemd
|
2016-07-14 13:32:54 +01:00
|
|
|
wayland
|
2015-03-28 00:13:12 +00:00
|
|
|
zlib
|
2016-07-14 13:32:54 +01:00
|
|
|
|
|
|
|
xorg.libICE
|
|
|
|
xorg.libSM
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
2015-09-15 10:26:18 +01:00
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXScrnSaver
|
2016-07-14 13:32:54 +01:00
|
|
|
xorg.libXtst
|
|
|
|
xorg.xcbutilimage
|
|
|
|
xorg.xcbutilkeysyms
|
|
|
|
xorg.xcbutilrenderutil
|
|
|
|
xorg.xcbutilwm
|
|
|
|
]
|
|
|
|
;
|
2015-03-28 00:13:12 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
dpkg-deb -x $src $out
|
|
|
|
mkdir -p $out/bin
|
2016-07-14 13:32:54 +01:00
|
|
|
|
|
|
|
# Soothe nix-build "suspicions"
|
|
|
|
chmod -R g-w $out
|
|
|
|
|
|
|
|
for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \) ); do
|
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true
|
|
|
|
patchelf --set-rpath $libPath:$out/opt/viber/lib $file || true
|
|
|
|
done
|
|
|
|
|
|
|
|
# qt.conf is not working, so override everything using environment variables
|
|
|
|
wrapProgram $out/opt/viber/Viber \
|
|
|
|
--set QT_PLUGIN_PATH "$out/opt/viber/plugins" \
|
|
|
|
--set QT_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" \
|
2016-08-23 02:37:59 +01:00
|
|
|
--set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale"
|
2016-07-14 13:32:54 +01:00
|
|
|
ln -s $out/opt/viber/Viber $out/bin/viber
|
|
|
|
|
|
|
|
mv $out/usr/share $out/share
|
|
|
|
rm -rf $out/usr
|
|
|
|
|
|
|
|
# Fix the desktop link
|
|
|
|
substituteInPlace $out/share/applications/viber.desktop \
|
|
|
|
--replace /opt/viber/Viber $out/opt/viber/Viber \
|
|
|
|
--replace /usr/share/ $out/share/
|
2015-03-28 00:13:12 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
meta = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.viber.com";
|
2015-03-28 00:13:12 +00:00
|
|
|
description = "An instant messaging and Voice over IP (VoIP) app";
|
|
|
|
license = stdenv.lib.licenses.unfree;
|
2018-05-03 06:58:11 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2015-03-28 00:13:12 +00:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ jagajaga ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|