commit:     49ec79b7886deb031a8488d6a51f07dc2af34f6b
Author:     Marco Scardovi <marco <AT> scardovi <DOT> com>
AuthorDate: Tue Jun 22 22:29:50 2021 +0000
Commit:     Marco Scardovi <marco <AT> scardovi <DOT> com>
CommitDate: Tue Jun 22 22:31:26 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=49ec79b7

net-voip/calls: add package

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Marco Scardovi <marco <AT> scardovi.com>

 net-voip/calls/Manifest                            |  1 +
 net-voip/calls/calls-0.3.4.ebuild                  | 60 ++++++++++++++++++++++
 .../calls/files/0001-use-at-cmds-to-mute.patch     | 36 +++++++++++++
 net-voip/calls/metadata.xml                        | 11 ++++
 4 files changed, 108 insertions(+)

diff --git a/net-voip/calls/Manifest b/net-voip/calls/Manifest
new file mode 100644
index 000000000..136631864
--- /dev/null
+++ b/net-voip/calls/Manifest
@@ -0,0 +1 @@
+DIST calls-0.3.4.tar.gz 203835 BLAKE2B 
dddafde2c5c1b247a603947679ed9335331ecfacbcdf73dbacc2f8542de783d8acdd398b0ab589680a24097d723dca731600a1886ed923be3889b00a60391ad5
 SHA512 
39463fcf493c8aeb428d41111adc957203dbcb57c033b2025c4932e52c8e158d17687df0ec13ffe4bf704b4c3ec75cdf3bfbacc6f839fd7193290d239df0df72

diff --git a/net-voip/calls/calls-0.3.4.ebuild 
b/net-voip/calls/calls-0.3.4.ebuild
new file mode 100644
index 000000000..47325b647
--- /dev/null
+++ b/net-voip/calls/calls-0.3.4.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+VALA_USE_DEPEND="vapigen"
+
+inherit vala meson gnome2-utils xdg
+
+MY_P="${PN}-v${PV}"
+
+DESCRIPTION="Phone dialer and call handler"
+HOMEPAGE="https://source.puri.sm/Librem5/calls";
+SRC_URI="https://source.puri.sm/Librem5/calls/-/archive/v0.3.4/calls-v0.3.4.tar.gz
 -> ${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+
+IUSE="+introspection +vala"
+REQUIRED_USE="vala? ( introspection )"
+
+DEPEND="
+       dev-libs/feedbackd
+       dev-libs/folks
+       dev-libs/gom
+       dev-libs/libpeas
+       gnome-extra/evolution-data-server
+       >=gui-libs/libhandy-1.1.90
+       >=media-sound/callaudiod-0.0.5
+       >=net-misc/modemmanager-1.12.0
+       net-libs/sofia-sip
+"
+RDEPEND="${DEPEND}"
+BDEPEND="
+       dev-libs/gobject-introspection
+       dev-util/meson
+       dev-util/wayland-scanner
+       vala? ( $(vala_depend) )
+"
+
+PATCHES=( "${FILESDIR}/0001-use-at-cmds-to-mute.patch" )
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+       default
+       eapply_user
+       use vala && vala_src_prepare
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+       gnome2_schemas_update
+}
+
+pkg_postrm() {
+       xdg_pkg_postrm
+       gnome2_schemas_update
+}

diff --git a/net-voip/calls/files/0001-use-at-cmds-to-mute.patch 
b/net-voip/calls/files/0001-use-at-cmds-to-mute.patch
new file mode 100644
index 000000000..cb1aa14c2
--- /dev/null
+++ b/net-voip/calls/files/0001-use-at-cmds-to-mute.patch
@@ -0,0 +1,36 @@
+diff --git a/src/calls-call-display.c b/src/calls-call-display.c
+index bf98958..c8b1bc4 100644
+--- a/src/calls-call-display.c
++++ b/src/calls-call-display.c
+@@ -34,6 +34,8 @@
+ 
+ #include <libcallaudio.h>
+ 
++#include <stdlib.h>
++
+ struct _CallsCallDisplay
+ {
+   GtkOverlay parent_instance;
+@@ -103,11 +105,17 @@ mute_toggled_cb (GtkToggleButton  *togglebutton,
+   g_autoptr (GError) error = NULL;
+ 
+   want_mute = gtk_toggle_button_get_active (togglebutton);
+-  ret = call_audio_mute_mic (want_mute, &error);
+-  if (!ret && error)
+-    g_warning ("Failed to %smute microphone: %s",
+-               want_mute ? "" : "un",
+-               error->message);
++
++  gchar* command = g_strdup_printf("/usr/bin/mmcli -m 0 
--command=AT+CMUT=%d",want_mute?1:0);
++
++  int exit_code;
++
++  ret = g_spawn_command_line_sync(command, NULL,NULL,&exit_code, &error);
++
++  if(!ret || error || exit_code != 0){
++      g_warning ("Failed to %smute microphone (mmcli exit code: %d)",
++                   want_mute ? "" : "un", exit_code);
++  }    
+ }
+ 
+ 

diff --git a/net-voip/calls/metadata.xml b/net-voip/calls/metadata.xml
new file mode 100644
index 000000000..a0b29038e
--- /dev/null
+++ b/net-voip/calls/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>ma...@scardovi.com</email>
+               <name>Marco Scardovi</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">atom/atom</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to