2020-11-05 13:22:08 +00:00
|
|
|
{ stdenv, lib, fetchurl, rpmextract, undmg, autoPatchelfHook
|
2021-06-10 03:57:09 +01:00
|
|
|
, xorg, gtk3, gnome2, nss, alsa-lib, udev, libnotify
|
2019-12-21 10:11:49 +00:00
|
|
|
, wrapGAppsHook }:
|
2018-08-27 17:03:42 +01:00
|
|
|
|
|
|
|
let
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "vk-messenger";
|
2020-11-05 13:22:08 +00:00
|
|
|
version = "5.2.3";
|
|
|
|
|
2018-08-27 17:03:42 +01:00
|
|
|
src = {
|
|
|
|
i686-linux = fetchurl {
|
|
|
|
url = "https://desktop.userapi.com/rpm/master/vk-${version}.i686.rpm";
|
2020-11-05 13:22:08 +00:00
|
|
|
sha256 = "09zi2rzsank6lhw1z9yar1rp634y6qskvr2i0rvqg2fij7cy6w19";
|
2018-08-27 17:03:42 +01:00
|
|
|
};
|
|
|
|
x86_64-linux = fetchurl {
|
|
|
|
url = "https://desktop.userapi.com/rpm/master/vk-${version}.x86_64.rpm";
|
2020-11-05 13:22:08 +00:00
|
|
|
sha256 = "1m6saanpv1k5wc5s58jpf0wsgjsj7haabx8nycm1fjyhky1chirb";
|
|
|
|
};
|
|
|
|
x86_64-darwin = fetchurl {
|
|
|
|
url = "https://web.archive.org/web/20210310071550/https://desktop.userapi.com/mac/master/vk.dmg";
|
|
|
|
sha256 = "0j5qsr0fyl55d0x46xm4h2ykwr4y9z1dsllhqx5lnc15nc051s9b";
|
2018-08-27 17:03:42 +01:00
|
|
|
};
|
|
|
|
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-08-27 17:03:42 +01:00
|
|
|
description = "Simple and Convenient Messaging App for VK";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://vk.com/messenger";
|
2018-08-27 17:03:42 +01:00
|
|
|
license = licenses.unfree;
|
2021-04-29 06:21:13 +01:00
|
|
|
maintainers = [ ];
|
2020-11-05 13:22:08 +00:00
|
|
|
platforms = ["i686-linux" "x86_64-linux" "x86_64-darwin"];
|
|
|
|
};
|
|
|
|
|
|
|
|
linux = stdenv.mkDerivation {
|
|
|
|
inherit pname version src meta;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ rpmextract autoPatchelfHook wrapGAppsHook ];
|
|
|
|
buildInputs = (with xorg; [
|
|
|
|
libXdamage libXtst libXScrnSaver libxkbfile
|
2021-06-10 03:57:09 +01:00
|
|
|
]) ++ [ gtk3 nss alsa-lib ];
|
2020-11-05 13:22:08 +00:00
|
|
|
|
|
|
|
runtimeDependencies = [ (lib.getLib udev) libnotify ];
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
rpmextract $src
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
substituteInPlace usr/share/applications/vk.desktop \
|
|
|
|
--replace /usr/share/pixmaps/vk.png vk
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
cd usr
|
|
|
|
cp -r --parents bin $out
|
|
|
|
cp -r --parents share/vk $out
|
|
|
|
cp -r --parents share/applications $out
|
|
|
|
cp -r --parents share/pixmaps $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
darwin = stdenv.mkDerivation {
|
|
|
|
inherit pname version src meta;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ undmg ];
|
|
|
|
|
|
|
|
sourceRoot = ".";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -r *.app $out/Applications
|
|
|
|
'';
|
2018-08-27 17:03:42 +01:00
|
|
|
};
|
2020-11-05 13:22:08 +00:00
|
|
|
in if stdenv.isDarwin then darwin else linux
|