1{
2 stdenvNoCC,
3 lib,
4 fetchFromGitLab,
5 gitUpdater,
6 nixosTests,
7 bash,
8 cmake,
9 dbus,
10 deviceinfo,
11 inotify-tools,
12 lomiri,
13 makeWrapper,
14 pkg-config,
15 systemd,
16 xdg-user-dirs,
17}:
18
19stdenvNoCC.mkDerivation (finalAttrs: {
20 pname = "lomiri-session";
21 version = "0.3";
22
23 src = fetchFromGitLab {
24 owner = "ubports";
25 repo = "development/core/lomiri-session";
26 rev = finalAttrs.version;
27 hash = "sha256-XduE3tPUjw/wIjFCACasxtN33KO4bDLWrpl7pZcYaAA=";
28 };
29
30 patches = [ ./1001-Unset-QT_QPA_PLATFORMTHEME.patch ];
31
32 postPatch = ''
33 substituteInPlace lomiri-session.in \
34 --replace-fail '/usr/libexec/Xwayland.lomiri' '${lib.getBin lomiri}/libexec/Xwayland.lomiri'
35
36 substituteInPlace systemd/CMakeLists.txt \
37 --replace-fail 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir)' 'pkg_get_variable(SYSTEMD_USER_DIR systemd systemduserunitdir DEFINE_VARIABLES prefix=''${CMAKE_INSTALL_PREFIX})'
38
39 # Inject a call to xdg-user-dirs-update, so when mediascanner2 launches, it can actually scan for files
40 substituteInPlace desktop/dm-lomiri-session.in \
41 --replace-fail '@CMAKE_INSTALL_FULL_LIBEXECDIR@/lomiri-session/run-systemd-session' '${lib.getExe' xdg-user-dirs "xdg-user-dirs-update"} && @CMAKE_INSTALL_FULL_LIBEXECDIR@/lomiri-session/run-systemd-session'
42 '';
43
44 nativeBuildInputs = [
45 cmake
46 makeWrapper
47 pkg-config
48 ];
49
50 buildInputs = [
51 bash
52 deviceinfo
53 dbus
54 inotify-tools
55 lomiri
56 systemd
57 ];
58
59 cmakeFlags = [
60 # Requires lomiri-system-compositor -> not ported to Mir 2.x yet
61 (lib.cmakeBool "ENABLE_TOUCH_SESSION" false)
62 ];
63
64 postInstall = ''
65 patchShebangs $out/bin/lomiri-session
66 wrapProgram $out/bin/lomiri-session \
67 --prefix PATH : ${
68 lib.makeBinPath [
69 deviceinfo
70 inotify-tools
71 lomiri
72 ]
73 }
74 '';
75
76 passthru = {
77 providedSessions = [
78 "lomiri"
79 # not packaged/working yet
80 # "lomiri-touch"
81 ];
82 tests.lomiri = nixosTests.lomiri;
83 updateScript = gitUpdater { };
84 };
85
86 meta = with lib; {
87 description = "Integrates Lomiri desktop/touch sessions into display / session managers";
88 homepage = "https://gitlab.com/ubports/development/core/lomiri-session";
89 changelog = "https://gitlab.com/ubports/development/core/lomiri-session/-/blob/${finalAttrs.version}/ChangeLog";
90 license = licenses.gpl3Only;
91 mainProgram = "lomiri-session";
92 teams = [ teams.lomiri ];
93 platforms = platforms.linux;
94 };
95})