Files
jami-daemon/globals.mk
Maxim Cournoyer e23a88672d account: Make the default ringtone path portable.
Before this change, the default ringtone path would be for example set
to "/data/data/cx.ring/files/ringtones/default.opus" on Android;
migrating the account to GNU/Linux would cause the ringtone to not be
found.  The change leverages existing code that searches for a base
file name in a JAMI_DATADIR-prefixed location.

* globals.mk: Set JAMI_DATADIR from the environment if it's defined.
* src/account.cpp (DEFAULT_RINGTONE_PATH): Universally set to
"default.opus";
* src/manager.cpp: Add a definition check for the JAMI_DATADIR macro.
(Manager::playRingtone): Go through the ringtone path resolution
scheme on all platforms.  Some platforms will need to define the
JAMI_DATADIR macro correctly for this to work; for example the
libjami build on Android should have the JAMI_DATADIR macro set to
"/data/data/cx.ring/files" for this to work correctly.

Accompanying client-android change:
https://review.jami.net/c/jami-client-android/+/21148

Co-authored-by: Amin Bandali <amin.bandali@savoirfairelinux.com>
Change-Id: Ia408a8db263af91c2734f61aa38c4ed717605359
2022-02-25 09:15:40 -05:00

33 lines
842 B
Makefile

# Global variables
src=$(abs_top_srcdir)
ASTYLERC="$(top_srcdir)/../astylerc"
indent="/usr/bin/astyle"
RING_DIRTY_REPO ?= $(shell git diff-index --quiet HEAD 2>/dev/null || echo dirty)
RING_REVISION ?= $(shell git log -1 --format="%h" --abbrev=10 2>/dev/null)
JAMI_DATADIR ?= $(datadir)/jami
# Preprocessor flags
AM_CPPFLAGS += \
-I$(src)/src \
-I$(src)/src/config \
-I$(src)/src/media \
-I$(src)/test \
-I$(src)/src/jami \
$(SIP_CFLAGS) \
-DPREFIX=\"$(prefix)\" \
-DJAMI_DATADIR=\"$(JAMI_DATADIR)\" \
-DENABLE_TRACE \
-DRING_REVISION=\"$(RING_REVISION)\" \
-DRING_DIRTY_REPO=\"$(RING_DIRTY_REPO)\" \
-DPJSIP_MAX_PKT_LEN=8000 \
-DPJ_AUTOCONF=1
indent:
@echo "Indenting code:"
if [ -f $(ASTYLERC) ] ; then \
find $(top_srcdir)/src/ -name \*.cpp -o -name \*.h | xargs $(indent) --options=$(ASTYLERC) ; \
fi