nixpkgs/pkgs/applications/networking/instant-messengers/viber/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

112 lines
2.9 KiB
Nix
Raw Normal View History

2021-01-15 05:42:41 +00:00
{fetchurl, lib, stdenv, dpkg, makeWrapper,
alsa-lib, cups, curl, dbus, expat, fontconfig, freetype, glib, gst_all_1,
2020-11-25 09:33:11 +00:00
harfbuzz, libcap, libGL, libGLU, libpulseaudio, libxkbcommon, libxml2, libxslt,
2023-03-03 17:43:18 +00:00
nspr, nss, openssl_1_1, systemd, wayland, xorg, zlib, ...
}:
2015-03-28 00:13:12 +00:00
2019-08-13 21:52:01 +00:00
stdenv.mkDerivation {
pname = "viber";
version = "16.1.0.37";
2015-03-28 00:13:12 +00:00
src = fetchurl {
# Official link: https://download.cdn.viber.com/cdn/desktop/Linux/viber.deb
url = "https://web.archive.org/web/20211119123858/https://download.cdn.viber.com/cdn/desktop/Linux/viber.deb";
sha256 = "sha256-hOz+EQc2OOlLTPa2kOefPJMUyWvSvrgqgPgBKjWE3p8=";
2015-03-28 00:13:12 +00:00
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ dpkg ];
2015-03-28 00:13:12 +00:00
2019-06-19 15:45:34 +00:00
dontUnpack = true;
2015-03-28 00:13:12 +00:00
2021-01-15 05:42:41 +00:00
libPath = lib.makeLibraryPath [
alsa-lib
cups
curl
dbus
expat
fontconfig
freetype
glib
gst_all_1.gst-plugins-base
gst_all_1.gstreamer
harfbuzz
libcap
2020-11-25 09:33:11 +00:00
libGLU libGL
libpulseaudio
2020-11-25 09:33:11 +00:00
libxkbcommon
2017-01-23 12:31:37 +00:00
libxml2
libxslt
nspr
nss
openssl_1_1
stdenv.cc.cc
systemd
wayland
2015-03-28 00:13:12 +00:00
zlib
xorg.libICE
xorg.libSM
xorg.libX11
xorg.libxcb
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXScrnSaver
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
# 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_QPA_PLATFORM "xcb" \
--set QT_PLUGIN_PATH "$out/opt/viber/plugins" \
--set QT_XKB_CONFIG_ROOT "${xorg.xkeyboardconfig}/share/X11/xkb" \
--set QTCOMPOSE "${xorg.libX11.out}/share/X11/locale" \
--set QML2_IMPORT_PATH "$out/opt/viber/qml"
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 = {
homepage = "https://www.viber.com";
2015-03-28 00:13:12 +00:00
description = "An instant messaging and Voice over IP (VoIP) app";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
2021-01-15 05:42:41 +00:00
license = lib.licenses.unfree;
platforms = [ "x86_64-linux" ];
2021-01-15 05:42:41 +00:00
maintainers = with lib.maintainers; [ jagajaga ];
2015-03-28 00:13:12 +00:00
};
}