forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
55 lines
1.5 KiB
Nix
55 lines
1.5 KiB
Nix
{ stdenv, lib, fetchurl, rpmextract, autoPatchelfHook
|
|
, xorg, gtk3, gnome2, nss, alsaLib, udev, libnotify
|
|
, wrapGAppsHook }:
|
|
|
|
let
|
|
version = "5.0.1";
|
|
in stdenv.mkDerivation {
|
|
pname = "vk-messenger";
|
|
inherit version;
|
|
src = {
|
|
i686-linux = fetchurl {
|
|
url = "https://desktop.userapi.com/rpm/master/vk-${version}.i686.rpm";
|
|
sha256 = "1ji23x13lzbkiqfrrwx1pj6gmms0p58cjmjc0y4g16kqhlxl60v6";
|
|
};
|
|
x86_64-linux = fetchurl {
|
|
url = "https://desktop.userapi.com/rpm/master/vk-${version}.x86_64.rpm";
|
|
sha256 = "01vvmia2qrxvrvavk9hkkyvfg4pg15m01grwb28884vy4nqw400y";
|
|
};
|
|
}.${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; {
|
|
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"];
|
|
};
|
|
}
|