2018-07-21 02:44:44 +02:00
|
|
|
{ stdenv, fetchurl, alsaLib, atk, cairo, cups
|
2018-06-28 17:57:49 +02:00
|
|
|
, dbus, expat, fontconfig, freetype, gcc, gdk_pixbuf, glib, gnome2, gtk3
|
2018-07-21 02:44:44 +02:00
|
|
|
, libnotify, nspr, nss, pango, systemd, xorg }:
|
2017-02-14 09:10:42 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
libPath = stdenv.lib.makeLibraryPath [
|
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gcc.cc
|
|
|
|
gdk_pixbuf
|
|
|
|
glib
|
|
|
|
gnome2.GConf
|
2018-06-28 17:57:49 +02:00
|
|
|
gtk3
|
2018-03-24 20:28:13 +01:00
|
|
|
libnotify
|
2017-02-14 09:10:42 +01:00
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
pango
|
|
|
|
systemd
|
|
|
|
xorg.libX11
|
2017-07-16 18:12:17 +02:00
|
|
|
xorg.libxcb
|
2017-02-14 09:10:42 +01:00
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXrender
|
2017-07-16 18:12:17 +02:00
|
|
|
xorg.libXScrnSaver
|
2017-02-14 09:10:42 +01:00
|
|
|
xorg.libXtst
|
|
|
|
];
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "keybase-gui-${version}";
|
2018-06-28 17:57:49 +02:00
|
|
|
version = "2.3.0-20180627160031.8e0438e6fb";
|
2017-02-14 09:10:42 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://s3.amazonaws.com/prerelease.keybase.io/linux_binaries/deb/keybase_${version}_amd64.deb";
|
2018-06-28 17:57:49 +02:00
|
|
|
sha256 = "0xaxxjdfdmgv0wfy75dspfa0a7cdwdpphyy6my9vw82v8jxl3ffx";
|
2017-02-14 09:10:42 +01:00
|
|
|
};
|
|
|
|
phases = ["unpackPhase" "installPhase" "fixupPhase"];
|
|
|
|
unpackPhase = ''
|
|
|
|
ar xf $src
|
|
|
|
tar xf data.tar.xz
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
2018-02-04 01:44:22 +01:00
|
|
|
mkdir -p $out/bin
|
|
|
|
mv usr/share $out/share
|
2017-02-14 09:10:42 +01:00
|
|
|
mv opt/keybase $out/share/
|
|
|
|
|
|
|
|
cat > $out/bin/keybase-gui <<EOF
|
|
|
|
#!${stdenv.shell}
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-07-17 17:47:55 +02:00
|
|
|
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
|
2017-02-14 09:10:42 +01:00
|
|
|
checkFailed
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec $out/share/keybase/Keybase "\$@"
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/keybase-gui
|
2018-02-04 01:44:22 +01:00
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/keybase.desktop \
|
|
|
|
--replace run_keybase $out/bin/keybase-gui
|
2017-02-14 09:10:42 +01:00
|
|
|
'';
|
|
|
|
postFixup = ''
|
|
|
|
patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) --set-rpath "${libPath}:\$ORIGIN" "$out/share/keybase/Keybase"
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = https://www.keybase.io/;
|
|
|
|
description = "The Keybase official GUI.";
|
|
|
|
platforms = platforms.linux;
|
2017-07-16 18:12:17 +02:00
|
|
|
maintainers = with maintainers; [ puffnfresh np ];
|
2017-02-14 09:10:42 +01:00
|
|
|
};
|
|
|
|
}
|