nixpkgs/pkgs/applications/networking/instant-messengers/vk-messenger/default.nix

54 lines
1.5 KiB
Nix
Raw Normal View History

2018-08-27 16:03:42 +00:00
{ stdenv, fetchurl, rpmextract, autoPatchelfHook
2019-10-26 10:36:51 +00:00
, xorg, gtk3, gnome2, nss, alsaLib, udev, libnotify }:
2018-08-27 16:03:42 +00:00
let
2019-10-26 10:36:51 +00:00
version = "4.5.2";
2018-08-27 16:03:42 +00:00
in stdenv.mkDerivation {
2019-08-13 21:52:01 +00:00
pname = "vk-messenger";
inherit version;
2018-08-27 16:03:42 +00:00
src = {
i686-linux = fetchurl {
url = "https://desktop.userapi.com/rpm/master/vk-${version}.i686.rpm";
2019-10-26 10:36:51 +00:00
sha256 = "11xsdmvd2diq3m61si87x2c08nap0vakcypm90wjmdjwayg3fdlw";
2018-08-27 16:03:42 +00:00
};
x86_64-linux = fetchurl {
url = "https://desktop.userapi.com/rpm/master/vk-${version}.x86_64.rpm";
2019-10-26 10:36:51 +00:00
sha256 = "0j65d6mwj6rxczi0p9fsr6jh37jxw3a3h6w67xwgdvibb7lf3gbb";
2018-08-27 16:03:42 +00:00
};
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
nativeBuildInputs = [ rpmextract autoPatchelfHook ];
buildInputs = (with xorg; [
libXdamage libXtst libXScrnSaver libxkbfile
]) ++ [
2019-10-26 10:36:51 +00:00
gtk3 nss alsaLib
2018-08-27 16:03:42 +00:00
];
runtimeDependencies = [ udev.lib 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
'';
meta = with stdenv.lib; {
description = "Simple and Convenient Messaging App for VK";
homepage = https://vk.com/messenger;
license = licenses.unfree;
maintainers = [ maintainers.gnidorah ];
platforms = ["i686-linux" "x86_64-linux"];
};
}