1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-28 00:22:13 +00:00
nixpkgs/pkgs/applications/networking/spideroak/default.nix

70 lines
2.2 KiB
Nix
Raw Normal View History

2017-09-16 18:07:38 +01:00
{ stdenv, fetchurl, makeWrapper, patchelf
, fontconfig, freetype, glib, libICE, libSM
, libX11, libXext, libXrender, zlib
2014-07-18 21:21:48 +01:00
}:
let
arch = if stdenv.system == "x86_64-linux" then "x86_64"
else if stdenv.system == "i686-linux" then "i386"
else throw "Spideroak client for: ${stdenv.system} not supported!";
interpreter = if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2"
else if stdenv.system == "i686-linux" then "ld-linux.so.2"
else throw "Spideroak client for: ${stdenv.system} not supported!";
2017-09-16 18:07:38 +01:00
sha256 = if stdenv.system == "x86_64-linux" then "0k87rn4aj0v79rz9jvwspnwzmh031ih0y74ra88nc8kl8j6b6gjm"
else if stdenv.system == "i686-linux" then "1wbxfikj8f7rx26asswqrfp9vpk8w5941s21y1pnaff2gcac8m3z"
2014-07-18 21:21:48 +01:00
else throw "Spideroak client for: ${stdenv.system} not supported!";
ldpath = stdenv.lib.makeLibraryPath [
2017-09-16 18:07:38 +01:00
fontconfig freetype glib libICE libSM
libX11 libXext libXrender zlib
2014-07-18 21:21:48 +01:00
];
2017-09-16 18:07:38 +01:00
version = "6.1.9";
2014-07-18 21:21:48 +01:00
in stdenv.mkDerivation {
name = "spideroak-${version}";
2014-07-18 21:21:48 +01:00
src = fetchurl {
name = "spideroak-${version}-${arch}";
url = "https://spideroak.com/getbuild?platform=slackware&arch=${arch}&version=${version}";
inherit sha256;
};
sourceRoot = ".";
unpackCmd = "tar -xzf $curSrc";
installPhase = ''
mkdir "$out"
2014-07-18 21:21:48 +01:00
cp -r "./"* "$out"
mkdir "$out/bin"
rm "$out/usr/bin/SpiderOakONE"
rmdir $out/usr/bin || true
mv $out/usr/share $out/
2014-07-18 21:21:48 +01:00
rm -f $out/opt/SpiderOakONE/lib/libz*
patchelf --set-interpreter ${stdenv.glibc.out}/lib/${interpreter} \
"$out/opt/SpiderOakONE/lib/SpiderOakONE"
2014-07-18 21:21:48 +01:00
RPATH=$out/opt/SpiderOakONE/lib:${ldpath}
makeWrapper $out/opt/SpiderOakONE/lib/SpiderOakONE $out/bin/spideroak --set LD_LIBRARY_PATH $RPATH \
--set QT_PLUGIN_PATH $out/opt/SpiderOakONE/lib/plugins/ \
2014-07-18 21:21:48 +01:00
--set SpiderOak_EXEC_SCRIPT $out/bin/spideroak
sed -i 's/^Exec=.*/Exec=spideroak/' $out/share/applications/SpiderOakONE.desktop
2014-07-18 21:21:48 +01:00
'';
buildInputs = [ patchelf makeWrapper ];
meta = {
homepage = https://spideroak.com;
2014-07-18 21:21:48 +01:00
description = "Secure online backup and sychronization";
license = stdenv.lib.licenses.unfree;
maintainers = with stdenv.lib.maintainers; [ amorsillo ];
platforms = stdenv.lib.platforms.linux;
};
}