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.

95 lines
2.1 KiB
Nix
Raw Normal View History

2023-01-03 16:44:47 +00:00
{ lib
2021-10-01 20:16:36 +00:00
, fetchFromGitHub
, fetchpatch
2021-10-01 20:16:36 +00:00
, python3Packages
, dnsmasq
2022-10-10 07:43:59 +00:00
, gawk
, getent
, gobject-introspection
, gtk3
, kmod
2021-10-01 20:16:36 +00:00
, lxc
, iproute2
2023-02-19 04:17:11 +00:00
, iptables
, util-linux
, wrapGAppsHook
, wl-clipboard
2023-02-19 04:17:11 +00:00
, runtimeShell
2021-10-01 20:16:36 +00:00
}:
python3Packages.buildPythonApplication rec {
pname = "waydroid";
version = "1.4.2";
2022-09-19 02:06:11 +00:00
format = "other";
2021-10-01 20:16:36 +00:00
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "sha256-/dFvhiK3nCOOmAtrYkQEB8Ge8Rf1ea5cDO7puTwS5bI=";
2021-10-01 20:16:36 +00:00
};
patches = [
# https://github.com/waydroid/waydroid/pull/1218
(fetchpatch {
url = "https://github.com/waydroid/waydroid/commit/595e0e5b309a79fedaa07d90b9073ddcb156314c.patch";
hash = "sha256-A+rUmJbFFhMZ5WpT+QBCTEcn82wJuvmi8Wbcsio41Nk=";
})
];
nativeBuildInputs = [
gobject-introspection
wrapGAppsHook
];
buildInputs = [
gtk3
];
2021-10-01 20:16:36 +00:00
propagatedBuildInputs = with python3Packages; [
2023-03-02 23:52:20 +00:00
dbus-python
2021-10-01 20:16:36 +00:00
gbinder-python
pyclip
2021-10-01 20:16:36 +00:00
pygobject3
];
dontUseSetuptoolsBuild = true;
dontUsePipInstall = true;
dontUseSetuptoolsCheck = true;
dontWrapPythonPrograms = true;
dontWrapGApps = true;
2021-10-01 20:16:36 +00:00
installPhase = ''
2023-02-19 04:17:11 +00:00
make install PREFIX=$out USE_SYSTEMD=0
'';
preFixup = ''
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
2021-10-01 20:16:36 +00:00
2023-02-19 04:17:11 +00:00
patchShebangs --host $out/lib/waydroid/data/scripts
2022-08-10 22:04:10 +00:00
wrapProgram $out/lib/waydroid/data/scripts/waydroid-net.sh \
2023-02-19 04:17:11 +00:00
--prefix PATH ":" ${lib.makeBinPath [ dnsmasq getent iproute2 iptables ]}
2021-10-01 20:16:36 +00:00
wrapPythonProgramsIn $out/lib/waydroid/ "${lib.concatStringsSep " " ([
"$out"
] ++ propagatedBuildInputs ++ [
2022-10-10 07:43:59 +00:00
gawk
kmod
lxc
util-linux
wl-clipboard
])}"
2023-02-19 04:17:11 +00:00
substituteInPlace $out/lib/waydroid/tools/helpers/*.py \
--replace '"sh"' '"${runtimeShell}"'
2021-10-01 20:16:36 +00:00
'';
2023-09-24 13:09:00 +00:00
meta = {
description = "Waydroid is a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu";
2021-10-01 20:16:36 +00:00
homepage = "https://github.com/waydroid/waydroid";
2023-09-24 13:09:00 +00:00
license = lib.licenses.gpl3;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ mcaju ];
2021-10-01 20:16:36 +00:00
};
}