summaryrefslogtreecommitdiffstats
path: root/data/meson.build
blob: f6d264f891fbc6d1e726271e6c7dde7ed56b412c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
desktop_plain = 'gnome'

desktops = [
  desktop_plain,
  'gnome-xorg',
  'gnome-wayland',
]

shell_component = {
  desktop_plain: 'org.gnome.Shell',
}

required_components = {
  desktop_plain: [
    'org.gnome.SettingsDaemon.A11ySettings',
    'org.gnome.SettingsDaemon.Color',
    'org.gnome.SettingsDaemon.Datetime',
    'org.gnome.SettingsDaemon.Housekeeping',
    'org.gnome.SettingsDaemon.Keyboard',
    'org.gnome.SettingsDaemon.MediaKeys',
    'org.gnome.SettingsDaemon.Power',
    'org.gnome.SettingsDaemon.PrintNotifications',
    'org.gnome.SettingsDaemon.Rfkill',
    'org.gnome.SettingsDaemon.ScreensaverProxy',
    'org.gnome.SettingsDaemon.Sharing',
    'org.gnome.SettingsDaemon.Smartcard',
    'org.gnome.SettingsDaemon.Sound',
    'org.gnome.SettingsDaemon.UsbProtection',
    'org.gnome.SettingsDaemon.Wacom',
    'org.gnome.SettingsDaemon.XSettings',
  ],
}

if enable_session_selector
  desktops += 'gnome-custom-session'
endif

foreach name: desktops
  desktop_conf = configuration_data()
  desktop_conf.set('bindir', session_bindir)

  desktop = name + '.desktop'

  desktop_in = configure_file(
    input: desktop + '.in.in',
    output: desktop + '.in',
    configuration: desktop_conf
  )

  if name.endswith('-xorg')
    install_dir = session_datadir / 'xsessions'
  elif name.endswith('-wayland')
    install_dir = session_datadir / 'wayland-sessions'
  else
    # FIXME: The same target can not be copied into two directories.
    #        There is a workaround in meson_post_install.py until proper
    #        solution arises:
    #        https://github.com/mesonbuild/meson/issues/2416
    install_dir = session_datadir / 'xsessions'
    #install_dir = [
    #  join_paths(session_datadir, 'xsessions'),
    #  join_paths(session_datadir, 'wayland-sessions')
    #]
  endif

  desktop_target = i18n.merge_file(
    type: 'desktop',
    input: desktop_in,
    output: desktop,
    po_dir: po_dir,
    install: true,
    install_dir: install_dir
  )
endforeach

sessions = [
  'gnome',
  'gnome-dummy'
]

foreach session: sessions
  session_file = session + '.session'
  desktop_conf = configuration_data()
  desktop_conf.set('libexecdir', session_libexecdir)
  desktop_conf.set('required_components', ';'.join(
    [shell_component.get(session, '')] + required_components.get(session, [])))

  desktop = session_file + '.desktop'

  desktop_in = configure_file(
    input: desktop + '.in.in',
    output: desktop + '.in',
    configuration: desktop_conf
  )

  i18n.merge_file(
    type: 'desktop',
    input: desktop_in,
    output: session_file,
    po_dir: po_dir,
    install: true,
    install_dir: join_paths(session_pkgdatadir, 'sessions')
  )
endforeach

schema_conf = configuration_data()

schema = 'org.gnome.SessionManager.gschema.xml'

configure_file(
  input: schema + '.in',
  output: schema,
  install: true,
  install_dir: join_paths(session_datadir, 'glib-2.0', 'schemas'),
  configuration: schema_conf
)

install_data(
  'gnome-session.convert',
  install_dir: join_paths(session_datadir, 'GConf', 'gsettings')
)

if enable_systemd_session
  unit_conf = configuration_data()
  unit_conf.set('libexecdir', session_libexecdir)

  systemd_service = ['gnome-session-manager@.service',
                     'gnome-session-signal-init.service',
                     'gnome-session-restart-dbus.service',
                     'gnome-session-monitor.service',
                     'gnome-session-failed.service']

  foreach service: systemd_service
    configure_file(
      input: service + '.in',
      output: service,
      install: true,
      install_dir: systemd_userunitdir,
      configuration: unit_conf
    )
  endforeach

  systemd_target = files('gnome-session-wayland@.target',
                         'gnome-session-wayland.target',
                         'gnome-session-x11@.target',
                         'gnome-session-x11.target',
                         'gnome-session-x11-services.target',
                         'gnome-session-x11-services-ready.target',
                         'gnome-session@.target',
                         'gnome-session.target',
                         'gnome-session-pre.target',
                         'gnome-session-manager.target',
                         'gnome-session-initialized.target',
                         'gnome-session-shutdown.target',
                         'gnome-session-failed.target',
                         )

  install_data(
    systemd_target,
    install_dir: systemd_userunitdir
  )

  install_data(
    'gnome-launched-override.scope.conf',
    rename: 'override.conf',
    install_dir : join_paths(systemd_userunitdir, 'gnome-launched-.scope.d')
  )

  foreach session, req_components: required_components
    wanted_targets = []
    foreach component: req_components
      wanted_targets += 'Wants=@0@.target'.format(component)
    endforeach

    configure_file(
      input: session + '.session.conf.in',
      output: session + '.session.conf',
      configuration: {
        'requires_component': shell_component[session],
        'wants_required_components': '\n'.join(wanted_targets),
      },
      install_dir: systemd_userunitdir / 'gnome-session@@0@.target.d'.format(
        session),
    )
  endforeach
endif

data = files('hardware-compatibility')

if enable_session_selector
  data += files('session-selector.ui')
endif

install_data(
  data,
  install_dir: session_pkgdatadir
)