@@ -0,0 +1,53 @@
1+{ stdenv, fetchurl, rpmextract, autoPatchelfHook
2+, xorg, gtk2, gnome2, nss, alsaLib, udev, libnotify }:
3+
4+let
5+ version = "3.9.0";
6+in stdenv.mkDerivation {
7+ name = "vk-messenger-${version}";
8+ src = {
9+ i686-linux = fetchurl {
10+ url = "https://desktop.userapi.com/rpm/master/vk-${version}.i686.rpm";
11+ sha256 = "150qjj6ccbdp3gxs99jbzp27in1y8qkngn7jgb9za61pm4j70va3";
12+ };
13+ x86_64-linux = fetchurl {
14+ url = "https://desktop.userapi.com/rpm/master/vk-${version}.x86_64.rpm";
15+ sha256 = "04lavv614qhj17zccpdih4k6ghj21nd0s8qxbkxkqb1jb0z8dfz9";
16+ };
17+ }.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
18+
19+ nativeBuildInputs = [ rpmextract autoPatchelfHook ];
20+ buildInputs = (with xorg; [
21+ libXdamage libXtst libXScrnSaver libxkbfile
22+ ]) ++ [
23+ gtk2 gnome2.GConf nss alsaLib
24+ ];
25+ runtimeDependencies = [ udev.lib libnotify ];
26+
27+ unpackPhase = ''
28+ rpmextract $src
29+ '';
30+
31+ buildPhase = ''
32+ substituteInPlace usr/share/applications/vk.desktop \
33+ --replace /usr/share/pixmaps/vk.png vk
34+ '';
35+
36+ installPhase = ''
37+ mkdir $out
38+ cd usr
39+ cp -r --parents bin $out
40+ cp -r --parents share/vk $out
41+ cp -r --parents share/applications $out
42+ cp -r --parents share/pixmaps $out
43+ '';
44+
45+ meta = with stdenv.lib; {
46+ description = "Simple and Convenient Messaging App for VK";
47+ homepage = https://vk.com/messenger;
48+ license = licenses.unfree;
49+ maintainers = [ maintainers.gnidorah ];
50+ platforms = ["i686-linux" "x86_64-linux"];
51+ hydraPlatforms = [];
52+ };
53+}