2014-05-08 14:35:47 +00:00
|
|
|
{ stdenv, pkgconfig, fetchurl, python, dropbox }:
|
|
|
|
let
|
2019-01-02 16:06:45 +00:00
|
|
|
version = "2018.11.28";
|
2015-03-22 17:10:28 +00:00
|
|
|
dropboxd = "${dropbox}/bin/dropbox";
|
2014-05-08 14:35:47 +00:00
|
|
|
in
|
2013-03-27 19:12:49 +00:00
|
|
|
stdenv.mkDerivation {
|
2014-05-08 14:35:47 +00:00
|
|
|
name = "dropbox-cli-${version}";
|
2013-03-27 19:12:49 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-01-02 16:06:45 +00:00
|
|
|
url = "https://linux.dropboxstatic.com/packages/nautilus-dropbox-${version}.tar.bz2";
|
|
|
|
sha256 = "0m1m9c7dfc8nawkcrg88955125sl1jz8mc9bf6wjay9za8014w58";
|
2013-03-27 19:12:49 +00:00
|
|
|
};
|
|
|
|
|
2017-09-05 21:26:13 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ python ];
|
2013-03-27 19:12:49 +00:00
|
|
|
|
2014-05-08 14:35:47 +00:00
|
|
|
phases = "unpackPhase installPhase";
|
2013-06-16 21:38:33 +00:00
|
|
|
|
2013-03-27 19:12:49 +00:00
|
|
|
installPhase = ''
|
2016-04-12 21:38:56 +00:00
|
|
|
mkdir -p "$out/bin/" "$out/share/applications"
|
|
|
|
cp data/dropbox.desktop "$out/share/applications"
|
2017-03-27 09:28:54 +00:00
|
|
|
cp -a data/icons "$out/share/icons"
|
|
|
|
find "$out/share/icons" -type f \! -name '*.png' -delete
|
2014-05-08 14:35:47 +00: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 14:35:47 +00:00
|
|
|
chmod +x "$out/bin/"*
|
|
|
|
patchShebangs "$out/bin"
|
2013-03-27 19:12:49 +00:00
|
|
|
'';
|
2013-06-16 21:38:33 +00:00
|
|
|
|
2013-03-27 19:12:49 +00:00
|
|
|
meta = {
|
|
|
|
homepage = http://dropbox.com;
|
2013-09-26 19:37:49 +00: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 21:40:43 +00: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;
|
|
|
|
};
|
|
|
|
}
|