aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-02-17 16:50:06 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2022-02-17 16:50:06 +0100
commit73120891d71ede15dadd46b2b8f45e7dd0a950f4 (patch)
tree4cce0caed95847fad2b3f1a44020d4e883e9ca87
parent111165eede28d96c9687c93999d528d39a5a2954 (diff)
parent672e4c4189d069efdba160b2d7e8eadc3f00e801 (diff)
downloadayatana-indicator-sound-73120891d71ede15dadd46b2b8f45e7dd0a950f4.tar.gz
ayatana-indicator-sound-73120891d71ede15dadd46b2b8f45e7dd0a950f4.tar.bz2
ayatana-indicator-sound-73120891d71ede15dadd46b2b8f45e7dd0a950f4.zip
Merge branch 'tari01-pr/add-lomiri-features-flag'
Attributes GH PR #74: https://github.com/AyatanaIndicators/ayatana-indicator-sound/pull/74
-rw-r--r--.build.yml4
-rw-r--r--CMakeLists.txt21
-rw-r--r--src/CMakeLists.txt8
-rw-r--r--src/accounts-service-access.vala2
-rw-r--r--src/accounts-service-user.vala12
-rw-r--r--src/options-gsettings.vala6
-rw-r--r--tests/CMakeLists.txt6
-rw-r--r--tests/dbus-types/CMakeLists.txt6
-rw-r--r--tests/integration/CMakeLists.txt2
-rw-r--r--tests/integration/indicator-sound-test-base.cpp2
-rw-r--r--tests/service-mocks/CMakeLists.txt2
11 files changed, 41 insertions, 30 deletions
diff --git a/.build.yml b/.build.yml
index 7ff6059..aa6e250 100644
--- a/.build.yml
+++ b/.build.yml
@@ -272,7 +272,9 @@ build_scripts:
- fi
-
- if [ -e ./CMakeLists.txt ]; then
- - if [ ${DISTRO_NAME} == "debian" ] || [ ${DISTRO_NAME} == "ubuntu" ]; then
+ - if [ ${DISTRO_NAME} == "debian" ]; then
+ - scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTS=ON -DENABLE_LOMIRI_FEATURES=ON
+ - elif [ ${DISTRO_NAME} == "ubuntu" ]; then
- scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTS=ON
- else
- scan-build $CHECKERS cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 82eabd5..a4618aa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ include(UseVala)
option(ENABLE_TESTS "Enable all tests and checks" OFF)
option(ENABLE_COVERAGE "Enable coverage reports (includes enabling all tests and checks)" OFF)
option(ENABLE_WERROR "Treat all build warnings as errors" OFF)
+option(ENABLE_LOMIRI_FEATURES "Build with Lomiri-specific libraries, schemas and media" OFF)
if(ENABLE_COVERAGE)
set(ENABLE_TESTS ON)
@@ -49,8 +50,8 @@ pkg_check_modules(
)
include_directories(${PULSEAUDIO_INCLUDE_DIRS})
-pkg_check_modules(
- SOUNDSERVICE REQUIRED
+set(
+ SOUNDSERVICE
gee-0.8
gio-2.0>=${GIO_2_0_REQUIRED_VERSION}
gio-unix-2.0
@@ -60,15 +61,22 @@ pkg_check_modules(
accountsservice
libayatana-common
)
-include_directories(${SOUNDSERVICE_INCLUDE_DIRS})
-pkg_check_modules(LOMIRI_API liblomiri-api>=0.1.1)
-pkg_check_modules(LOMIRI_SCHEMAS lomiri-schemas)
+if (ENABLE_LOMIRI_FEATURES)
+ list (
+ APPEND
+ SOUNDSERVICE
+ liblomiri-api>=0.1.1
+ lomiri-schemas
+ )
+endif ()
+
+pkg_check_modules (SOUNDSERVICE REQUIRED ${SOUNDSERVICE})
+include_directories(${SOUNDSERVICE_INCLUDE_DIRS})
include_directories(${TEST_INCLUDE_DIRS})
find_package(Vala 0.20)
-
find_package(GObjectIntrospection 0.9.12)
include_directories(${SOURCE_DIR})
@@ -109,3 +117,4 @@ endif ()
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Unit tests: ${ENABLE_TESTS}")
message(STATUS "Build with -Werror: ${ENABLE_WERROR}")
+message(STATUS "Build with Lomiri features: ${ENABLE_LOMIRI_FEATURES}")
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6e24fb2..6cd24f9 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -6,8 +6,8 @@ set(HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.h")
set(SYMBOLS_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.def")
set(VAPI_PATH "${CMAKE_CURRENT_BINARY_DIR}/indicator-sound-service.vapi")
-if(LOMIRI_SCHEMAS_FOUND)
- set (VALA_DEFINE_HAS_LOMIRI_SCHEMAS "--define=HAS_LOMIRI_SCHEMAS")
+if(ENABLE_LOMIRI_FEATURES)
+ set (VALA_DEFINE_LOMIRI_FEATURES_ENABLED "--define=LOMIRI_FEATURES_ENABLED")
set (VALA_FILE_ACCTSERVICE_PRIVACY_SETTINGS "accounts-service-privacy-settings")
set (VALA_FILE_ACCTSERVICE_SYSTEMSOUND_SETTINGS "accounts-service-system-sound-settings")
endif()
@@ -41,7 +41,7 @@ vala_init(ayatana-indicator-sound-service
--vapidir=${CMAKE_SOURCE_DIR}/vapi/
--vapidir=.
--pkg=bus-watcher
- ${VALA_DEFINE_HAS_LOMIRI_SCHEMAS}
+ ${VALA_DEFINE_LOMIRI_FEATURES_ENABLED}
)
vala_add(ayatana-indicator-sound-service
@@ -196,7 +196,7 @@ vala_add(ayatana-indicator-sound-service
accounts-service-sound-settings.vala
)
-if(LOMIRI_SCHEMAS_FOUND)
+if(ENABLE_LOMIRI_FEATURES)
vala_add(ayatana-indicator-sound-service
accounts-service-privacy-settings.vala
)
diff --git a/src/accounts-service-access.vala b/src/accounts-service-access.vala
index 373e294..c6b53d7 100644
--- a/src/accounts-service-access.vala
+++ b/src/accounts-service-access.vala
@@ -143,7 +143,7 @@ public class AccountsServiceAccess : Object
string user_path;
if (user_path_variant.check_format_string ("(o)", true)) {
user_path_variant.get ("(o)", out user_path);
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
_user_proxy = yield new DBusProxy.for_bus (BusType.SYSTEM, DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, "org.freedesktop.Accounts", user_path, "com.lomiri.AccountsService.Sound");
#endif
} else {
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala
index 9580c25..106204a 100644
--- a/src/accounts-service-user.vala
+++ b/src/accounts-service-user.vala
@@ -23,7 +23,7 @@ public class AccountsServiceUser : Object {
Act.UserManager accounts_manager = Act.UserManager.get_default();
Act.User? user = null;
AccountsServiceSoundSettings? proxy = null;
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
AccountsServicePrivacySettings? privacyproxy = null;
AccountsServiceSystemSoundSettings? syssoundproxy = null;
#endif
@@ -40,7 +40,7 @@ public class AccountsServiceUser : Object {
}
set {
_silentMode = value;
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
if (syssoundproxy != null)
syssoundproxy.silent_mode = value;
#endif
@@ -147,7 +147,7 @@ public class AccountsServiceUser : Object {
DBusProxyFlags.GET_INVALIDATED_PROPERTIES,
null,
new_sound_proxy);
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
Bus.get_proxy.begin<AccountsServicePrivacySettings> (
BusType.SYSTEM,
"org.freedesktop.Accounts",
@@ -157,7 +157,7 @@ public class AccountsServiceUser : Object {
new_privacy_proxy);
#endif
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
Bus.get_proxy.begin<AccountsServiceSystemSoundSettings> (
BusType.SYSTEM,
"org.freedesktop.Accounts",
@@ -189,7 +189,7 @@ public class AccountsServiceUser : Object {
}
}
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
void new_privacy_proxy (GLib.Object? obj, AsyncResult res) {
try {
this.privacyproxy = Bus.get_proxy.end (res);
@@ -214,7 +214,7 @@ public class AccountsServiceUser : Object {
}
#endif
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
void new_system_sound_proxy (GLib.Object? obj, AsyncResult res) {
try {
this.syssoundproxy = Bus.get_proxy.end (res);
diff --git a/src/options-gsettings.vala b/src/options-gsettings.vala
index 48df2fe..6230158 100644
--- a/src/options-gsettings.vala
+++ b/src/options-gsettings.vala
@@ -33,7 +33,7 @@ public class IndicatorSound.OptionsGSettings : Options
}
private Settings _settings = new Settings ("org.ayatana.indicator.sound");
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
private Settings _shared_settings = new Settings ("com.lomiri.sound");
#endif
/** MAX VOLUME PROPERTY **/
@@ -45,7 +45,7 @@ public class IndicatorSound.OptionsGSettings : Options
private void init_max_volume() {
_settings.changed[NORMAL_dB_KEY].connect(() => update_max_volume());
_settings.changed[AMP_dB_KEY].connect(() => update_max_volume());
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
_shared_settings.changed[ALLOW_AMP_KEY].connect(() => update_max_volume());
#endif
update_max_volume();
@@ -60,7 +60,7 @@ public class IndicatorSound.OptionsGSettings : Options
}
}
private double calculate_max_volume () {
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
unowned string decibel_key = _shared_settings.get_boolean(ALLOW_AMP_KEY)
? AMP_dB_KEY
: NORMAL_dB_KEY;
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 3e03a20..9a72e0e 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -34,8 +34,8 @@ add_custom_target (
set (XDG_DATA_DIRS "${CMAKE_CURRENT_BINARY_DIR}/gsettings-schemas")
set (SCHEMA_DIR "${XDG_DATA_DIRS}/glib-2.0/schemas")
-if(LOMIRI_SCHEMAS_FOUND)
- add_definitions ( -DHAS_LOMIRI_SCHEMAS )
+if(ENABLE_LOMIRI_FEATURES)
+ add_definitions ( -DLOMIRI_FEATURES_ENABLED )
endif()
add_definitions(-DSCHEMA_DIR="${SCHEMA_DIR}")
@@ -324,7 +324,7 @@ add_test(indicator-test
indicator-test
)
-if (LOMIRI_API_FOUND AND LOMIRI_SCHEMAS_FOUND)
+if (ENABLE_LOMIRI_FEATURES)
add_subdirectory(integration)
endif()
add_subdirectory(dbus-types)
diff --git a/tests/dbus-types/CMakeLists.txt b/tests/dbus-types/CMakeLists.txt
index c872635..9c2e679 100644
--- a/tests/dbus-types/CMakeLists.txt
+++ b/tests/dbus-types/CMakeLists.txt
@@ -14,7 +14,7 @@ set(dbusinterface_accounts_xml "org.freedesktop.Accounts.xml")
set_source_files_properties(${dbusinterface_accounts_xml} PROPERTIES
CLASSNAME AccountsInterface)
-if(LOMIRI_SCHEMAS_FOUND)
+if(ENABLE_LOMIRI_FEATURES)
set_source_files_properties("com.lomiri.AccountsService.Sound.xml" PROPERTIES
CLASSNAME AccountsSoundInterface)
endif()
@@ -38,8 +38,8 @@ qt5_add_dbus_interface(interface_files ${dbusinterface_streamrestore_xml} stream
qt5_add_dbus_interface(interface_files ${dbusinterface_properties_xml} dbus_properties_interface)
qt5_add_dbus_interface(interface_files ${dbusinterface_accounts_xml} dbus_accounts_interface)
-if(LOMIRI_SCHEMAS_FOUND)
- qt5_add_dbus_interface("com.lomiri.AccountsService.Sound.xml" dbus_accountssound_interface)
+if(ENABLE_LOMIRI_FEATURES)
+ qt5_add_dbus_interface(interface_files "com.lomiri.AccountsService.Sound.xml" dbus_accountssound_interface)
endif()
qt5_add_dbus_interface(interface_files ${dbusinterface_actions_xml} dbus_menus_interface)
diff --git a/tests/integration/CMakeLists.txt b/tests/integration/CMakeLists.txt
index 97c18b1..3493e18 100644
--- a/tests/integration/CMakeLists.txt
+++ b/tests/integration/CMakeLists.txt
@@ -1,7 +1,7 @@
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
-if(LOMIRI_API_FOUND)
+if(ENABLE_LOMIRI_FEATURES)
pkg_check_modules(GMENUHARNESS REQUIRED libgmenuharness REQUIRED)
include_directories(${GMENUHARNESS_INCLUDE_DIRS})
endif()
diff --git a/tests/integration/indicator-sound-test-base.cpp b/tests/integration/indicator-sound-test-base.cpp
index 6c64815..3ecd856 100644
--- a/tests/integration/indicator-sound-test-base.cpp
+++ b/tests/integration/indicator-sound-test-base.cpp
@@ -179,7 +179,7 @@ bool IndicatorSoundTestBase::clearGSettingsPlayers()
bool IndicatorSoundTestBase::resetAllowAmplifiedVolume()
{
-#if HAS_LOMIRI_SCHEMAS
+#if LOMIRI_FEATURES_ENABLED
QProcess proc;
proc.start("gsettings", QStringList()
diff --git a/tests/service-mocks/CMakeLists.txt b/tests/service-mocks/CMakeLists.txt
index 87221da..007ab23 100644
--- a/tests/service-mocks/CMakeLists.txt
+++ b/tests/service-mocks/CMakeLists.txt
@@ -1,4 +1,4 @@
-if(LOMIRI_SCHEMAS_FOUND)
+if(ENABLE_LOMIRI_FEATURES)
add_subdirectory(accounts-mock)
endif()
add_subdirectory(media-player-mpris-mock)