2017-02-14 08:10:42 +00:00
|
|
|
{ stdenv, fetchurl, buildFHSUserEnv, writeTextFile, alsaLib, atk, cairo, cups
|
2018-03-24 19:28:13 +00:00
|
|
|
, dbus, expat, fontconfig, freetype, gcc, gdk_pixbuf, glib, gnome2, gtk2
|
|
|
|
, libnotify, nspr, nss, pango, systemd, xorg, utillinuxMinimal }:
|
2017-02-14 08:10:42 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
libPath = stdenv.lib.makeLibraryPath [
|
|
|
|
alsaLib
|
|
|
|
atk
|
|
|
|
cairo
|
|
|
|
cups
|
|
|
|
dbus
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gcc.cc
|
|
|
|
gdk_pixbuf
|
|
|
|
glib
|
|
|
|
gnome2.GConf
|
|
|
|
gtk2
|
2018-03-24 19:28:13 +00:00
|
|
|
libnotify
|
2017-02-14 08:10:42 +00:00
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
pango
|
|
|
|
systemd
|
|
|
|
xorg.libX11
|
2017-07-16 17:12:17 +01:00
|
|
|
xorg.libxcb
|
2017-02-14 08:10:42 +00:00
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXdamage
|
|
|
|
xorg.libXext
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXrender
|
2017-07-16 17:12:17 +01:00
|
|
|
xorg.libXScrnSaver
|
2017-02-14 08:10:42 +00:00
|
|
|
xorg.libXtst
|
|
|
|
];
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "keybase-gui-${version}";
|
2018-03-01 07:44:29 +00:00
|
|
|
version = "1.0.44-20180223200436.9a9ccec79";
|
2017-02-14 08:10:42 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://s3.amazonaws.com/prerelease.keybase.io/linux_binaries/deb/keybase_${version}_amd64.deb";
|
2018-03-01 07:44:29 +00:00
|
|
|
sha256 = "0dmi0fw39924kpahlsk853hbmpy8a6nj78lrh1wharayjpvj6jv3";
|
2017-02-14 08:10:42 +00:00
|
|
|
};
|
|
|
|
phases = ["unpackPhase" "installPhase" "fixupPhase"];
|
|
|
|
unpackPhase = ''
|
|
|
|
ar xf $src
|
|
|
|
tar xf data.tar.xz
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
2018-02-04 00:44:22 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
mv usr/share $out/share
|
2017-02-14 08:10:42 +00: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
|
|
|
|
|
|
|
|
${utillinuxMinimal}/bin/mountpoint /keybase &>/dev/null
|
|
|
|
if [ "\$?" -ne "0" ]; then
|
|
|
|
echo "Keybase is not mounted to /keybase." >&2
|
|
|
|
echo "You might need to run: kbfsfuse /keybase" >&2
|
|
|
|
checkFailed
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec $out/share/keybase/Keybase "\$@"
|
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/keybase-gui
|
2018-02-04 00:44:22 +00:00
|
|
|
|
|
|
|
substituteInPlace $out/share/applications/keybase.desktop \
|
|
|
|
--replace run_keybase $out/bin/keybase-gui
|
2017-02-14 08:10:42 +00: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 17:12:17 +01:00
|
|
|
maintainers = with maintainers; [ puffnfresh np ];
|
2017-02-14 08:10:42 +00:00
|
|
|
};
|
|
|
|
}
|