2014-05-08 15:35:47 +01:00
|
|
|
{ stdenv, pkgconfig, fetchurl, python, dropbox }:
|
|
|
|
let
|
2015-04-16 14:35:30 +01:00
|
|
|
version = "2015.02.12";
|
2015-03-22 17:10:28 +00:00
|
|
|
dropboxd = "${dropbox}/bin/dropbox";
|
2014-05-08 15:35:47 +01:00
|
|
|
in
|
2013-03-27 19:12:49 +00:00
|
|
|
stdenv.mkDerivation {
|
2014-05-08 15:35:47 +01:00
|
|
|
name = "dropbox-cli-${version}";
|
2013-03-27 19:12:49 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-05-08 15:35:47 +01:00
|
|
|
url = "https://linux.dropbox.com/packages/nautilus-dropbox-${version}.tar.bz2";
|
2015-04-16 14:35:30 +01:00
|
|
|
sha256 = "12md01ymxsly1rdhdi2sw3aiwykd4y8z8isipc8mjfk8bbp55q86";
|
2013-03-27 19:12:49 +00:00
|
|
|
};
|
|
|
|
|
2014-05-08 15:35:47 +01:00
|
|
|
buildInputs = [ pkgconfig python ];
|
2013-03-27 19:12:49 +00:00
|
|
|
|
2014-05-08 15:35:47 +01:00
|
|
|
phases = "unpackPhase installPhase";
|
2013-06-16 22:38:33 +01:00
|
|
|
|
2013-03-27 19:12:49 +00:00
|
|
|
installPhase = ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p "$out/bin/" "$out/share/applications"
|
2014-05-08 15:35:47 +01:00
|
|
|
cp data/dropbox.desktop "$out/share/applications"
|
|
|
|
substitute "dropbox.in" "$out/bin/dropbox" \
|
|
|
|
--replace '@PACKAGE_VERSION@' ${version} \
|
|
|
|
--replace '@DESKTOP_FILE_DIR@' "$out/share/applications" \
|
|
|
|
--replace '@IMAGEDATA16@' '"too-lazy-to-fix"' \
|
|
|
|
--replace '@IMAGEDATA64@' '"too-lazy-to-fix"'
|
2015-03-22 17:09:41 +00:00
|
|
|
sed -i 's:db_path = .*:db_path = "${dropboxd}":' $out/bin/dropbox
|
2014-05-08 15:35:47 +01:00
|
|
|
chmod +x "$out/bin/"*
|
|
|
|
patchShebangs "$out/bin"
|
2013-03-27 19:12:49 +00:00
|
|
|
'';
|
2013-06-16 22:38:33 +01:00
|
|
|
|
2013-03-27 19:12:49 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://dropbox.com;
|
2013-09-26 20:37:49 +01:00
|
|
|
description = "Command line client for the dropbox daemon";
|
2013-03-27 19:12:49 +00:00
|
|
|
license = stdenv.lib.licenses.gpl3;
|
2013-06-16 22:40:43 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ the-kenny ];
|
2013-03-27 19:56:46 +00:00
|
|
|
# NOTE: Dropbox itself only works on linux, so this is ok.
|
2013-03-27 19:12:49 +00:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|