2021-10-04 12:37:57 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3Packages
|
|
|
|
, dnsmasq
|
2021-12-06 16:07:01 +00:00
|
|
|
, getent
|
|
|
|
, kmod
|
2021-10-04 12:37:57 +00:00
|
|
|
, lxc
|
2021-12-06 16:07:01 +00:00
|
|
|
, iproute2
|
|
|
|
, iptables
|
2021-10-04 12:37:57 +00:00
|
|
|
, nftables
|
2021-12-06 16:07:01 +00:00
|
|
|
, util-linux
|
|
|
|
, which
|
|
|
|
, xclip
|
2021-10-04 12:37:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "waydroid";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.2.0";
|
2021-10-04 12:37:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "03d87sh443kn0j2mpih1g909khkx3wgb04h605f9jhd0znskkbmw";
|
2021-10-04 12:37:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
gbinder-python
|
2021-12-06 16:07:01 +00:00
|
|
|
pyclip
|
2021-10-04 12:37:57 +00:00
|
|
|
pygobject3
|
|
|
|
];
|
|
|
|
|
|
|
|
dontUseSetuptoolsBuild = true;
|
|
|
|
dontUsePipInstall = true;
|
|
|
|
dontUseSetuptoolsCheck = true;
|
|
|
|
dontWrapPythonPrograms = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/${python3Packages.python.sitePackages}
|
|
|
|
|
|
|
|
cp -ra tools $out/${python3Packages.python.sitePackages}/tools
|
|
|
|
|
|
|
|
cp -ra data $out/${python3Packages.python.sitePackages}/data
|
|
|
|
wrapProgram $out/${python3Packages.python.sitePackages}/data/scripts/waydroid-net.sh \
|
2021-12-06 16:07:01 +00:00
|
|
|
--prefix PATH ":" ${lib.makeBinPath [ dnsmasq getent iproute2 iptables nftables ]}
|
2021-10-04 12:37:57 +00:00
|
|
|
|
|
|
|
mkdir -p $out/share/waydroid/gbinder.d
|
|
|
|
cp gbinder/anbox.conf $out/share/waydroid/gbinder.d/anbox.conf
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
mkdir -p $out/share/applications
|
|
|
|
ln -s $out/${python3Packages.python.sitePackages}/data/Waydroid.desktop $out/share/applications/Waydroid.desktop
|
|
|
|
|
2021-10-04 12:37:57 +00:00
|
|
|
mkdir $out/bin
|
|
|
|
cp -a waydroid.py $out/${python3Packages.python.sitePackages}/waydroid.py
|
|
|
|
ln -s $out/${python3Packages.python.sitePackages}/waydroid.py $out/bin/waydroid
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
wrapPythonProgramsIn $out/${python3Packages.python.sitePackages} "${lib.concatStringsSep " " [
|
|
|
|
"$out"
|
|
|
|
python3Packages.gbinder-python
|
|
|
|
python3Packages.pygobject3
|
|
|
|
python3Packages.pyclip
|
|
|
|
kmod
|
|
|
|
lxc
|
|
|
|
util-linux
|
|
|
|
which
|
|
|
|
xclip
|
|
|
|
]}"
|
2021-10-04 12:37:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-12-06 16:07:01 +00:00
|
|
|
description = "Waydroid is a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu";
|
2021-10-04 12:37:57 +00:00
|
|
|
homepage = "https://github.com/waydroid/waydroid";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ mcaju ];
|
|
|
|
};
|
|
|
|
}
|