nixpkgs/pkgs/tools/security/keybase/gui.nix

113 lines
2.6 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, alsaLib, atk, cairo, cups, udev
2019-05-22 12:03:39 +01:00
, dbus, expat, fontconfig, freetype, gdk-pixbuf, glib, gtk3
, libnotify, nspr, nss, pango, systemd, xorg, autoPatchelfHook, wrapGAppsHook
, runtimeShell, gsettings-desktop-schemas }:
let
2019-07-04 02:32:34 +01:00
versionSuffix = "20190612201656.952fee6c59";
in
stdenv.mkDerivation rec {
name = "keybase-gui-${version}";
2019-07-04 02:32:34 +01:00
version = "4.1.0"; # Find latest version from https://prerelease.keybase.io/deb/dists/stable/main/binary-amd64/Packages
src = fetchurl {
url = "https://s3.amazonaws.com/prerelease.keybase.io/linux_binaries/deb/keybase_${version + "-" + versionSuffix}_amd64.deb";
2019-07-04 02:32:34 +01:00
sha256 = "0jwxw75yz7sbvfqw2aksa3p7jlcv817743fl59qk6rq1x9ag6qpx";
};
nativeBuildInputs = [
autoPatchelfHook
wrapGAppsHook
];
buildInputs = [
alsaLib
atk
cairo
cups
dbus
expat
fontconfig
freetype
2019-05-22 12:03:39 +01:00
gdk-pixbuf
glib
gsettings-desktop-schemas
gtk3
libnotify
nspr
nss
pango
systemd
xorg.libX11
xorg.libXScrnSaver
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
xorg.libxcb
];
runtimeDependencies = [
udev.lib
];
dontBuild = true;
dontConfigure = true;
dontPatchElf = true;
unpackPhase = ''
ar xf $src
tar xf data.tar.xz
'';
installPhase = ''
mkdir -p $out/bin
mv usr/share $out/share
mv opt/keybase $out/share/
cat > $out/bin/keybase-gui <<EOF
#!${runtimeShell}
checkFailed() {
if [ "\$NIX_SKIP_KEYBASE_CHECKS" = "1" ]; then
return
fi
echo "Set NIX_SKIP_KEYBASE_CHECKS=1 if you want to skip this check." >&2
exit 1
}
if [ ! -S "\$XDG_RUNTIME_DIR/keybase/keybased.sock" ]; then
echo "Keybase service doesn't seem to be running." >&2
echo "You might need to run: keybase service" >&2
checkFailed
fi
if [ -z "\$(keybase status | grep kbfsfuse)" ]; then
echo "Could not find kbfsfuse client in keybase status." >&2
echo "You might need to run: kbfsfuse" >&2
checkFailed
fi
exec $out/share/keybase/Keybase "\$@"
EOF
chmod +x $out/bin/keybase-gui
substituteInPlace $out/share/applications/keybase.desktop \
--replace run_keybase $out/bin/keybase-gui
'';
meta = with stdenv.lib; {
homepage = https://www.keybase.io/;
description = "The Keybase official GUI";
platforms = platforms.linux;
2019-01-07 18:41:48 +00:00
maintainers = with maintainers; [ rvolosatovs puffnfresh np ];
2018-08-09 10:00:30 +01:00
license = licenses.bsd3;
};
}