From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B9DF5159C83 for ; Tue, 6 Aug 2024 14:59:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0AA9DE2BEB; Tue, 6 Aug 2024 14:59:43 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E0A20E2BEC for ; Tue, 6 Aug 2024 14:59:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D8E25335C2E for ; Tue, 6 Aug 2024 14:59:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 768D51E92 for ; Tue, 6 Aug 2024 14:59:40 +0000 (UTC) From: "Lucio Sauer" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lucio Sauer" Message-ID: <1722954120.c267d4087ebd2ed3c4b2986d5ae64e58abeceeab.watermanpaint@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: app-containers/waydroid/ X-VCS-Repository: repo/proj/guru X-VCS-Files: app-containers/waydroid/waydroid-1.4.2-r2.ebuild X-VCS-Directories: app-containers/waydroid/ X-VCS-Committer: watermanpaint X-VCS-Committer-Name: Lucio Sauer X-VCS-Revision: c267d4087ebd2ed3c4b2986d5ae64e58abeceeab X-VCS-Branch: master Date: Tue, 6 Aug 2024 14:59:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 69951d6d-7a2f-4847-b9d7-8aca854790f0 X-Archives-Hash: 5d1252917bbdd1bc69321a92ea81f915 commit: c267d4087ebd2ed3c4b2986d5ae64e58abeceeab Author: Denis Reva gmail com> AuthorDate: Tue Aug 6 14:22:00 2024 +0000 Commit: Lucio Sauer posteo net> CommitDate: Tue Aug 6 14:22:00 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=c267d408 app-containers/waydroid: Added more kernel checks * CONFIG_NETFILTER_XT_TARGET_MASQUERADE * CONFIG_NETFILTER_XT_NAT Closes: https://bugs.gentoo.org/937106 Signed-off-by: Denis Reva gmail.com> app-containers/waydroid/waydroid-1.4.2-r2.ebuild | 96 ++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/app-containers/waydroid/waydroid-1.4.2-r2.ebuild b/app-containers/waydroid/waydroid-1.4.2-r2.ebuild new file mode 100644 index 000000000..89c34aaa8 --- /dev/null +++ b/app-containers/waydroid/waydroid-1.4.2-r2.ebuild @@ -0,0 +1,96 @@ +# Copyright 2022-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +inherit linux-info xdg python-single-r1 + +DESCRIPTION="Container-based approach to boot a full Android system on Linux systems" +HOMEPAGE="https://waydro.id" +SRC_URI="https://github.com/${PN}/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~x86" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" +IUSE="apparmor +clipboard systemd" + +DEPEND="|| ( virtual/linux-sources virtual/dist-kernel )" +RDEPEND=" + systemd? ( sys-apps/systemd ) + app-containers/lxc[systemd?,apparmor?,seccomp] + $(python_gen_cond_dep ' + clipboard? ( >=dev-python/pyclip-0.7.0[wayland,${PYTHON_USEDEP}] ) + dev-python/pygobject[${PYTHON_USEDEP}] + >=dev-python/gbinder-1.1.1[${PYTHON_USEDEP}] + dev-python/dbus-python[${PYTHON_USEDEP}] + ') + net-firewall/nftables + net-dns/dnsmasq + >=dev-libs/libglibutil-1.0.67 + >=dev-libs/gbinder-1.1.21 + ${PYTHON_DEPS} +" + +CONFIG_CHECK=" + ~ANDROID_BINDER_IPC + ~ANDROID_BINDERFS + ~MEMFD_CREATE + ~NETFILTER_XT_TARGET_MASQUERADE + ~NETFILTER_XT_NAT +" +ERROR_ANDROID_BINDERFS="CONFIG_ANDROID_BINDERFS: need for creating Android-specific binder IPC channels" +ERROR_ANDROID_BINDER_IPC="CONFIG_ANDROID_BINDER_IPC: need for creating Android-specific binder IPC channels" +ERROR_MEMFD_CREATE="CONFIG_MEMFD_CREATE: it completely replaced deprecated ISHMEM drivers, + therefore it's vital for android-specific memory management" +ERROR_NETFILTER_XT_NAT="CONFIG_NETFILTER_XT_NAT: see bug #937106" +ERROR_NETFILTER_XT_TARGET_MASQUERADE="CONFIG_NETFILTER_XT_TARGET_MASQUERADE: see bug #937106" + + +pkg_setup() { + linux-info_pkg_setup + python-single-r1_pkg_setup +} + +src_prepare() { + if ! use apparmor; then + # https://github.com/waydroid/waydroid/issues/652 + sed -e '/^lxc\.apparmor\.profile =/d' \ + -i data/configs/config_3 || die + fi + default +} + +src_install() { + python_fix_shebang waydroid.py + emake install DESTDIR="${D}" USE_NFTABLES=1 USE_SYSTEMD=$(usex systemd 1 0) + if ! use systemd; then + elog "Installing waydroid OpenRC daemon" + doinitd "${FILESDIR}"/waydroid + fi +} + +pkg_postinst() { + xdg_pkg_postinst + + elog "After package installation run either 'emerge --config app-containers/waydroid'" + elog "or 'waydroid init' from root shell to install android container runtime" + elog "To run waydroid, 1. Start container: 'rc-service waydroid start'" + elog "2. start wayland channel (from user shell) 'waydroid session start'" + elog "Contact https://docs.waydro.id/usage/install-on-desktops for how-to guides" + elog "(does not cover Gentoo-specific things sadly)" + elog + + ewarn "Make sure you have NFTABLES up and running in your kernel. See" + ewarn "https://wiki.gentoo.org/wiki/Nftables for how-to details" + ewarn + + if use apparmor; then + ewarn "Apparmor support has not been tested by package maintainer yet" + fi +} + +pkg_config() { + "${EROOT}"/usr/bin/waydroid init +}