about summary refs log tree commit diff
path: root/pkgs/applications/networking/dropbox
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-04-17 13:49:19 -0500
committerMatthew Bauer <mjbauer95@gmail.com>2018-04-17 13:50:49 -0500
commit52893d527638be9ddeb3669796856508afff252e (patch)
treea70f8e35b1f84ec88dba31529107a2845cd3304e /pkgs/applications/networking/dropbox
parent6c182dd14dea6a68dd80e780c763b76dfceae0a2 (diff)
treewide: move "extensions" drvs to dir
This cleans up the tree for pkgs/applications somewhat. Should not
change any hashes.
Diffstat (limited to 'pkgs/applications/networking/dropbox')
-rw-r--r--pkgs/applications/networking/dropbox/cli.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/applications/networking/dropbox/cli.nix b/pkgs/applications/networking/dropbox/cli.nix
new file mode 100644
index 0000000000000..d3141675b4182
--- /dev/null
+++ b/pkgs/applications/networking/dropbox/cli.nix
@@ -0,0 +1,42 @@
+{ stdenv, pkgconfig, fetchurl, python, dropbox }:
+let
+  version = "2015.10.28";
+  dropboxd = "${dropbox}/bin/dropbox";
+in
+stdenv.mkDerivation {
+  name = "dropbox-cli-${version}";
+
+  src = fetchurl {
+    url = "https://linux.dropbox.com/packages/nautilus-dropbox-${version}.tar.bz2";
+    sha256 = "1ai6vi5227z2ryxl403693xi63b42ylyfmzh8hbv4shp69zszm9c";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ python ];
+
+  phases = "unpackPhase installPhase";
+
+  installPhase = ''
+    mkdir -p "$out/bin/" "$out/share/applications"
+    cp data/dropbox.desktop "$out/share/applications"
+    cp -a data/icons "$out/share/icons"
+    find "$out/share/icons" -type f \! -name '*.png' -delete
+    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"'
+    sed -i 's:db_path = .*:db_path = "${dropboxd}":' $out/bin/dropbox
+    chmod +x "$out/bin/"*
+    patchShebangs "$out/bin"
+  '';
+
+  meta = {
+    homepage = http://dropbox.com;
+    description = "Command line client for the dropbox daemon";
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [ the-kenny ];
+    # NOTE: Dropbox itself only works on linux, so this is ok.
+    platforms = stdenv.lib.platforms.linux;
+  };
+}