1{ lib
2, fetchFromGitHub
3, python3Packages
4, dnsmasq
5, gawk
6, getent
7, gobject-introspection
8, gtk3
9, kmod
10, lxc
11, iproute2
12, iptables
13, util-linux
14, wrapGAppsHook
15, xclip
16, runtimeShell
17}:
18
19python3Packages.buildPythonApplication rec {
20 pname = "waydroid";
21 version = "1.4.1";
22 format = "other";
23
24 src = fetchFromGitHub {
25 owner = pname;
26 repo = pname;
27 rev = version;
28 sha256 = "sha256-0AkNzMIumvgnVcLKX72E2+Eg54Y9j7tdIYPsroOTLWA=";
29 };
30
31 buildInputs = [
32 gtk3
33 ];
34
35 nativeBuildInputs = [
36 gobject-introspection
37 wrapGAppsHook
38 ];
39
40 propagatedBuildInputs = with python3Packages; [
41 dbus-python
42 gbinder-python
43 pyclip
44 pygobject3
45 ];
46
47 dontUseSetuptoolsBuild = true;
48 dontUsePipInstall = true;
49 dontUseSetuptoolsCheck = true;
50 dontWrapPythonPrograms = true;
51 dontWrapGApps = true;
52
53 installPhase = ''
54 make install PREFIX=$out USE_SYSTEMD=0
55 '';
56
57 preFixup = ''
58 makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
59
60 patchShebangs --host $out/lib/waydroid/data/scripts
61 wrapProgram $out/lib/waydroid/data/scripts/waydroid-net.sh \
62 --prefix PATH ":" ${lib.makeBinPath [ dnsmasq getent iproute2 iptables ]}
63
64 wrapPythonProgramsIn $out/lib/waydroid/ "${lib.concatStringsSep " " [
65 "$out"
66 python3Packages.dbus-python
67 python3Packages.gbinder-python
68 python3Packages.pygobject3
69 python3Packages.pyclip
70 gawk
71 kmod
72 lxc
73 util-linux
74 xclip
75 ]}"
76
77 substituteInPlace $out/lib/waydroid/tools/helpers/*.py \
78 --replace '"sh"' '"${runtimeShell}"'
79 '';
80
81 meta = with lib; {
82 description = "Waydroid is a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu";
83 homepage = "https://github.com/waydroid/waydroid";
84 license = licenses.gpl3;
85 platforms = platforms.linux;
86 maintainers = with maintainers; [ mcaju ];
87 };
88}