Fix dropbox-cli.

Dropbox doesn't version the CLI. This broke the download. This patch
also fixes the `dropbox-cli start' command.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
This commit is contained in:
Moritz Ulrich 2013-06-16 23:38:33 +02:00
parent ccda14879e
commit 1570336325

View File

@ -1,17 +1,18 @@
{ stdenv, coreutils, fetchurl, python }:
{ stdenv, coreutils, fetchurl, python, dropbox }:
stdenv.mkDerivation {
name = "dropbox-cli";
src = fetchurl {
# Note: dropbox doesn't version this file. Annoying.
url = "https://linux.dropbox.com/packages/dropbox.py";
sha256 = "1x46i0aplah4a2nqglb8byl3c60w7h1cjja62myxj2dpxyv7fydy";
sha256 = "0p1pg8bw6mlhqi5k8y3pgs7byg0kfvq57s53sh188lb5sxvlg7yz";
};
buildInputs = [ coreutils python ];
phases = "installPhase fixupPhase";
installPhase = ''
mkdir -pv $out/bin/
cp $src $out/bin/dropbox-cli
@ -20,11 +21,12 @@ stdenv.mkDerivation {
fixupPhase = ''
substituteInPlace $out/bin/dropbox-cli \
--replace "/usr/bin/python" ${python}/bin/python \
--replace "use dropbox help" "use dropbox-cli help"
--replace "use dropbox help" "use dropbox-cli help" \
--replace "~/.dropbox-dist/dropboxd" ${dropbox}/bin/dropbox
chmod +x $out/bin/dropbox-cli
'';
meta = {
homepage = http://dropbox.com;
description = "Command line client for the dropbox daemon.";
@ -33,4 +35,3 @@ stdenv.mkDerivation {
platforms = stdenv.lib.platforms.linux;
};
}