8 ayatana-indicator-messages,
22 lomiri-history-service,
23 lomiri-url-dispatcher,
35 telepathy-mission-control,
42 "--replace-fail \"\\\${DBUS_SERVICES_DIR}/${name}\" \"${pkg}/share/dbus-1/services/${name}\"";
44 stdenv.mkDerivation (finalAttrs: {
45 pname = "telephony-service";
48 src = fetchFromGitLab {
50 repo = "development/core/telephony-service";
51 rev = finalAttrs.version;
52 hash = "sha256-eLGwAJmBDDvSODQUNr/zcPA/0DdXtVBiS7vg+iIYPDo=";
56 # Remove when https://gitlab.com/ubports/development/core/telephony-service/-/merge_requests/90 merged & in release
58 name = "0001-lomiri-telephony-service-CMakeLists-Make-tests-optional.patch";
59 url = "https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/commit/9a8297bcf9b34d77ffdae3dfe4ad2636022976fb.patch";
60 hash = "sha256-Za4ZGKnw9iz2RP1LzLhKrEJ1vLUufWk8J07LmWDW40E=";
63 # Remove when version > 0.5.3
65 name = "0002-lomiri-telephony-service-Fix-gettext-funcs-in-wrong-namespace.patch";
66 url = "https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/commit/18e0ba8e025b097eef1217d97d98ef4a4940fe84.patch";
67 hash = "sha256-vOIy+B/OQeccsVn4pXsnr8LYyEapqbebW1I6dBg5u2c=";
70 # Remove when version > 0.5.3
72 name = "0003-lomiri-telephony-service-Handle-renamed-history-service.patch";
73 url = "https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/commit/3a387670ed13041db069068292b1f41229e79583.patch";
74 hash = "sha256-b7gxzr6Mmtogclq3hR7a/zl+816H2wmJqv3oHjUJggw=";
80 # Queries qmake for the QML installation path, which returns a reference to Qt5's build directory
81 # Patch out failure if QMake is not found, since we don't use it
82 substituteInPlace CMakeLists.txt \
83 --replace-fail "\''${QMAKE_EXECUTABLE} -query QT_INSTALL_QML" "echo $out/${qtbase.qtQmlPrefix}" \
84 --replace-fail 'QMAKE_EXECUTABLE STREQUAL "QMAKE_EXECUTABLE-NOTFOUND"' 'FALSE'
87 + lib.optionalString finalAttrs.finalPackage.doCheck ''
88 substituteInPlace tests/common/dbus-services/CMakeLists.txt \
89 ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.MissionControl5.service"} \
90 ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.AccountManager.service"} \
91 ${replaceDbusService dconf "ca.desrt.dconf.service"}
93 substituteInPlace cmake/modules/GenerateTest.cmake \
94 --replace-fail '/usr/lib/dconf' '${lib.getLib dconf}/libexec' \
95 --replace-fail '/usr/lib/telepathy' '${lib.getLib telepathy-mission-control}/libexec'
100 nativeBuildInputs = [
107 ayatana-indicator-messages
118 lomiri-history-service
119 lomiri-url-dispatcher
121 (python3.withPackages (
134 telepathy-mission-control
137 nativeCheckInputs = [
141 telepathy-mission-control
145 dontWrapQtApps = true;
148 # These rely on libphonenumber reformatting inputs to certain results
149 # Seem to be broken for a small amount of numbers, maybe libphonenumber version change?
150 (lib.cmakeBool "SKIP_QML_TESTS" true)
151 (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (
152 lib.concatStringsSep ";" [
155 (lib.strings.escapeShellArg "(${
156 lib.concatStringsSep "|" [
157 # Flaky, randomly failing to launch properly & stuck until test timeout
158 # https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/issues/70
160 "^OfonoAccountEntryTest"
161 "^TelepathyHelperSetupTest"
165 "^AccountEntryFactoryTest"
166 "^PresenceRequestTest"
174 env.NIX_CFLAGS_COMPILE = toString ([
175 "-I${lib.getDev telepathy-glib}/include/telepathy-1.0" # it's in telepathy-farstream's Requires.private, so it & its dependencies don't get pulled in
176 "-I${lib.getDev dbus-glib}/include/dbus-1.0" # telepathy-glib dependency
177 "-I${lib.getDev dbus}/include/dbus-1.0" # telepathy-glib dependency
180 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
182 # Starts & talks to D-Bus services, breaks with parallelism
183 enableParallelChecking = false;
186 export QT_QPA_PLATFORM=minimal
187 export QT_PLUGIN_PATH=${
188 lib.makeSearchPathOutput "bin" qtbase.qtPluginPrefix [
196 patchShebangs $out/bin/{ofono-setup,phone-gsettings-migration.py}
198 # Still missing getprop from libhybris, we don't have it packaged (yet?)
199 wrapProgram $out/bin/ofono-setup \
206 telepathy-mission-control
210 # These SystemD services are referenced by the installed D-Bus services, but not part of the installation. Why?
211 for service in telephony-service-{approver,indicator}; do
212 install -Dm644 ../debian/telephony-service."$service".user.service $out/lib/systemd/user/"$service".service
214 # ofono-setup.service would be provided by ubuntu-touch-session, we don't plan to package it
215 # Doesn't make sense to provide on non-Lomiri
216 substituteInPlace $out/lib/systemd/user/"$service".service \
217 --replace-fail '/usr' "$out" \
218 --replace-warn 'Requires=ofono-setup.service' "" \
219 --replace-warn 'After=ofono-setup.service' "" \
220 --replace-warn 'WantedBy=ayatana-indicators.target' 'WantedBy=lomiri-indicators.target'
223 # Parses the call & SMS indicator desktop files & tries to find its own executable in PATH
224 wrapProgram $out/bin/telephony-service-indicator \
225 --prefix PATH : "$out/bin"
229 ayatana-indicators = {
230 telephony-service-indicator = [ "lomiri" ];
232 tests.vm = nixosTests.ayatana-indicators;
233 updateScript = gitUpdater { };
237 description = "Backend dispatcher service for various mobile phone related operations";
238 homepage = "https://gitlab.com/ubports/development/core/telephony-service";
239 changelog = "https://gitlab.com/ubports/development/core/telephony-service/-/blob/${finalAttrs.version}/ChangeLog";
240 license = lib.licenses.gpl3Only;
241 maintainers = lib.teams.lomiri.members;
242 platforms = lib.platforms.linux;