1 { stdenv, lib, fetchurl, rpmextract, undmg, autoPatchelfHook
2 , xorg, gtk3, nss, alsa-lib, udev, libnotify
6 pname = "vk-messenger";
10 i686-linux = fetchurl {
11 url = "https://desktop.userapi.com/rpm/master/vk-${version}.i686.rpm";
12 sha256 = "L0nE0zW4LP8udcE8uPy+cH9lLuQsUSq7cF13Gv7w2rI=";
14 x86_64-linux = fetchurl {
15 url = "https://desktop.userapi.com/rpm/master/vk-${version}.x86_64.rpm";
16 sha256 = "spDw9cfDSlIuCwOqREsqXC19tx62TiAz9fjIS9lYjSQ=";
18 x86_64-darwin = fetchurl {
19 url = "https://web.archive.org/web/20220302083827/https://desktop.userapi.com/mac/master/vk.dmg";
20 sha256 = "hxK8I9sF6njfCxSs1KBCHfnG81JGKUgHKAeFLtuCNe0=";
22 }.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
25 description = "Simple and Convenient Messaging App for VK";
26 homepage = "https://vk.com/messenger";
27 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
28 license = licenses.unfree;
30 platforms = ["i686-linux" "x86_64-linux" "x86_64-darwin"];
33 linux = stdenv.mkDerivation {
34 inherit pname version src meta;
36 nativeBuildInputs = [ rpmextract autoPatchelfHook wrapGAppsHook ];
37 buildInputs = (with xorg; [
38 libXdamage libXtst libXScrnSaver libxkbfile
39 ]) ++ [ gtk3 nss alsa-lib ];
41 runtimeDependencies = [ (lib.getLib udev) libnotify ];
48 substituteInPlace usr/share/applications/vk.desktop \
49 --replace /usr/share/pixmaps/vk.png vk
55 cp -r --parents bin $out
56 cp -r --parents share/vk $out
57 cp -r --parents share/applications $out
58 cp -r --parents share/pixmaps $out
62 darwin = stdenv.mkDerivation {
63 inherit pname version src meta;
65 nativeBuildInputs = [ undmg ];
70 mkdir -p $out/Applications
71 cp -r *.app $out/Applications
74 in if stdenv.isDarwin then darwin else linux