2018-06-22 13:57:37 +01:00
|
|
|
{stdenv, rustPlatform, fetchFromGitHub, fetchzip, androidenv, substituteAll}:
|
|
|
|
let
|
2018-09-16 12:08:42 +01:00
|
|
|
version = "2.3";
|
2018-06-22 13:57:37 +01:00
|
|
|
apk = stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "gnirehtet.apk";
|
|
|
|
inherit version;
|
2018-06-22 13:57:37 +01:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/Genymobile/gnirehtet/releases/download/v${version}/gnirehtet-rust-linux64-v${version}.zip";
|
2018-09-16 12:08:42 +01:00
|
|
|
sha256 = "08pgmpbz82cd8ndr2syiv25l5xk1gvh9gzji4pgva5gw269bjmpz";
|
2018-06-22 13:57:37 +01:00
|
|
|
};
|
|
|
|
installPhase = ''
|
|
|
|
mkdir $out
|
|
|
|
mv gnirehtet.apk $out
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
2019-08-13 22:52:01 +01:00
|
|
|
rustPlatform.buildRustPackage {
|
2018-06-22 13:57:37 +01:00
|
|
|
name = "gnirehtet-${version}";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Genymobile";
|
|
|
|
repo = "gnirehtet";
|
|
|
|
rev = "v${version}";
|
2018-09-16 12:08:42 +01:00
|
|
|
sha256 = "118ig42qzr2xyra7r8zfxq38xidaxfc98ja9836jwnn9fgbigczr";
|
2018-06-22 13:57:37 +01:00
|
|
|
};
|
|
|
|
sourceRoot = "source/relay-rust";
|
2019-05-25 12:03:08 +01:00
|
|
|
cargoSha256 = "1500lfwbfnc0k2hn7r1n629fq11zfqm3fg13dddmhchq4i3sqkfb";
|
2018-06-22 13:57:37 +01:00
|
|
|
|
|
|
|
patchFlags = [ "-p2" ];
|
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./paths.patch;
|
2018-11-18 12:51:06 +00:00
|
|
|
adb = "${androidenv.androidPkgs_9_0.platform-tools}/bin/adb";
|
2018-06-22 13:57:37 +01:00
|
|
|
inherit apk;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Reverse tethering over adb for Android";
|
|
|
|
longDescription = ''
|
|
|
|
This project provides reverse tethering over adb for Android: it allows devices to use the internet connection of the computer they are plugged on. It does not require any root access (neither on the device nor on the computer).
|
|
|
|
|
|
|
|
This relies on adb, make sure you have the required permissions/udev rules.
|
|
|
|
'';
|
|
|
|
homepage = https://github.com/Genymobile/gnirehtet;
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ symphorien ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|