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