1{ stdenv, pkgconfig, fetchurl, python, dropbox }:
2let
3 version = "2015.02.12";
4 dropboxd = "${dropbox}/bin/dropbox";
5in
6stdenv.mkDerivation {
7 name = "dropbox-cli-${version}";
8
9 src = fetchurl {
10 url = "https://linux.dropbox.com/packages/nautilus-dropbox-${version}.tar.bz2";
11 sha256 = "12md01ymxsly1rdhdi2sw3aiwykd4y8z8isipc8mjfk8bbp55q86";
12 };
13
14 buildInputs = [ pkgconfig python ];
15
16 phases = "unpackPhase installPhase";
17
18 installPhase = ''
19 mkdir -p "$out/bin/" "$out/share/applications"
20 cp data/dropbox.desktop "$out/share/applications"
21 substitute "dropbox.in" "$out/bin/dropbox" \
22 --replace '@PACKAGE_VERSION@' ${version} \
23 --replace '@DESKTOP_FILE_DIR@' "$out/share/applications" \
24 --replace '@IMAGEDATA16@' '"too-lazy-to-fix"' \
25 --replace '@IMAGEDATA64@' '"too-lazy-to-fix"'
26 sed -i 's:db_path = .*:db_path = "${dropboxd}":' $out/bin/dropbox
27 chmod +x "$out/bin/"*
28 patchShebangs "$out/bin"
29 '';
30
31 meta = {
32 homepage = http://dropbox.com;
33 description = "Command line client for the dropbox daemon";
34 license = stdenv.lib.licenses.gpl3;
35 maintainers = with stdenv.lib.maintainers; [ the-kenny ];
36 # NOTE: Dropbox itself only works on linux, so this is ok.
37 platforms = stdenv.lib.platforms.linux;
38 };
39}