2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkg-config
|
|
|
|
, fuse
|
|
|
|
, android-tools
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "adbfs-rootless";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "unstable-2023-03-21";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "spion";
|
2023-05-24 13:37:59 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "fd56381af4dc9ae2f09b904c295686871a46ed0f";
|
|
|
|
sha256 = "atiVjRfqvhTlm8Q+3iTNNPQiNkLIaHDLg5HZDJvpl2Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2023-05-24 13:37:59 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ fuse ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# very ugly way of replacing the adb calls
|
2023-05-24 13:37:59 +00:00
|
|
|
substituteInPlace adbfs.cpp \
|
|
|
|
--replace '"adb ' '"${android-tools}/bin/adb '
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
runHook preInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
install -D adbfs $out/bin/adbfs
|
2023-05-24 13:37:59 +00:00
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Mount Android phones on Linux with adb, no root required";
|
|
|
|
inherit (src.meta) homepage;
|
|
|
|
license = licenses.bsd3;
|
2023-07-15 17:15:38 +00:00
|
|
|
maintainers = with maintainers; [ aleksana ];
|
2023-05-24 13:37:59 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|