From b57c9866c5d0a290eba4660eb7fb6776d5f8120c Mon Sep 17 00:00:00 2001 From: Arseniy Seroka Date: Sat, 28 Mar 2015 03:13:12 +0300 Subject: [PATCH] viber: add pkg --- .../instant-messengers/viber/default.nix | 68 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/applications/networking/instant-messengers/viber/default.nix diff --git a/pkgs/applications/networking/instant-messengers/viber/default.nix b/pkgs/applications/networking/instant-messengers/viber/default.nix new file mode 100644 index 000000000000..d268cbc55cfb --- /dev/null +++ b/pkgs/applications/networking/instant-messengers/viber/default.nix @@ -0,0 +1,68 @@ +{ fetchurl, stdenv, dpkg, makeWrapper, xlibs, qt5, gstreamer, zlib, sqlite, libxslt }: + +assert stdenv.system == "x86_64-linux"; + +# BUG: viber tries to access contacts list and that causes segfault +# FIX: you have to do `chmod 444 ~/.ViberPC//Avatars` +# BUG: viber tries to it's downloads and that causes segfault +# FIX: you have to do `chmod 444 ~/Documents/ViberDownloads` +# TODO: fix bugs + +stdenv.mkDerivation rec { + name = "viber-${version}"; + version = "4.2.2.6"; + + src = fetchurl { + url = "http://download.cdn.viber.com/cdn/desktop/Linux/viber.deb"; + sha256 = "1fv269z9sni21lc1ka25jnxr9w8zfg1gfn2c7fnd8cdd5fm57d26"; + }; + + buildInputs = [ dpkg makeWrapper ]; + + unpackPhase = "true"; + + libPath = stdenv.lib.makeLibraryPath [ + qt5 + xlibs.libX11 + gstreamer + zlib + sqlite + xlibs.libXrender + libxslt + stdenv.cc.cc + xlibs.libXScrnSaver + xlibs.libXext + ]; + + installPhase = '' + dpkg-deb -x $src $out + mkdir -p $out/bin + mv $out/opt/viber/{Sound,icons,libqfacebook.so} $out + mv $out/opt/viber/Viber $out/viber + rm -rf $out/opt + ln -s $out/viber $out/bin/viber + mkdir -p usr/lib/mozilla/plugins + + patchelf \ + --set-rpath $libPath \ + $out/libqfacebook.so + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath $libPath:$out \ + $out/viber + + wrapProgram $out/viber --prefix LD_LIBRARY_PATH : $libPath:$out + ''; + + dontStrip = true; + dontPatchELF = true; + + meta = { + homepage = http://www.viber.com; + description = "An instant messaging and Voice over IP (VoIP) app"; + license = stdenv.lib.licenses.unfree; + platforms = stdenv.lib.platforms.linux; + maintainers = with stdenv.lib.maintainers; [ jagajaga ]; + }; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 657f3ac44c52..0c77c2ac2aaf 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11492,6 +11492,8 @@ let ssvnc = callPackage ../applications/networking/remote/ssvnc { }; + viber = callPackage ../applications/networking/instant-messengers/viber { }; + st = callPackage ../applications/misc/st { conf = config.st.conf or null; };