forked from mirrors/nixpkgs
vk-messenger: 5.0.1 → 5.2.3, enable on darwin
This commit is contained in:
parent
6dca3a1ea6
commit
65974d5f68
|
@ -1,54 +1,73 @@
|
||||||
{ stdenv, lib, fetchurl, rpmextract, autoPatchelfHook
|
{ stdenv, lib, fetchurl, rpmextract, undmg, autoPatchelfHook
|
||||||
, xorg, gtk3, gnome2, nss, alsaLib, udev, libnotify
|
, xorg, gtk3, gnome2, nss, alsaLib, udev, libnotify
|
||||||
, wrapGAppsHook }:
|
, wrapGAppsHook }:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "5.0.1";
|
|
||||||
in stdenv.mkDerivation {
|
|
||||||
pname = "vk-messenger";
|
pname = "vk-messenger";
|
||||||
inherit version;
|
version = "5.2.3";
|
||||||
|
|
||||||
src = {
|
src = {
|
||||||
i686-linux = fetchurl {
|
i686-linux = fetchurl {
|
||||||
url = "https://desktop.userapi.com/rpm/master/vk-${version}.i686.rpm";
|
url = "https://desktop.userapi.com/rpm/master/vk-${version}.i686.rpm";
|
||||||
sha256 = "1ji23x13lzbkiqfrrwx1pj6gmms0p58cjmjc0y4g16kqhlxl60v6";
|
sha256 = "09zi2rzsank6lhw1z9yar1rp634y6qskvr2i0rvqg2fij7cy6w19";
|
||||||
};
|
};
|
||||||
x86_64-linux = fetchurl {
|
x86_64-linux = fetchurl {
|
||||||
url = "https://desktop.userapi.com/rpm/master/vk-${version}.x86_64.rpm";
|
url = "https://desktop.userapi.com/rpm/master/vk-${version}.x86_64.rpm";
|
||||||
sha256 = "01vvmia2qrxvrvavk9hkkyvfg4pg15m01grwb28884vy4nqw400y";
|
sha256 = "1m6saanpv1k5wc5s58jpf0wsgjsj7haabx8nycm1fjyhky1chirb";
|
||||||
|
};
|
||||||
|
x86_64-darwin = fetchurl {
|
||||||
|
url = "https://web.archive.org/web/20210310071550/https://desktop.userapi.com/mac/master/vk.dmg";
|
||||||
|
sha256 = "0j5qsr0fyl55d0x46xm4h2ykwr4y9z1dsllhqx5lnc15nc051s9b";
|
||||||
};
|
};
|
||||||
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
|
}.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}");
|
||||||
|
|
||||||
nativeBuildInputs = [ rpmextract autoPatchelfHook wrapGAppsHook ];
|
|
||||||
buildInputs = (with xorg; [
|
|
||||||
libXdamage libXtst libXScrnSaver libxkbfile
|
|
||||||
]) ++ [
|
|
||||||
gtk3 nss alsaLib
|
|
||||||
];
|
|
||||||
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
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Simple and Convenient Messaging App for VK";
|
description = "Simple and Convenient Messaging App for VK";
|
||||||
homepage = "https://vk.com/messenger";
|
homepage = "https://vk.com/messenger";
|
||||||
license = licenses.unfree;
|
license = licenses.unfree;
|
||||||
maintainers = [ maintainers.gnidorah ];
|
maintainers = [ maintainers.gnidorah ];
|
||||||
platforms = ["i686-linux" "x86_64-linux"];
|
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
|
||||||
|
]) ++ [ gtk3 nss alsaLib ];
|
||||||
|
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in if stdenv.isDarwin then darwin else linux
|
||||||
|
|
Loading…
Reference in a new issue