Skip to content
Snippets Groups Projects
Commit f0fb8148 authored by Maxim Cournoyer's avatar Maxim Cournoyer Committed by Adrien Béraud
Browse files

daemon: Use the PROGSHAREDIR macro to refer to the custom datadir.

The sources previously hard-coded the location of the default Jami
ringtone as "/usr/share/ring/ringtones/default.opus".  It should
instead be computed from the already existing PROGSHAREDIR macro,
which is built from Autoconf's configurable datadir.

* globals.mk (-DPROGSHAREDIR): Rename the 'ring' subdirectory to
'jami'.
* meson.build (conf): Likewise.
* ringtones/Makefile.am (dist_jamiringtones_DATA): s/ring/jami/g
* ringtones/meson.build: Likewise.
* src/account.cpp (DEFAULT_RINGTONE_PATH): Define in terms of
PROGSHAREDIR.
* bin/dbus/Makefile.am (libclient_dbus_la_CXXFLAGS): Remove extraneous
flags, already propagated via AM_CPPFLAGS.  Honor AM_CXXFLAGS.
* src/client/Makefile.am (libclient_la_CXXFLAGS): Remove.
* src/plugin/Makefile.am (libplugin_la_CXXFLAGS): Likewise.

Change-Id: Icaa0a92e896f86b0bb07f82e4079570db08fafbd
parent 11a85bde
Branches
Tags
No related merge requests found
...@@ -58,12 +58,7 @@ if ENABLE_VIDEO ...@@ -58,12 +58,7 @@ if ENABLE_VIDEO
libclient_dbus_la_SOURCES += dbusvideomanager.cpp dbusvideomanager.h libclient_dbus_la_SOURCES += dbusvideomanager.cpp dbusvideomanager.h
endif endif
libclient_dbus_la_CXXFLAGS = -I../ \ libclient_dbus_la_CXXFLAGS = $(AM_CXXFLAGS) $(DBUSCPP_CFLAGS)
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/dring \
-DPREFIX=\"$(prefix)\" \
-DPROGSHAREDIR=\"${datadir}/ring\" \
$(DBUSCPP_CFLAGS)
do_subst = $(SED) \ do_subst = $(SED) \
-e 's,[@]bindir[@],$(bindir),g' -e 's,[@]bindir[@],$(bindir),g'
......
...@@ -17,7 +17,7 @@ AM_CPPFLAGS += \ ...@@ -17,7 +17,7 @@ AM_CPPFLAGS += \
-I$(src)/src/dring \ -I$(src)/src/dring \
$(SIP_CFLAGS) \ $(SIP_CFLAGS) \
-DPREFIX=\"$(prefix)\" \ -DPREFIX=\"$(prefix)\" \
-DPROGSHAREDIR=\"${datadir}/ring\" \ -DPROGSHAREDIR=\"$(datadir)/jami\" \
-DENABLE_TRACE \ -DENABLE_TRACE \
-DRING_REVISION=\"$(RING_REVISION)\" \ -DRING_REVISION=\"$(RING_REVISION)\" \
-DRING_DIRTY_REPO=\"$(RING_DIRTY_REPO)\" \ -DRING_DIRTY_REPO=\"$(RING_DIRTY_REPO)\" \
......
...@@ -66,7 +66,7 @@ conf.set_quoted('PACKAGE', 'jami') ...@@ -66,7 +66,7 @@ conf.set_quoted('PACKAGE', 'jami')
conf.set_quoted('PACKAGE_NAME', 'Jami Daemon') conf.set_quoted('PACKAGE_NAME', 'Jami Daemon')
conf.set_quoted('PACKAGE_VERSION', meson.project_version()) conf.set_quoted('PACKAGE_VERSION', meson.project_version())
conf.set_quoted('PACKAGE_STRING', 'Jami Daemon ' + meson.project_version()) conf.set_quoted('PACKAGE_STRING', 'Jami Daemon ' + meson.project_version())
conf.set_quoted('PROGSHAREDIR', get_option('datadir') / 'ring') conf.set_quoted('PROGSHAREDIR', get_option('datadir') / 'jami')
depopensl = meson.get_compiler('cpp').find_library('OpenSLES', has_headers: 'SLES/OpenSLES.h', required: get_option('opensl')) depopensl = meson.get_compiler('cpp').find_library('OpenSLES', has_headers: 'SLES/OpenSLES.h', required: get_option('opensl'))
conf.set10('HAVE_OPENSL', depopensl.found()) conf.set10('HAVE_OPENSL', depopensl.found())
......
ringringtonesdir = $(datadir)/ring/ringtones jamiringtonesdir = $(datadir)/jami/ringtones
dist_ringringtones_DATA = \ dist_jamiringtones_DATA = \
01_AfroNigeria.opus \ 01_AfroNigeria.opus \
02_AfroNigeria.opus \ 02_AfroNigeria.opus \
03_AcousticGuitar.opus \ 03_AcousticGuitar.opus \
......
...@@ -10,5 +10,5 @@ install_data( ...@@ -10,5 +10,5 @@ install_data(
'09_ElectroCloud.opus', '09_ElectroCloud.opus',
'10_UrbanTrap.opus', '10_UrbanTrap.opus',
'default.opus', 'default.opus',
install_dir: get_option('datadir') / 'ring' / 'ringtones' install_dir: get_option('datadir') / 'jami' / 'ringtones'
) )
...@@ -96,10 +96,10 @@ const char* const Account::LOCAL_MODERATORS_ENABLED_KEY = "localModeratorsEnable ...@@ -96,10 +96,10 @@ const char* const Account::LOCAL_MODERATORS_ENABLED_KEY = "localModeratorsEnable
const char* const Account::ALL_MODERATORS_ENABLED_KEY = "allModeratorsEnabled"; const char* const Account::ALL_MODERATORS_ENABLED_KEY = "allModeratorsEnabled";
#ifdef __ANDROID__ #ifdef __ANDROID__
constexpr const char* const DEFAULT_RINGTONE_PATH const char* const DEFAULT_RINGTONE_PATH = "/data/data/cx.ring/files/ringtones/default.opus";
= "/data/data/cx.ring/files/ringtones/default.opus";
#else #else
constexpr const char* const DEFAULT_RINGTONE_PATH = "/usr/share/ring/ringtones/default.opus"; const char* const DEFAULT_RINGTONE_PATH = (std::string() + PROGSHAREDIR + "/ringtones/default.opus")
.c_str();
#endif #endif
Account::Account(const std::string& accountID) Account::Account(const std::string& accountID)
......
...@@ -25,10 +25,3 @@ libclient_la_SOURCES = \ ...@@ -25,10 +25,3 @@ libclient_la_SOURCES = \
$(PLUGIN_SRC) \ $(PLUGIN_SRC) \
$(PRESENCE_SRC) \ $(PRESENCE_SRC) \
$(VIDEO_SRC) $(VIDEO_SRC)
libclient_la_CXXFLAGS = \
-I./ \
-I../ \
-DPREFIX=\"$(prefix)\" \
-DPROGSHAREDIR=\"${datadir}/ring\" \
$(AM_CXXFLAGS)
...@@ -23,10 +23,3 @@ libplugin_la_SOURCES = \ ...@@ -23,10 +23,3 @@ libplugin_la_SOURCES = \
pluginsutils.cpp \ pluginsutils.cpp \
chatservicesmanager.cpp \ chatservicesmanager.cpp \
callservicesmanager.cpp callservicesmanager.cpp
libplugin_la_CXXFLAGS = \
-I./ \
-I../ \
-DPREFIX=\"$(prefix)\" \
-DPROGSHAREDIR=\"${datadir}/ring\" \
$(AM_CXXFLAGS)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment