3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/os-specific/linux/waydroid/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
2 KiB
Nix
Raw Normal View History

2021-10-01 21:16:36 +01:00
{ stdenv
, lib
, fetchFromGitHub
, python3Packages
, dnsmasq
, getent
, kmod
2021-10-01 21:16:36 +01:00
, lxc
, iproute2
, iptables
2021-10-01 21:16:36 +01:00
, nftables
, util-linux
, which
, xclip
2021-10-01 21:16:36 +01:00
}:
python3Packages.buildPythonApplication rec {
pname = "waydroid";
2022-06-04 16:58:02 +01:00
version = "1.2.1";
2021-10-01 21:16:36 +01:00
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
2022-06-04 16:58:02 +01:00
sha256 = "sha256-Sf1rl8GCSTuneuYroGqsm9Aq2rBurpyswOrfCq2mWOs=";
2021-10-01 21:16:36 +01:00
};
propagatedBuildInputs = with python3Packages; [
gbinder-python
pyclip
2021-10-01 21:16:36 +01: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 \
--prefix PATH ":" ${lib.makeBinPath [ dnsmasq getent iproute2 iptables nftables ]}
2021-10-01 21:16:36 +01:00
mkdir -p $out/share/waydroid/gbinder.d
cp gbinder/anbox.conf $out/share/waydroid/gbinder.d/anbox.conf
mkdir -p $out/share/applications
ln -s $out/${python3Packages.python.sitePackages}/data/Waydroid.desktop $out/share/applications/Waydroid.desktop
2021-10-01 21:16:36 +01: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
wrapPythonProgramsIn $out/${python3Packages.python.sitePackages} "${lib.concatStringsSep " " [
"$out"
python3Packages.gbinder-python
python3Packages.pygobject3
python3Packages.pyclip
kmod
lxc
util-linux
which
xclip
]}"
2021-10-01 21:16:36 +01:00
'';
meta = with lib; {
description = "Waydroid is a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu";
2021-10-01 21:16:36 +01:00
homepage = "https://github.com/waydroid/waydroid";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ mcaju ];
};
}