1{ lib, stdenv, fetchFromGitHub, python3, platform-tools, makeWrapper
2, socat, go-mtpfs, adbfs-rootless
3}:
4
5stdenv.mkDerivation {
6 pname = "adb-sync-unstable";
7 version = "2019-01-01";
8
9 src = fetchFromGitHub {
10 owner = "google";
11 repo = "adb-sync";
12 rev = "fb7c549753de7a5579ed3400dd9f8ac71f7bf1b1";
13 sha256 = "1kfpdqs8lmnh144jcm1qmfnmigzrbrz5lvwvqqb7021b2jlf69cl";
14 };
15
16 nativeBuildInputs = [ makeWrapper ];
17 buildInputs = [ python3 ];
18
19 dontBuild = true;
20
21 installPhase = let
22 dependencies = lib.makeBinPath [ platform-tools socat go-mtpfs adbfs-rootless ];
23 in ''
24 runHook preInstall
25
26 mkdir -p $out/bin
27 cp adb-{sync,channel} $out/bin
28
29 wrapProgram $out/bin/adb-sync --suffix PATH : "${dependencies}"
30 wrapProgram $out/bin/adb-channel --suffix PATH : "${dependencies}"
31
32 runHook postInstall
33 '';
34
35 meta = with lib; {
36 description = "A tool to synchronise files between a PC and an Android devices using ADB (Android Debug Bridge)";
37 homepage = "https://github.com/google/adb-sync";
38 license = licenses.asl20;
39 platforms = platforms.unix;
40 hydraPlatforms = [];
41 maintainers = with maintainers; [ scolobb ];
42 };
43}