commit:     57e27e4d1408679f7ffeddd6bbba7381f1276c66
Author:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Sat May 22 13:09:33 2021 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Sat May 22 13:14:48 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57e27e4d

media-video/droidcam: import from ::guru

Closes: https://bugs.gentoo.org/339780
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>

 media-video/droidcam/Manifest                      |   1 +
 media-video/droidcam/droidcam-1.7.3.ebuild         | 142 +++++++++++++++++++++
 .../droidcam/files/droidcam-makefile-fixes.patch   |  47 +++++++
 media-video/droidcam/metadata.xml                  |  35 +++++
 4 files changed, 225 insertions(+)

diff --git a/media-video/droidcam/Manifest b/media-video/droidcam/Manifest
new file mode 100644
index 00000000000..9d21ae1f813
--- /dev/null
+++ b/media-video/droidcam/Manifest
@@ -0,0 +1 @@
+DIST droidcam-1.7.3.tar.gz 83146 BLAKE2B 
b79d210a7d6a3cee7322b373cd92b2c1a326dd9887dff1df752e9818f9e7ed88dfdfd4a33a22ccb39c601df81c4e9538b1efa8029a9ad56f39d400fc50bc746b
 SHA512 
39d6947b66f1be7896c56aa01d471cbd025deaeb2d2359f9434e5ea91e4302f4c16ee31486bb04fab1dfc7f6d8b2de3f6800ead665b7b3d366b01b25297beaba

diff --git a/media-video/droidcam/droidcam-1.7.3.ebuild 
b/media-video/droidcam/droidcam-1.7.3.ebuild
new file mode 100644
index 00000000000..9ac87c8084a
--- /dev/null
+++ b/media-video/droidcam/droidcam-1.7.3.ebuild
@@ -0,0 +1,142 @@
+# 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 entry
+               sed -i -e 's/Icon=\/opt\/droidcam-icon.png/Icon=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
+       KERNELRELEASE="${KV_FULL}" linux-mod_src_compile
+}
+
+src_test() {
+       pushd "v4l2loopback"
+       default
+       ./test || die
+       popd
+}
+
+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() {
+       if use gtk; then
+               xdg_pkg_preinst
+       fi
+       linux-mod_pkg_preinst
+}
+
+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() {
+       if use gtk; then
+               xdg_pkg_postrm
+       fi
+       linux-mod_pkg_postrm
+}

diff --git a/media-video/droidcam/files/droidcam-makefile-fixes.patch 
b/media-video/droidcam/files/droidcam-makefile-fixes.patch
new file mode 100644
index 00000000000..c413d7edd11
--- /dev/null
+++ b/media-video/droidcam/files/droidcam-makefile-fixes.patch
@@ -0,0 +1,47 @@
+diff --git a/Makefile b/Makefile
+index b5f696c..bcb5800 100644
+--- a/Makefile
++++ b/Makefile
+@@ -6,7 +6,7 @@
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ # Use at your own risk. See README file for more details.
+ 
+-JPEG_DIR ?= /opt/libjpeg-turbo
++JPEG_DIR ?= /usr
+ JPEG_INCLUDE ?= $(JPEG_DIR)/include
+ JPEG_LIB ?= $(JPEG_DIR)/lib`getconf LONG_BIT`
+ 
+@@ -16,15 +16,15 @@ GTK   = `pkg-config --libs --cflags gtk+-3.0` `pkg-config 
--libs x11`
+ GTK  += `pkg-config --cflags --libs appindicator3-0.1`
+ LIBAV = `pkg-config --libs --cflags libswscale libavutil`
+ LIBS  =  -lspeex -lasound -lpthread -lm
+-JPEG  = -I$(JPEG_INCLUDE) $(JPEG_LIB)/libturbojpeg.a
++JPEG  = -I$(JPEG_INCLUDE) $(JPEG_LIB)/libturbojpeg.so
+ SRC   = src/connection.c src/settings.c src/decoder*.c src/av.c src/usb.c
+-USBMUXD = -lusbmuxd
++USBMUXD = -lusbmuxd-2.0
+ 
+ all: droidcam-cli droidcam
+ 
+ ifneq "$(RELEASE)" ""
+-LIBAV = /usr/lib/x86_64-linux-gnu/libswscale.a 
/usr/lib/x86_64-linux-gnu/libavutil.a
+-SRC  += src/libusbmuxd.a src/libxml2.a src/libplist-2.0.a
++LIBAV = /usr/lib/x86_64-linux-gnu/libswscale.so 
/usr/lib/x86_64-linux-gnu/libavutil.so
++SRC  += src/libusbmuxd-2.0.so src/libxml2.so src/libplist-2.0.so
+ package: clean all
+       zip "droidcam_$(RELEASE).zip" \
+               LICENSE README* icon2.png  \
+@@ -40,11 +40,11 @@ gresource: .gresource.xml icon2.png
+ 
+ droidcam-cli: LDLIBS += $(JPEG) $(LIBAV) $(LIBS)
+ droidcam-cli: src/droidcam-cli.c $(SRC)
+-      $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
++      $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
+ 
+ droidcam: LDLIBS += $(GTK) $(JPEG) $(LIBAV) $(LIBS)
+ droidcam: src/droidcam.c src/resources.c $(SRC)
+-      $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
++      $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
+ 
+ clean:
+       rm -f droidcam

diff --git a/media-video/droidcam/metadata.xml 
b/media-video/droidcam/metadata.xml
new file mode 100644
index 00000000000..59c13c93d8b
--- /dev/null
+++ b/media-video/droidcam/metadata.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Andrew Ammerlaan</name>
+       </maintainer>
+       <use>
+               <flag name="gtk">Build the <pkg>dev-cpp/gtkmm</pkg>:3.0 
client.</flag>
+       </use>
+       <longdescription>
+               DroidCam turns your phone/tablet into a webcam for your PC.
+               Use it with chat programs like Zoom, MS Teams, and Skype.
+
+               Main Features:
+               – Chat using “DroidCam Webcam” on your computer, including 
Sound and Picture.
+               – Connect over WiFi or USB cable.
+               – Unlimited free usage at standard definition.
+               – Keep using your phone with DroidCam in background (Android).
+               – Simple, safe, efficient, and trusted by millions of people 
worldwide.
+
+               DroidCamX Pro Features:
+               – Switch to HD Mode for 720p/1080p high definition video.
+               – Camera controls: toggle light, enable continuous auto focus, 
zoom in/out.
+               – Rotate, Flip and Mirror the video to better match your setup.
+               – Adjust brightness, contrast, add video delay and adjust audio 
volume (Windows).
+               – USB-Only mode for extra privacy and security.
+               – Option to auto-mute phone calls.
+               – No Ads.
+       </longdescription>
+       <upstream>
+               <remote-id type="github">dev47apps/droidcam</remote-id>
+               <bugs-to>https://github.com/dev47apps/droidcam/issues</bugs-to>
+       </upstream>
+</pkgmetadata>

Reply via email to