From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1346957-garchives=archives.gentoo.org@lists.gentoo.org>
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 9575E158086
	for <garchives@archives.gentoo.org>; Tue,  7 Dec 2021 10:04:02 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id E40FE2BC00A;
	Tue,  7 Dec 2021 10:04:01 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.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) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id B4C222BC002
	for <gentoo-commits@lists.gentoo.org>; Tue,  7 Dec 2021 10:04:01 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(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 C7C80342B5A
	for <gentoo-commits@lists.gentoo.org>; Tue,  7 Dec 2021 10:04:00 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 7C8E61FE
	for <gentoo-commits@lists.gentoo.org>; Tue,  7 Dec 2021 10:03:59 +0000 (UTC)
From: "Andrew Ammerlaan" <andrewammerlaan@gentoo.org>
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" <andrewammerlaan@gentoo.org>
Message-ID: <1638871436.11969b481623edbaf7ea89dff434f24917da08be.andrewammerlaan@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/droidcam/
X-VCS-Repository: repo/gentoo
X-VCS-Files: media-video/droidcam/Manifest media-video/droidcam/droidcam-1.8.1.ebuild
X-VCS-Directories: media-video/droidcam/
X-VCS-Committer: andrewammerlaan
X-VCS-Committer-Name: Andrew Ammerlaan
X-VCS-Revision: 11969b481623edbaf7ea89dff434f24917da08be
X-VCS-Branch: master
Date: Tue,  7 Dec 2021 10:03:59 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: df0ebfd1-a2b7-4eb4-9df6-1e50a67d2da2
X-Archives-Hash: 6e996d03a6d07449cf986d22c4c71eea

commit:     11969b481623edbaf7ea89dff434f24917da08be
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Tue Dec  7 09:59:36 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Tue Dec  7 10:03:56 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11969b48

media-video/droidcam: add version 1.8.1

Package-Manager: Portage-3.0.28, Repoman-3.0.3
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 media-video/droidcam/Manifest              |   1 +
 media-video/droidcam/droidcam-1.8.1.ebuild | 156 +++++++++++++++++++++++++++++
 2 files changed, 157 insertions(+)

diff --git a/media-video/droidcam/Manifest b/media-video/droidcam/Manifest
index eaca205848fa..eeff2b0ec94a 100644
--- a/media-video/droidcam/Manifest
+++ b/media-video/droidcam/Manifest
@@ -1 +1,2 @@
 DIST droidcam-1.8.0.tar.gz 84376 BLAKE2B 581e57e2c80dd9662764e399dd797e5893f617e69ee2501a1063d1c51434baf64d7d2b72779debede6d679127f31fa95a4e67953978da591acbf6a41bd05551d SHA512 b448f686562030b352630c6b677a098ecb5041582dd06e57809b04674cb334d02ddfdf1d09b43e1ecc70897e8073714ad6913ab14d894a7679fc433adb3fda82
+DIST droidcam-1.8.1.tar.gz 84566 BLAKE2B ba023c98159003bef39eac2fcff211243aa5fb2cc4369a333c5b78c9708b8c34ff9987d6b84628b32e436bab776e0c8c83f75b7c6a788f85831d3d17dd468833 SHA512 58ce6014004edcbf89b4847ed916f9cd2757865172c61e446a04b2f6d93395db1013f0cb31f0b10161bfd83a1436e684891c3457371a3ad62308509bb85b4cf4

diff --git a/media-video/droidcam/droidcam-1.8.1.ebuild b/media-video/droidcam/droidcam-1.8.1.ebuild
new file mode 100644
index 000000000000..d81482560789
--- /dev/null
+++ b/media-video/droidcam/droidcam-1.8.1.ebuild
@@ -0,0 +1,156 @@
+# Copyright 2019-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit desktop linux-mod 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}.tar.gz -> ${P}.tar.gz"
+
+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/libappindicator:3
+	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? (
+		dev-cpp/gtkmm:3.0
+		x11-libs/gdk-pixbuf
+		x11-libs/gtk+:3
+		x11-libs/libX11
+		x11-libs/pango
+	)
+"
+RDEPEND="${DEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+BUILD_TARGETS="all"
+MODULE_NAMES="v4l2loopback-dc(video:${S}/v4l2loopback:${S}/v4l2loopback)"
+MODULESD_V4L2LOOPBACK_DC_ENABLED="yes"
+
+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}/${PN}-makefile-fixes.patch"
+
+src_prepare() {
+	if ! use gtk; then
+		sed -i -e '/cflags gtk+/d' Makefile || die
+		default
+	else
+		# 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
+		xdg_src_prepare
+	fi
+}
+
+src_configure() {
+	set_arch_to_kernel
+	default
+}
+
+src_compile() {
+	if use gtk; then
+		emake droidcam
+	fi
+	emake droidcam-cli
+
+	if linux_chkconfig_present CC_IS_CLANG; then
+		BUILD_PARAMS+=' CC=${CHOST}-clang'
+		if linux_chkconfig_present LD_IS_LLD; then
+			BUILD_PARAMS+=' LD=ld.lld'
+			if linux_chkconfig_present LTO_CLANG_THIN; then
+				# kernel enables cache by default leading to sandbox violations
+				BUILD_PARAMS+=' ldflags-y=--thinlto-cache-dir= LDFLAGS_MODULE=--thinlto-cache-dir='
+			fi
+		fi
+	fi
+	export KERNEL_DIR || die
+	linux-mod_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 (why not though?)
+	# 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
+
+	einstalldocs
+	linux-mod_src_install
+}
+
+pkg_preinst() {
+	linux-mod_pkg_preinst
+	if use gtk; then
+		xdg_pkg_preinst
+	fi
+}
+
+pkg_postinst() {
+	linux-mod_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() {
+	linux-mod_pkg_postrm
+	if use gtk; then
+		xdg_pkg_postrm
+	fi
+}