python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / security / keybase / gui.nix
blob6b218de45dc2d530745d0a683604276ff502124b
1 { stdenv, lib, fetchurl, alsa-lib, atk, cairo, cups, udev, libdrm, mesa
2 , dbus, expat, fontconfig, freetype, gdk-pixbuf, glib, gtk3, libappindicator-gtk3
3 , libnotify, nspr, nss, pango, systemd, xorg, autoPatchelfHook, wrapGAppsHook
4 , runtimeShell, gsettings-desktop-schemas }:
6 let
7   versionSuffix = "20220610191041.a459abf326";
8 in
10 stdenv.mkDerivation rec {
11   pname = "keybase-gui";
12   version = "6.0.2"; # Find latest version from https://prerelease.keybase.io/deb/dists/stable/main/binary-amd64/Packages
14   src = fetchurl {
15     url = "https://s3.amazonaws.com/prerelease.keybase.io/linux_binaries/deb/keybase_${version + "-" + versionSuffix}_amd64.deb";
16     hash = "sha256-FMhbMSuJHq5d5E0dTVAk02y85UXmhtKZYk4qcbnhRxI=";
17   };
19   nativeBuildInputs = [
20     autoPatchelfHook
21     wrapGAppsHook
22   ];
24   buildInputs = [
25     alsa-lib
26     atk
27     cairo
28     cups
29     dbus
30     expat
31     fontconfig
32     freetype
33     gdk-pixbuf
34     glib
35     gsettings-desktop-schemas
36     gtk3
37     libappindicator-gtk3
38     libnotify
39     nspr
40     nss
41     pango
42     systemd
43     xorg.libX11
44     xorg.libXScrnSaver
45     xorg.libXcomposite
46     xorg.libXcursor
47     xorg.libXdamage
48     xorg.libXext
49     xorg.libXfixes
50     xorg.libXi
51     xorg.libXrandr
52     xorg.libXrender
53     xorg.libXtst
54     xorg.libxcb
55     libdrm
56     mesa.out
57   ];
59   runtimeDependencies = [
60     (lib.getLib udev)
61     libappindicator-gtk3
62   ];
64   dontBuild = true;
65   dontConfigure = true;
66   dontPatchELF = true;
68   unpackPhase = ''
69     ar xf $src
70     tar xf data.tar.xz
71   '';
73   installPhase = ''
74     mkdir -p $out/bin
75     mv usr/share $out/share
76     mv opt/keybase $out/share/
78     cat > $out/bin/keybase-gui <<EOF
79     #!${runtimeShell}
81     checkFailed() {
82       if [ "\$NIX_SKIP_KEYBASE_CHECKS" = "1" ]; then
83         return
84       fi
85       echo "Set NIX_SKIP_KEYBASE_CHECKS=1 if you want to skip this check." >&2
86       exit 1
87     }
89     if [ ! -S "\$XDG_RUNTIME_DIR/keybase/keybased.sock" ]; then
90       echo "Keybase service doesn't seem to be running." >&2
91       echo "You might need to run: keybase service" >&2
92       checkFailed
93     fi
95     if [ -z "\$(keybase status | grep kbfsfuse)" ]; then
96       echo "Could not find kbfsfuse client in keybase status." >&2
97       echo "You might need to run: kbfsfuse" >&2
98       checkFailed
99     fi
101     exec $out/share/keybase/Keybase "\$@"
102     EOF
103     chmod +x $out/bin/keybase-gui
105     substituteInPlace $out/share/applications/keybase.desktop \
106       --replace run_keybase $out/bin/keybase-gui
107   '';
109   meta = with lib; {
110     homepage = "https://www.keybase.io/";
111     description = "The Keybase official GUI";
112     platforms = [ "x86_64-linux" ];
113     maintainers = with maintainers; [ avaq rvolosatovs puffnfresh np Br1ght0ne shofius ];
114     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
115     license = licenses.bsd3;
116   };