nixpkgs-suyu/pkgs/tools/filesystems/yandex-disk/default.nix

68 lines
2 KiB
Nix
Raw Normal View History

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;
let
p = if stdenv.is64bit then {
arch = "x86_64";
2016-04-30 22:56:43 +02:00
gcclib = "${stdenv.cc.cc.lib}/lib64";
2016-11-12 09:04:56 +01:00
sha256 = "1skbzmrcjbw00a3jnbl2llqwz3ahsgvq74mjav68s2hw1wjidvk6";
}
else {
arch = "i386";
2016-04-30 22:56:43 +02:00
gcclib = "${stdenv.cc.cc.lib}/lib";
2016-11-12 09:04:56 +01:00
sha256 = "09h71i3k9d24ki81jdwhnav63fqbc44glbx228s9g3cr4ap41jcx";
};
in
stdenv.mkDerivation rec {
name = "yandex-disk-${version}";
2016-11-12 09:04:56 +01:00
version = "0.1.5.978";
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
cp -r -t $out/bin usr/bin/*
cp -r -t $out/share usr/share/*
cp -r -t $out/etc etc/*
sed -i 's@have@${which}/bin/which >/dev/null 2>\&1@' \
$out/etc/bash_completion.d/yandex-disk-completion.bash
${patchelf}/bin/patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${zlib.out}/lib:${p.gcclib}" \
$out/bin/yandex-disk
'';
meta = {
homepage = http://help.yandex.com/disk/cli-clients.xml;
description = "A free cloud file storage service";
maintainers = with stdenv.lib.maintainers; [ smironov jagajaga ];
platforms = ["i686-linux" "x86_64-linux"];
license = stdenv.lib.licenses.unfree;
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.
'';
};
}