2020-11-05 13:22:08 +00:00
|
|
|
{ stdenv, lib, fetchurl, rpmextract, undmg, autoPatchelfHook
|
2021-11-13 22:28:25 +00:00
|
|
|
, xorg, gtk3, nss, alsa-lib, udev, libnotify
|
2019-12-21 10:11:49 +00:00
|
|
|
, wrapGAppsHook }:
|
2018-08-27 16:03:42 +00:00
|
|
|
|
|
|
|
let
|
2019-08-13 21:52:01 +00:00
|
|
|
pname = "vk-messenger";
|
2022-03-03 05:29:26 +00:00
|
|
|
version = "5.3.2";
|
2020-11-05 13:22:08 +00:00
|
|
|
|
2018-08-27 16:03:42 +00:00
|
|
|
src = {
|
|
|
|
i686-linux = fetchurl {
|
|
|
|
url = "https://desktop.userapi.com/rpm/master/vk-${version}.i686.rpm";
|
2022-03-03 05:29:26 +00:00
|
|
|
sha256 = "L0nE0zW4LP8udcE8uPy+cH9lLuQsUSq7cF13Gv7w2rI=";
|
2018-08-27 16:03:42 +00:00
|
|
|
};
|
|
|
|
x86_64-linux = fetchurl {
|
|
|
|
url = "https://desktop.userapi.com/rpm/master/vk-${version}.x86_64.rpm";
|
2022-03-03 05:29:26 +00:00
|
|
|
sha256 = "spDw9cfDSlIuCwOqREsqXC19tx62TiAz9fjIS9lYjSQ=";
|
2020-11-05 13:22:08 +00:00
|
|
|
};
|
|
|
|
x86_64-darwin = fetchurl {
|
2022-03-03 05:29:26 +00:00
|
|
|
url = "https://web.archive.org/web/20220302083827/https://desktop.userapi.com/mac/master/vk.dmg";
|
|
|
|
sha256 = "hxK8I9sF6njfCxSs1KBCHfnG81JGKUgHKAeFLtuCNe0=";
|
2018-08-27 16:03:42 +00:00
|
|
|
};
|
|
|
|
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-08-27 16:03:42 +00:00
|
|
|
description = "Simple and Convenient Messaging App for VK";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://vk.com/messenger";
|
2022-06-04 22:19:25 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2018-08-27 16:03:42 +00:00
|
|
|
license = licenses.unfree;
|
2021-04-29 05:21:13 +00: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 02:57:09 +00: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 16:03:42 +00:00
|
|
|
};
|
2020-11-05 13:22:08 +00:00
|
|
|
in if stdenv.isDarwin then darwin else linux
|