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