about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/mobile/adb-sync/default.nix
blob: 98f69ed88b16986fc5d2750b19566781758b3f1f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ stdenv, fetchFromGitHub, python3, platform-tools, makeWrapper
, socat, go-mtpfs, adbfs-rootless
}:

stdenv.mkDerivation {
  pname = "adb-sync-unstable";
  version = "2019-01-01";

  src = fetchFromGitHub {
    owner = "google";
    repo = "adb-sync";
    rev = "fb7c549753de7a5579ed3400dd9f8ac71f7bf1b1";
    sha256 = "1kfpdqs8lmnh144jcm1qmfnmigzrbrz5lvwvqqb7021b2jlf69cl";
  };

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ python3 ];

  dontBuild = true;

  installPhase = let
    dependencies = stdenv.lib.makeBinPath [ platform-tools socat go-mtpfs adbfs-rootless ];
  in ''
    runHook preInstall

    mkdir -p $out/bin
    cp adb-{sync,channel} $out/bin

    wrapProgram $out/bin/adb-sync --suffix PATH : "${dependencies}"
    wrapProgram $out/bin/adb-channel --suffix PATH : "${dependencies}"

    runHook postInstall
  '';

  meta = with stdenv.lib; {
    description = "A tool to synchronise files between a PC and an Android devices using ADB (Android Debug Bridge)";
    homepage = "https://github.com/google/adb-sync";
    license = licenses.asl20;
    platforms = platforms.unix;
    hydraPlatforms = [];
    maintainers = with maintainers; [ scolobb ma27 ];
  };
}