diff options
Diffstat (limited to 'media-video/droidcam')
-rw-r--r-- | media-video/droidcam/Manifest | 3 | ||||
-rw-r--r-- | media-video/droidcam/droidcam-1.8.2_p20220831.ebuild | 158 | ||||
-rw-r--r-- | media-video/droidcam/files/droidcam-1.8.2_p20220831-makefile-fixes.patch | 68 |
3 files changed, 229 insertions, 0 deletions
diff --git a/media-video/droidcam/Manifest b/media-video/droidcam/Manifest index cf652118646e..25cd00e39ee3 100644 --- a/media-video/droidcam/Manifest +++ b/media-video/droidcam/Manifest @@ -1,4 +1,7 @@ AUX droidcam-1.8.2-makefile-fixes.patch 2156 BLAKE2B 285f07e3fcf679878b0eec87d04dd411c4c15af90bf9d0e1509d330159c057d224125cda98bdaaaf65b4d8b420d9501b10185a8ff8a7a4dfb93cf002e2e882fe SHA512 02c97d9a22209218f8b8b3a245bf83ea095a9f3b6999b3bd11aa43374ef65eb87d361b7d34a9cfd1fcb879c1136f2f356cd4511f3c05188bea523edacf606fbe +AUX droidcam-1.8.2_p20220831-makefile-fixes.patch 2181 BLAKE2B 82cfc66741ac1794ed822e6bd633600bc00e2289eb5bd3a3b2ca4ac71110262ba894503e07f089c46a1650e48d751b72893952393d874767afaa6ccb5e2c65a1 SHA512 abe964a3562ddcd7926f4985c9713ceae3881929b5eae2443461a2828e05975acc84901bf633f06116891170af91f9a6af5990f40303cce6c8b25c1ab33290ef DIST droidcam-1.8.2.tar.gz 84797 BLAKE2B b2458dd04b467106a6d9a8a9f3d44058641a7c8ca429d5c92f498401c07f6bc364dc056755f21b40faac7e7aec1877250afb119ac3b7f979b24cdeb86f45c384 SHA512 507f513c8d0dffa86afe5368ccab5461931e236b6352269a6eb5e970a79e5f9b386808da3466f3b391e955170b47b24a82663632ddc3c3c84e4de5988b7d3f8f +DIST droidcam-1.8.2_p20220831.tar.gz 84943 BLAKE2B db54f39a9b303b4b06dfdfcb6bf9323ce25f8cea4594cdcec063685fea531fdeb915caab393d0edf72086deb592345d7ca6aefd546d44f06e24855d66fbd8d47 SHA512 c30848c2348c70a15c46f894b1c0547a3e904bbb8582ae2d34009dbc9b0d006a49ab3950fef4491f76f838fd091d68ec1d63d5b1f52e793e98936fe5f2d44b5c EBUILD droidcam-1.8.2-r1.ebuild 3460 BLAKE2B 90b337253fb83989eb5824bd7556c9b64c8df235be51d8576c914576d601f50d398307afd73fd474b1ffdccb8cf7cf50c300c6a1fc5e0b85780dabe8a0338d4e SHA512 82b6c5aa23db6cad507d515251c85d011b3272a98169cf293b142c7a139d4f18fe626d703b0c355fb245e04430c08dc1dc83a0d214f1051ec42dda5ba983b201 +EBUILD droidcam-1.8.2_p20220831.ebuild 3553 BLAKE2B 4cdf69095eb3b52fea858c1036115b36619167571ae07d7c02449c9895ea0992f360a82624e2cf7f7844fb582abb01441a796dcd5a395fb70a7a98a52211089c SHA512 861935111ea01870c33e23585fc1d629678c90dbd27f4319ec18dac18a71658c1cf87925ec4c785165a4b5dcecd53becd1c59ca85ed34a250b9656bb3e776987 MISC metadata.xml 1421 BLAKE2B 6d46f5cbd0a226d749b35d8e90a965d4f12fa609b6e95ea6effe87730bce525c0fadb14aa3eb8b99d60f91c7c46a542df5073a55f018f9c06877758360b91e60 SHA512 9dfe075ab79599ecfa3cb9cbf607e4e9a14dd6d002fb3f84bd2d809d962a8bf52b7a0a7166b6805ce4816a57c08e57ab4b224ae1de4e44130bb52f1674ea1e02 diff --git a/media-video/droidcam/droidcam-1.8.2_p20220831.ebuild b/media-video/droidcam/droidcam-1.8.2_p20220831.ebuild new file mode 100644 index 000000000000..401a7d918546 --- /dev/null +++ b/media-video/droidcam/droidcam-1.8.2_p20220831.ebuild @@ -0,0 +1,158 @@ +# Copyright 2019-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit desktop linux-mod xdg + +COMMIT="d1c3206306f948a8e86c7a256f1ca1be09b114b1" + +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/${COMMIT}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-${COMMIT}" + +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" + +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}-1.8.2_p20220831-makefile-fixes.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 + 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 +} diff --git a/media-video/droidcam/files/droidcam-1.8.2_p20220831-makefile-fixes.patch b/media-video/droidcam/files/droidcam-1.8.2_p20220831-makefile-fixes.patch new file mode 100644 index 000000000000..60454427e41a --- /dev/null +++ b/media-video/droidcam/files/droidcam-1.8.2_p20220831-makefile-fixes.patch @@ -0,0 +1,68 @@ +diff --git a/Makefile b/Makefile +index b372b09..d18ddba 100644 +--- a/Makefile ++++ b/Makefile +@@ -11,31 +11,21 @@ + # Example: + # APPINDICATOR=ayatana-appindicator3-0.1 make droidcam + +-APPINDICATOR ?= appindicator3-0.1 +-JPEG_DIR ?= /opt/libjpeg-turbo +-JPEG_INCLUDE ?= $(JPEG_DIR)/include +-JPEG_LIB ?= $(JPEG_DIR)/lib`getconf LONG_BIT` +- +- +-CC = gcc +-CFLAGS = -Wall -O2 + GTK = `pkg-config --libs --cflags gtk+-3.0` `pkg-config --libs x11` +-GTK += `pkg-config --libs --cflags $(APPINDICATOR)` ++GTK += `pkg-config --libs --cflags ayatana-appindicator3-0.1` + LIBAV = `pkg-config --libs --cflags libswscale libavutil` + LIBS = -lspeex -lasound -lpthread -lm +-JPEG = -I$(JPEG_INCLUDE) $(JPEG_LIB)/libturbojpeg.a ++JPEG = `pkg-config --libs --cflags libturbojpeg` + SRC = src/connection.c src/settings.c src/decoder*.c src/av.c src/usb.c src/queue.c +-USBMUXD = -lusbmuxd ++USBMUXD = -lusbmuxd-2.0 + +-ifneq ($(findstring ayatana,$(APPINDICATOR)),) +- CFLAGS += -DUSE_AYATANA_APPINDICATOR +-endif ++CFLAGS += -DUSE_AYATANA_APPINDICATOR + + + all: droidcam-cli droidcam + + ifneq "$(RELEASE)" "" +-SRC += src/libusbmuxd.a src/libxml2.a src/libplist-2.0.a ++SRC += src/libusbmuxd-2.0.s0 src/libxml2.so src/libplist-2.0.so + package: clean all + zip "droidcam_$(RELEASE).zip" \ + LICENSE README* icon2.png \ +@@ -51,11 +41,11 @@ gresource: .gresource.xml icon2.png + + droidcam-cli: LDLIBS += $(JPEG) $(LIBAV) $(LIBS) + droidcam-cli: src/droidcam-cli.c $(SRC) +- $(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) ++ $(CC) $(CXXFLAGS) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) + + droidcam: LDLIBS += $(GTK) $(JPEG) $(LIBAV) $(LIBS) + droidcam: src/droidcam.c src/resources.c $(SRC) +- $(CC) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) ++ $(CC) $(CXXFLAGS) $(CPPFLAGS) $(CFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS) + + clean: + rm -f droidcam +diff --git a/v4l2loopback/Makefile b/v4l2loopback/Makefile +index 28c4502..02356e9 100644 +--- a/v4l2loopback/Makefile ++++ b/v4l2loopback/Makefile +@@ -11,7 +11,7 @@ install: + $(MAKE) -C $(KERNEL_DIR) M=$(PWD) modules_install + + test: +- gcc test.c -o test ++ $(CC) test.c -o test + + clean: + $(MAKE) -C $(KERNEL_DIR) M=$(PWD) clean |