2014-10-20 01:16:59 +02:00
|
|
|
{ stdenv, fetchurl, writeText, zlib, rpmextract, patchelf, which }:
|
2014-08-24 18:52:34 +02:00
|
|
|
|
|
|
|
assert stdenv.isLinux;
|
|
|
|
|
2013-11-18 11:00:13 +01:00
|
|
|
let
|
|
|
|
p = if stdenv.is64bit then {
|
|
|
|
arch = "x86_64";
|
2015-01-15 05:25:26 +01:00
|
|
|
gcclib = "${stdenv.cc.cc}/lib64";
|
2015-04-07 22:11:43 +02:00
|
|
|
sha256 = "061kl186vllqhl1443d9cwvp4qdhqc42yf3x72a1w0bjvn0i3z1i";
|
2013-11-18 11:00:13 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
arch = "i386";
|
2015-01-15 05:25:26 +01:00
|
|
|
gcclib = "${stdenv.cc.cc}/lib";
|
2015-04-07 22:11:43 +02:00
|
|
|
sha256 = "1l9mxlin41w83dn70cvdk1n1vn1dll3d8r120jkqn5jfhicrgvv3";
|
2013-11-18 11:00:13 +01:00
|
|
|
};
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
2015-04-07 22:11:43 +02:00
|
|
|
name = "yandex-disk-${version}";
|
|
|
|
version = "0.1.5.870";
|
2013-11-18 11:00:13 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://repo.yandex.ru/yandex-disk/rpm/stable/${p.arch}/${name}-1.fedora.${p.arch}.rpm";
|
|
|
|
sha256 = p.sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
builder = writeText "builder.sh" ''
|
|
|
|
. $stdenv/setup
|
|
|
|
mkdir -pv $out/bin
|
|
|
|
mkdir -pv $out/share
|
|
|
|
mkdir -pv $out/etc
|
|
|
|
|
|
|
|
mkdir -pv unpacked
|
|
|
|
cd unpacked
|
2014-10-20 01:16:59 +02:00
|
|
|
${rpmextract}/bin/rpmextract $src
|
2013-11-18 11:00:13 +01:00
|
|
|
|
|
|
|
cp -r -t $out/bin usr/bin/*
|
|
|
|
cp -r -t $out/share usr/share/*
|
|
|
|
cp -r -t $out/etc etc/*
|
|
|
|
|
2013-12-05 11:39:25 +01:00
|
|
|
sed -i 's@have@${which}/bin/which >/dev/null 2>\&1@' \
|
2013-11-18 11:00:13 +01:00
|
|
|
$out/etc/bash_completion.d/yandex-disk-completion.bash
|
|
|
|
|
|
|
|
${patchelf}/bin/patchelf \
|
2014-12-17 19:11:30 +01:00
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2013-11-18 11:00:13 +01:00
|
|
|
--set-rpath "${zlib}/lib:${p.gcclib}" \
|
|
|
|
$out/bin/yandex-disk
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://help.yandex.com/disk/cli-clients.xml;
|
2015-04-30 17:05:14 +02:00
|
|
|
description = "A free cloud file storage service";
|
2013-11-18 11:00:13 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [smironov];
|
|
|
|
platforms = ["i686-linux" "x86_64-linux"];
|
|
|
|
license = stdenv.lib.licenses.unfree;
|
2013-12-05 11:39:25 +01:00
|
|
|
longDescription = ''
|
|
|
|
Yandex.Disk console client for Linux lets you manage files on Disk without
|
|
|
|
using a window interface or programs that support WebDAV. The advantages
|
|
|
|
of the console client compared to a WebDAV connection:
|
|
|
|
* low system resource requirements;
|
|
|
|
* faster file reading and writing speeds;
|
|
|
|
* faster syncing with Disk's server;
|
|
|
|
* no need to be constantly connected to work with files.
|
|
|
|
'';
|
2013-11-18 11:00:13 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|