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 7810715810F for ; Thu, 8 Jun 2023 09:20:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 65105E087E; Thu, 8 Jun 2023 09:20:01 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3BD4AE087B for ; Thu, 8 Jun 2023 09:20:01 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 39EA3340BDA for ; Thu, 8 Jun 2023 09:20:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 69E40A86 for ; Thu, 8 Jun 2023 09:19:58 +0000 (UTC) From: "Andrew Ammerlaan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" Message-ID: <1686215985.e488e8f9b566776a08b6fa9e00ef1dbb3e77ec61.andrewammerlaan@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/droidcam/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-video/droidcam/droidcam-2.0.0-r2.ebuild X-VCS-Directories: media-video/droidcam/ X-VCS-Committer: andrewammerlaan X-VCS-Committer-Name: Andrew Ammerlaan X-VCS-Revision: e488e8f9b566776a08b6fa9e00ef1dbb3e77ec61 X-VCS-Branch: master Date: Thu, 8 Jun 2023 09:19:58 +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: 36c9c4e0-808c-42f3-a660-29c62a1fc5a2 X-Archives-Hash: 466084b41da2e81715e20d65f30babb0 commit: e488e8f9b566776a08b6fa9e00ef1dbb3e77ec61 Author: Andrew Ammerlaan gentoo org> AuthorDate: Thu Jun 8 09:19:20 2023 +0000 Commit: Andrew Ammerlaan gentoo org> CommitDate: Thu Jun 8 09:19:45 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e488e8f9 media-video/droidcam: linux-mod -> linux-mod-r1 eclass Signed-off-by: Andrew Ammerlaan gentoo.org> media-video/droidcam/droidcam-2.0.0-r2.ebuild | 143 ++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) diff --git a/media-video/droidcam/droidcam-2.0.0-r2.ebuild b/media-video/droidcam/droidcam-2.0.0-r2.ebuild new file mode 100644 index 000000000000..a3e84e4e5a70 --- /dev/null +++ b/media-video/droidcam/droidcam-2.0.0-r2.ebuild @@ -0,0 +1,143 @@ +# Copyright 2019-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit desktop linux-mod-r1 xdg + +DESCRIPTION="Use your phone or tablet as webcam with a v4l device driver and app" +HOMEPAGE="https://www.dev47apps.com/droidcam/linux/" +SRC_URI="https://github.com/dev47apps/${PN}/archive/v${PV//_rc1/-RC}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-${PV//_rc1/-RC}" + +KEYWORDS="~amd64" +LICENSE="GPL-2" +SLOT="0" + +IUSE="gtk" + +# Requires connection to phone/tablet +RESTRICT="test" + +DEPEND=" + app-pda/libplist + app-pda/libusbmuxd + dev-libs/glib + dev-libs/libayatana-appindicator + dev-libs/libxml2 + dev-util/android-tools + media-libs/alsa-lib + media-libs/libjpeg-turbo + >=media-libs/speex-1.2.0-r1 + media-video/ffmpeg + gtk? ( + x11-libs/gdk-pixbuf + x11-libs/gtk+:3 + x11-libs/libX11 + x11-libs/pango + ) +" +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +CONFIG_CHECK="~SND_ALOOP VIDEO_DEV MEDIA_SUPPORT MEDIA_CAMERA_SUPPORT" +ERROR_SND_ALOOP="CONFIG_SND_ALOOP is optionally required for audio support" + +PATCHES=( + "${FILESDIR}/${P}-libusbmuxd-20.patch" +) + +src_prepare() { + if ! use gtk; then + default + sed -i -e '/cflags gtk+/d' Makefile || die + else + default + # remove path and extension from Icon and Exec entry + sed -i -e 's/Icon=\/opt\/droidcam-icon.png/Icon=droidcam/g' \ + -e 's/\/usr\/local\/bin\/droidcam/droidcam/g' \ + droidcam.desktop || die + sed -i -e 's%/opt/droidcam-icon.png%/usr/share/icons/hicolor/96x96/apps/droidcam.png%g' src/droidcam.c || die + fi +} + +src_configure() { + set_arch_to_kernel + default +} + +src_compile() { + if use gtk; then + APPINDICATOR=ayatana-appindicator3-0.1 emake droidcam + fi + APPINDICATOR=ayatana-appindicator3-0.1 emake droidcam-cli + + local modlist=( + v4l2loopback-dc=video:v4l2loopback:v4l2loopback:all + ) + linux-mod-r1_src_compile +} + +src_test() { + pushd "v4l2loopback" || die + default + ./test || die + popd || die +} + +src_install() { + if use gtk; then + dobin droidcam + newicon -s 32 icon.png droidcam.png + newicon -s 96 icon2.png droidcam.png + domenu droidcam.desktop + fi + dobin droidcam-cli + + # The cli and gui do not auto load the module if unloaded, + # so we just put it in modules-load.d to make sure it always works + insinto /etc/modules-load.d + if linux_config_exists; then + if linux_chkconfig_module SND_ALOOP; then + newins - "${PN}.conf" <<-EOF + v4l2loopback-dc + snd_aloop + EOF + else + newins - "${PN}.conf" <<-EOF + v4l2loopback-dc + EOF + fi + fi + + linux-mod-r1_src_install +} + +pkg_preinst() { + if use gtk; then + xdg_pkg_preinst + fi +} + +pkg_postinst() { + linux-mod-r1_pkg_postinst + if use gtk; then + xdg_pkg_postinst + else + elog + elog "Only droidcam-cli has been installed since 'gtk' flag was not set" + elog + fi + + elog "The default resolution for v4l2loopback-dc (i.e. droidcam) is 640x480." + elog "You can change this value in /etc/modprobe.d/v4l2loopback-dc.conf" + elog + elog "Links to the Android/iPhone/iPad apps can be found at" + elog "https://www.dev47apps.com/" +} + +pkg_postrm() { + if use gtk; then + xdg_pkg_postrm + fi +}