2014-05-08 16:35:47 +02:00
|
|
|
{ stdenv, pkgconfig, fetchurl, python, dropbox }:
|
|
|
|
let
|
2015-12-06 18:16:40 +01:00
|
|
|
version = "2015.10.28";
|
2015-03-22 18:10:28 +01:00
|
|
|
dropboxd = "${dropbox}/bin/dropbox";
|
2014-05-08 16:35:47 +02:00
|
|
|
in
|
2013-03-27 20:12:49 +01:00
|
|
|
stdenv.mkDerivation {
|
2014-05-08 16:35:47 +02:00
|
|
|
name = "dropbox-cli-${version}";
|
2013-03-27 20:12:49 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-05-08 16:35:47 +02:00
|
|
|
url = "https://linux.dropbox.com/packages/nautilus-dropbox-${version}.tar.bz2";
|
2015-12-06 18:16:40 +01:00
|
|
|
sha256 = "1ai6vi5227z2ryxl403693xi63b42ylyfmzh8hbv4shp69zszm9c";
|
2013-03-27 20:12:49 +01:00
|
|
|
};
|
|
|
|
|
2017-09-05 23:26:13 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ python ];
|
2013-03-27 20:12:49 +01:00
|
|
|
|
2014-05-08 16:35:47 +02:00
|
|
|
phases = "unpackPhase installPhase";
|
2013-06-16 23:38:33 +02:00
|
|
|
|
2013-03-27 20:12:49 +01:00
|
|
|
installPhase = ''
|
2016-04-12 23:38:56 +02:00
|
|
|
mkdir -p "$out/bin/" "$out/share/applications"
|
|
|
|
cp data/dropbox.desktop "$out/share/applications"
|
2017-03-27 11:28:54 +02:00
|
|
|
cp -a data/icons "$out/share/icons"
|
|
|
|
find "$out/share/icons" -type f \! -name '*.png' -delete
|
2014-05-08 16:35:47 +02:00
|
|
|
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 18:09:41 +01:00
|
|
|
sed -i 's:db_path = .*:db_path = "${dropboxd}":' $out/bin/dropbox
|
2014-05-08 16:35:47 +02:00
|
|
|
chmod +x "$out/bin/"*
|
|
|
|
patchShebangs "$out/bin"
|
2013-03-27 20:12:49 +01:00
|
|
|
'';
|
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;
|
|
|
|
};
|
|
|
|
}
|