8 ayatana-indicator-messages,
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=";
73 # Queries qmake for the QML installation path, which returns a reference to Qt5's build directory
74 # Patch out failure if QMake is not found, since we don't use it
75 substituteInPlace CMakeLists.txt \
76 --replace-fail "\''${QMAKE_EXECUTABLE} -query QT_INSTALL_QML" "echo $out/${qtbase.qtQmlPrefix}" \
77 --replace-fail 'QMAKE_EXECUTABLE STREQUAL "QMAKE_EXECUTABLE-NOTFOUND"' 'FALSE'
80 + lib.optionalString finalAttrs.finalPackage.doCheck ''
81 substituteInPlace tests/common/dbus-services/CMakeLists.txt \
82 ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.MissionControl5.service"} \
83 ${replaceDbusService telepathy-mission-control "org.freedesktop.Telepathy.AccountManager.service"} \
84 ${replaceDbusService dconf "ca.desrt.dconf.service"}
86 substituteInPlace cmake/modules/GenerateTest.cmake \
87 --replace-fail '/usr/lib/dconf' '${lib.getLib dconf}/libexec' \
88 --replace-fail '/usr/lib/telepathy' '${lib.getLib telepathy-mission-control}/libexec'
100 ayatana-indicator-messages
112 lomiri-url-dispatcher
114 (python3.withPackages (
127 telepathy-mission-control
130 nativeCheckInputs = [
134 telepathy-mission-control
138 dontWrapQtApps = true;
141 # These rely on libphonenumber reformatting inputs to certain results
142 # Seem to be broken for a small amount of numbers, maybe libphonenumber version change?
143 (lib.cmakeBool "SKIP_QML_TESTS" true)
144 (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" (
145 lib.concatStringsSep ";" [
148 (lib.strings.escapeShellArg "(${
149 lib.concatStringsSep "|" [
150 # Flaky, randomly failing to launch properly & stuck until test timeout
151 # https://gitlab.com/ubports/development/core/lomiri-telephony-service/-/issues/70
153 "^OfonoAccountEntryTest"
154 "^TelepathyHelperSetupTest"
158 "^AccountEntryFactoryTest"
159 "^PresenceRequestTest"
167 env.NIX_CFLAGS_COMPILE = toString ([
168 "-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
169 "-I${lib.getDev dbus-glib}/include/dbus-1.0" # telepathy-glib dependency
170 "-I${lib.getDev dbus}/include/dbus-1.0" # telepathy-glib dependency
173 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
175 # Starts & talks to D-Bus services, breaks with parallelism
176 enableParallelChecking = false;
179 export QT_QPA_PLATFORM=minimal
180 export QT_PLUGIN_PATH=${
181 lib.makeSearchPathOutput "bin" qtbase.qtPluginPrefix [
189 patchShebangs $out/bin/{ofono-setup,phone-gsettings-migration.py}
191 # Still missing getprop from libhybris, we don't have it packaged (yet?)
192 wrapProgram $out/bin/ofono-setup \
199 telepathy-mission-control
203 # These SystemD services are referenced by the installed D-Bus services, but not part of the installation. Why?
204 for service in telephony-service-{approver,indicator}; do
205 install -Dm644 ../debian/telephony-service."$service".user.service $out/lib/systemd/user/"$service".service
207 # ofono-setup.service would be provided by ubuntu-touch-session, we don't plan to package it
208 # Doesn't make sense to provide on non-Lomiri
209 substituteInPlace $out/lib/systemd/user/"$service".service \
210 --replace-fail '/usr' "$out" \
211 --replace-warn 'Requires=ofono-setup.service' "" \
212 --replace-warn 'After=ofono-setup.service' "" \
213 --replace-warn 'WantedBy=ayatana-indicators.target' 'WantedBy=lomiri-indicators.target'
216 # Parses the call & SMS indicator desktop files & tries to find its own executable in PATH
217 wrapProgram $out/bin/telephony-service-indicator \
218 --prefix PATH : "$out/bin"
222 ayatana-indicators = {
223 telephony-service-indicator = [ "lomiri" ];
225 tests.vm = nixosTests.ayatana-indicators;
226 updateScript = gitUpdater { };
230 description = "Backend dispatcher service for various mobile phone related operations";
231 homepage = "https://gitlab.com/ubports/development/core/telephony-service";
232 changelog = "https://gitlab.com/ubports/development/core/telephony-service/-/blob/${finalAttrs.version}/ChangeLog";
233 license = lib.licenses.gpl3Only;
234 maintainers = lib.teams.lomiri.members;
235 platforms = lib.platforms.linux;