Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/droidcam/, media-video/droidcam/files/
Date: Fri, 30 Jul 2021 08:14:04
Message-Id: 1627632794.584dfbbe855193e26e5e5cf4cd1e94605a4913e4.andrewammerlaan@gentoo
1 commit: 584dfbbe855193e26e5e5cf4cd1e94605a4913e4
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 30 07:59:02 2021 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 30 08:13:14 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=584dfbbe
7
8 media-video/droidcam: add version 1.8.0
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
12
13 media-video/droidcam/Manifest | 1 +
14 media-video/droidcam/droidcam-1.8.0.ebuild | 144 +++++++++++++++++++++
15 .../droidcam/files/droidcam-makefile-fixes.patch | 12 +-
16 3 files changed, 151 insertions(+), 6 deletions(-)
17
18 diff --git a/media-video/droidcam/Manifest b/media-video/droidcam/Manifest
19 index 9d21ae1f813..6a9b200974b 100644
20 --- a/media-video/droidcam/Manifest
21 +++ b/media-video/droidcam/Manifest
22 @@ -1 +1,2 @@
23 DIST droidcam-1.7.3.tar.gz 83146 BLAKE2B b79d210a7d6a3cee7322b373cd92b2c1a326dd9887dff1df752e9818f9e7ed88dfdfd4a33a22ccb39c601df81c4e9538b1efa8029a9ad56f39d400fc50bc746b SHA512 39d6947b66f1be7896c56aa01d471cbd025deaeb2d2359f9434e5ea91e4302f4c16ee31486bb04fab1dfc7f6d8b2de3f6800ead665b7b3d366b01b25297beaba
24 +DIST droidcam-1.8.0.tar.gz 84376 BLAKE2B 581e57e2c80dd9662764e399dd797e5893f617e69ee2501a1063d1c51434baf64d7d2b72779debede6d679127f31fa95a4e67953978da591acbf6a41bd05551d SHA512 b448f686562030b352630c6b677a098ecb5041582dd06e57809b04674cb334d02ddfdf1d09b43e1ecc70897e8073714ad6913ab14d894a7679fc433adb3fda82
25
26 diff --git a/media-video/droidcam/droidcam-1.8.0.ebuild b/media-video/droidcam/droidcam-1.8.0.ebuild
27 new file mode 100644
28 index 00000000000..60f47eb1847
29 --- /dev/null
30 +++ b/media-video/droidcam/droidcam-1.8.0.ebuild
31 @@ -0,0 +1,144 @@
32 +# Copyright 2019-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +inherit desktop linux-mod xdg
38 +
39 +DESCRIPTION="Use your phone or tablet as webcam with a v4l device driver and app"
40 +HOMEPAGE="https://www.dev47apps.com/droidcam/linux/"
41 +SRC_URI="https://github.com/dev47apps/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
42 +
43 +KEYWORDS="~amd64"
44 +LICENSE="GPL-2"
45 +SLOT="0"
46 +
47 +IUSE="gtk"
48 +
49 +# Requires connection to phone/tablet
50 +RESTRICT="test"
51 +
52 +DEPEND="
53 + app-pda/libplist
54 + app-pda/libusbmuxd
55 + dev-libs/glib
56 + dev-libs/libappindicator:3
57 + dev-libs/libxml2
58 + dev-util/android-tools
59 + media-libs/alsa-lib
60 + media-libs/libjpeg-turbo
61 + >=media-libs/speex-1.2.0-r1
62 + media-video/ffmpeg
63 + gtk? (
64 + dev-cpp/gtkmm:3.0
65 + x11-libs/gdk-pixbuf
66 + x11-libs/gtk+:3
67 + x11-libs/libX11
68 + x11-libs/pango
69 + )
70 +"
71 +RDEPEND="${DEPEND}"
72 +BDEPEND="virtual/pkgconfig"
73 +
74 +BUILD_TARGETS="all"
75 +MODULE_NAMES="v4l2loopback-dc(video:${S}/v4l2loopback:${S}/v4l2loopback)"
76 +MODULESD_V4L2LOOPBACK_DC_ENABLED="yes"
77 +
78 +CONFIG_CHECK="~SND_ALOOP VIDEO_DEV MEDIA_SUPPORT MEDIA_CAMERA_SUPPORT"
79 +ERROR_SND_ALOOP="CONFIG_SND_ALOOP is optionally required for audio support"
80 +
81 +PATCHES="${FILESDIR}/${PN}-makefile-fixes.patch"
82 +
83 +src_prepare() {
84 + if ! use gtk; then
85 + sed -i -e '/cflags gtk+/d' Makefile || die
86 + default
87 + else
88 + # remove path and extension from Icon and Exec entry
89 + sed -i -e 's/Icon=\/opt\/droidcam-icon.png/Icon=droidcam/g' \
90 + -e 's/\/usr\/local\/bin\/droidcam/droidcam/g' \
91 + droidcam.desktop || die
92 + sed -i -e 's%/opt/droidcam-icon.png%/usr/share/icons/hicolor/96x96/apps/droidcam.png%g' src/droidcam.c || die
93 + xdg_src_prepare
94 + fi
95 +}
96 +
97 +src_configure() {
98 + set_arch_to_kernel
99 + default
100 +}
101 +
102 +src_compile() {
103 + if use gtk; then
104 + emake droidcam
105 + fi
106 + emake droidcam-cli
107 + KERNELRELEASE="${KV_FULL}" linux-mod_src_compile
108 +}
109 +
110 +src_test() {
111 + pushd "v4l2loopback" || die
112 + default
113 + ./test || die
114 + popd || die
115 +}
116 +
117 +src_install() {
118 + if use gtk; then
119 + dobin droidcam
120 + newicon -s 32 icon.png droidcam.png
121 + newicon -s 96 icon2.png droidcam.png
122 + domenu droidcam.desktop
123 + fi
124 + dobin droidcam-cli
125 +
126 + # The cli and gui do not auto load the module if unloaded (why not though?)
127 + # so we just put it in modules-load.d to make sure it always works
128 + insinto /etc/modules-load.d
129 + if linux_config_exists; then
130 + if linux_chkconfig_module SND_ALOOP; then
131 + newins - "${PN}.conf" <<-EOF
132 + v4l2loopback-dc
133 + snd_aloop
134 + EOF
135 + else
136 + newins - "${PN}.conf" <<-EOF
137 + v4l2loopback-dc
138 + EOF
139 + fi
140 + fi
141 +
142 + einstalldocs
143 + linux-mod_src_install
144 +}
145 +
146 +pkg_preinst() {
147 + if use gtk; then
148 + xdg_pkg_preinst
149 + fi
150 + linux-mod_pkg_preinst
151 +}
152 +
153 +pkg_postinst() {
154 + linux-mod_pkg_postinst
155 + if use gtk; then
156 + xdg_pkg_postinst
157 + else
158 + elog
159 + elog "Only droidcam-cli has been installed since 'gtk' flag was not set"
160 + elog
161 + fi
162 +
163 + elog "The default resolution for v4l2loopback-dc (i.e. droidcam) is 640x480."
164 + elog "You can change this value in /etc/modprobe.d/v4l2loopback-dc.conf"
165 + elog
166 + elog "Links to the Android/iPhone/iPad apps can be found at"
167 + elog "https://www.dev47apps.com/"
168 +}
169 +
170 +pkg_postrm() {
171 + if use gtk; then
172 + xdg_pkg_postrm
173 + fi
174 + linux-mod_pkg_postrm
175 +}
176
177 diff --git a/media-video/droidcam/files/droidcam-makefile-fixes.patch b/media-video/droidcam/files/droidcam-makefile-fixes.patch
178 index c413d7edd11..5230c18f0f3 100644
179 --- a/media-video/droidcam/files/droidcam-makefile-fixes.patch
180 +++ b/media-video/droidcam/files/droidcam-makefile-fixes.patch
181 @@ -1,5 +1,5 @@
182 diff --git a/Makefile b/Makefile
183 -index b5f696c..bcb5800 100644
184 +index 7be3c15..099a707 100644
185 --- a/Makefile
186 +++ b/Makefile
187 @@ -6,7 +6,7 @@
188 @@ -17,7 +17,7 @@ index b5f696c..bcb5800 100644
189 LIBS = -lspeex -lasound -lpthread -lm
190 -JPEG = -I$(JPEG_INCLUDE) $(JPEG_LIB)/libturbojpeg.a
191 +JPEG = -I$(JPEG_INCLUDE) $(JPEG_LIB)/libturbojpeg.so
192 - SRC = src/connection.c src/settings.c src/decoder*.c src/av.c src/usb.c
193 + SRC = src/connection.c src/settings.c src/decoder*.c src/av.c src/usb.c src/queue.c
194 -USBMUXD = -lusbmuxd
195 +USBMUXD = -lusbmuxd-2.0
196
197 @@ -35,13 +35,13 @@ index b5f696c..bcb5800 100644
198
199 droidcam-cli: LDLIBS += $(JPEG) $(LIBAV) $(LIBS)
200 droidcam-cli: src/droidcam-cli.c $(SRC)
201 -- $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
202 -+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
203 +- $(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
204 ++ $(CC) $(CPPFLAGS) $(CXXFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
205
206 droidcam: LDLIBS += $(GTK) $(JPEG) $(LIBAV) $(LIBS)
207 droidcam: src/droidcam.c src/resources.c $(SRC)
208 -- $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
209 -+ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
210 +- $(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
211 ++ $(CC) $(CPPFLAGS) $(CXXFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
212
213 clean:
214 rm -f droidcam