2014-10-20 00:16:59 +01:00
|
|
|
{ stdenv, fetchurl, writeText, zlib, rpmextract, patchelf, which }:
|
2014-08-24 17:52:34 +01:00
|
|
|
|
2013-11-18 10:00:13 +00:00
|
|
|
let
|
|
|
|
p = if stdenv.is64bit then {
|
|
|
|
arch = "x86_64";
|
2016-04-30 21:56:43 +01:00
|
|
|
gcclib = "${stdenv.cc.cc.lib}/lib64";
|
2019-04-03 12:22:24 +01:00
|
|
|
sha256 = "1hxsizk3hm1465wkxwdbbcffgi3r64y3r0zsfzsvhvnzx4y5dadm";
|
2013-11-18 10:00:13 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
arch = "i386";
|
2016-04-30 21:56:43 +01:00
|
|
|
gcclib = "${stdenv.cc.cc.lib}/lib";
|
2019-05-16 16:57:37 +01:00
|
|
|
sha256 = "1s829q8gy9xgz0jm7w70aljqs2h49x402blqfr9zvn806aprmrm5";
|
2013-11-18 10:00:13 +00:00
|
|
|
};
|
2018-05-03 06:58:11 +01:00
|
|
|
in
|
2013-11-18 10:00:13 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
2015-04-07 21:11:43 +01:00
|
|
|
name = "yandex-disk-${version}";
|
2019-04-03 12:22:24 +01:00
|
|
|
version = "0.1.5.1010";
|
2013-11-18 10:00:13 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://repo.yandex.ru/yandex-disk/rpm/stable/${p.arch}/${name}-1.fedora.${p.arch}.rpm";
|
2013-11-18 10:00:13 +00:00
|
|
|
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 00:16:59 +01:00
|
|
|
${rpmextract}/bin/rpmextract $src
|
2013-11-18 10:00:13 +00:00
|
|
|
|
|
|
|
cp -r -t $out/bin usr/bin/*
|
|
|
|
cp -r -t $out/share usr/share/*
|
|
|
|
cp -r -t $out/etc etc/*
|
|
|
|
|
2013-12-05 10:39:25 +00:00
|
|
|
sed -i 's@have@${which}/bin/which >/dev/null 2>\&1@' \
|
2013-11-18 10:00:13 +00:00
|
|
|
$out/etc/bash_completion.d/yandex-disk-completion.bash
|
|
|
|
|
|
|
|
${patchelf}/bin/patchelf \
|
2014-12-17 18:11:30 +00:00
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2016-01-24 07:30:24 +00:00
|
|
|
--set-rpath "${zlib.out}/lib:${p.gcclib}" \
|
2013-11-18 10:00:13 +00:00
|
|
|
$out/bin/yandex-disk
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://help.yandex.com/disk/cli-clients.xml;
|
2015-04-30 16:05:14 +01:00
|
|
|
description = "A free cloud file storage service";
|
2015-08-31 21:56:28 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ smironov jagajaga ];
|
2013-11-18 10:00:13 +00:00
|
|
|
platforms = ["i686-linux" "x86_64-linux"];
|
|
|
|
license = stdenv.lib.licenses.unfree;
|
2013-12-05 10:39:25 +00: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 10:00:13 +00:00
|
|
|
};
|
|
|
|
}
|