Merge pull request #637 from the-kenny/fix-dropbox-cli

Fix dropbox cli
This commit is contained in:
Domen Kožar
2013-06-17 08:54:40 -07:00
@@ -1,17 +1,18 @@
{ stdenv, coreutils, fetchurl, python }: { stdenv, coreutils, fetchurl, python, dropbox }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "dropbox-cli"; name = "dropbox-cli";
src = fetchurl { src = fetchurl {
# Note: dropbox doesn't version this file. Annoying.
url = "https://linux.dropbox.com/packages/dropbox.py"; url = "https://linux.dropbox.com/packages/dropbox.py";
sha256 = "1x46i0aplah4a2nqglb8byl3c60w7h1cjja62myxj2dpxyv7fydy"; sha256 = "0p1pg8bw6mlhqi5k8y3pgs7byg0kfvq57s53sh188lb5sxvlg7yz";
}; };
buildInputs = [ coreutils python ]; buildInputs = [ coreutils python ];
phases = "installPhase fixupPhase"; phases = "installPhase fixupPhase";
installPhase = '' installPhase = ''
mkdir -pv $out/bin/ mkdir -pv $out/bin/
cp $src $out/bin/dropbox-cli cp $src $out/bin/dropbox-cli
@@ -20,17 +21,18 @@ stdenv.mkDerivation {
fixupPhase = '' fixupPhase = ''
substituteInPlace $out/bin/dropbox-cli \ substituteInPlace $out/bin/dropbox-cli \
--replace "/usr/bin/python" ${python}/bin/python \ --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 chmod +x $out/bin/dropbox-cli
''; '';
meta = { meta = {
homepage = http://dropbox.com; homepage = http://dropbox.com;
description = "Command line client for the dropbox daemon."; description = "Command line client for the dropbox daemon.";
license = stdenv.lib.licenses.gpl3; license = stdenv.lib.licenses.gpl3;
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
# NOTE: Dropbox itself only works on linux, so this is ok. # NOTE: Dropbox itself only works on linux, so this is ok.
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.linux;
}; };
} }