2014-05-08 15:35:47 +01:00
|
|
|
{ stdenv, pkgconfig, fetchurl, python, dropbox }:
|
|
|
|
let
|
2015-12-06 17:16:40 +00:00
|
|
|
version = "2015.10.28";
|
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-12-06 17:16:40 +00:00
|
|
|
sha256 = "1ai6vi5227z2ryxl403693xi63b42ylyfmzh8hbv4shp69zszm9c";
|
2013-03-27 19:12:49 +00:00
|
|
|
};
|
|
|
|
|
2017-09-05 22:26:13 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ 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 = ''
|
2016-04-12 22:38:56 +01:00
|
|
|
mkdir -p "$out/bin/" "$out/share/applications"
|
|
|
|
cp data/dropbox.desktop "$out/share/applications"
|
2017-03-27 10:28:54 +01:00
|
|
|
cp -a data/icons "$out/share/icons"
|
|
|
|
find "$out/share/icons" -type f \! -name '*.png' -delete
|
2014-05-08 15:35:47 +01: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 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;
|
|
|
|
};
|
|
|
|
}
|