2013-06-16 23:38:33 +02:00
|
|
|
{ stdenv, coreutils, fetchurl, python, dropbox }:
|
2013-03-27 20:12:49 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2013-09-26 21:37:49 +02:00
|
|
|
# 1.6.0 because it's the only version mentioned in the script
|
|
|
|
name = "dropbox-cli-1.6.0";
|
2013-03-27 20:12:49 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-06-16 23:38:33 +02:00
|
|
|
# Note: dropbox doesn't version this file. Annoying.
|
2013-03-27 20:12:49 +01:00
|
|
|
url = "https://linux.dropbox.com/packages/dropbox.py";
|
2013-06-16 23:38:33 +02:00
|
|
|
sha256 = "0p1pg8bw6mlhqi5k8y3pgs7byg0kfvq57s53sh188lb5sxvlg7yz";
|
2013-03-27 20:12:49 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ coreutils python ];
|
|
|
|
|
|
|
|
phases = "installPhase fixupPhase";
|
2013-06-16 23:38:33 +02:00
|
|
|
|
2013-03-27 20:12:49 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -pv $out/bin/
|
|
|
|
cp $src $out/bin/dropbox-cli
|
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
|
|
|
substituteInPlace $out/bin/dropbox-cli \
|
|
|
|
--replace "/usr/bin/python" ${python}/bin/python \
|
2013-06-16 23:38:33 +02:00
|
|
|
--replace "use dropbox help" "use dropbox-cli help" \
|
|
|
|
--replace "~/.dropbox-dist/dropboxd" ${dropbox}/bin/dropbox
|
|
|
|
|
2013-03-27 20:12:49 +01:00
|
|
|
chmod +x $out/bin/dropbox-cli
|
|
|
|
'';
|
2013-06-16 23:38:33 +02:00
|
|
|
|
2013-03-27 20:12:49 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://dropbox.com;
|
2013-09-26 21:37:49 +02:00
|
|
|
description = "Command line client for the dropbox daemon";
|
2013-03-27 20:12:49 +01:00
|
|
|
license = stdenv.lib.licenses.gpl3;
|
2013-06-16 23:40:43 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
|
2013-03-27 20:56:46 +01:00
|
|
|
# NOTE: Dropbox itself only works on linux, so this is ok.
|
2013-03-27 20:12:49 +01:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|