python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / admin / realvnc-vnc-viewer / default.nix
blobf7a8f7ca92f481a940b002bf7b8f250ec6a9f835
1 { lib, stdenv, fetchurl, autoPatchelfHook, rpmextract, libX11, libXext }:
3 stdenv.mkDerivation rec {
4   pname = "realvnc-vnc-viewer";
5   version = "6.22.515";
7   src = {
8     "x86_64-linux" = fetchurl {
9       url = "https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-${version}-Linux-x64.rpm";
10       sha256 = "1l9kfmb1695pv2v9hm8z5yr7y5yhadbbs61s4yf9ksvvfypzwrpn";
11     };
12     "i686-linux" = fetchurl {
13       url = "https://www.realvnc.com/download/file/viewer.files/VNC-Viewer-${version}-Linux-x86.rpm";
14       sha256 = "15fi1siwbsxmy7qi6f8r8ym346a8mx3kqcp9mvwvx39wm3ija6dh";
15     };
16   }.${stdenv.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
18   nativeBuildInputs = [ autoPatchelfHook rpmextract ];
19   buildInputs = [ libX11 libXext ];
21   unpackPhase = ''
22     rpmextract $src
23   '';
25   postPatch = ''
26     substituteInPlace ./usr/share/applications/realvnc-vncviewer.desktop \
27       --replace /usr/share/icons/hicolor/48x48/apps/vncviewer48x48.png vncviewer48x48.png
28     substituteInPlace ./usr/share/mimelnk/application/realvnc-vncviewer-mime.desktop \
29       --replace /usr/share/icons/hicolor/48x48/apps/vncviewer48x48.png vncviewer48x48.png
30   '';
32   installPhase = ''
33     runHook preInstall
35     mv usr $out
37     runHook postInstall
38   '';
40   meta = with lib; {
41     description = "VNC remote desktop client software by RealVNC";
42     homepage = "https://www.realvnc.com/en/connect/download/viewer/";
43     mainProgram = "vncviewer";
44     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
45     license = {
46       fullName = "VNC Connect End User License Agreement";
47       url = "https://static.realvnc.com/media/documents/LICENSE-4.0a_en.pdf";
48       free = false;
49     };
50     maintainers = with maintainers; [ emilytrau ];
51     platforms = [ "x86_64-linux" "i686-linux" ];
52   };