Skip to content

Commit b881ad7

Browse files
authored
build: Fix some hardcode path issues (#11244)
* build: don't hardcode exec path for applications/cinnamon2d.desktop Some systems like NixOS does not follow FHS and cinnamon is not installed in /usr/bin, let's respect the bindir option from Meson. * build: don't hardcode exec path for xsession desktop files Some systems like NixOS does not follow FHS and cinnamon is not installed in /usr/bin, let's respect the bindir option from Meson. * build: don't hardcode exec path for dbus service files Some systems like NixOS does not follow FHS and cinnamon is not installed in /usr/bin, let's respect the bindir option from Meson. * treewide: Use shutil.which instead of hardcoding path when possible When checking whether a program is available, let's use shutil.which instead of looking into /usr/bin, sometimes the program is installed elsewhere and it will be nice to actually respect PATH. * data/services: Move all dbus service files into same folder This should not introduce any behavior changes.
1 parent 60fde94 commit b881ad7

18 files changed

+76
-54
lines changed

calendar-server/meson.build

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ launcher = configure_file(
1212
install_mode: 'rwxr-xr-x'
1313
)
1414

15-
service_conf = configuration_data()
16-
service_conf.set('BINDIR', join_paths(prefix, bindir))
17-
18-
launcher = configure_file(
19-
input: 'org.cinnamon.CalendarServer.service.in',
20-
output: 'org.cinnamon.CalendarServer.service',
21-
configuration: service_conf,
22-
install_dir: dbus_services_dir
23-
)
24-
2515
install_data(
2616
'cinnamon-calendar-server.py',
2717
install_dir: libexecdir,

files/usr/share/applications/cinnamon2d.desktop renamed to data/cinnamon2d.desktop.in.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[Desktop Entry]
22
Type=Application
3-
Name=Cinnamon 2D
4-
Comment=Window management and application launching
5-
Exec=/usr/bin/cinnamon2d
3+
_Name=Cinnamon 2D
4+
_Comment=Window management and application launching
5+
Exec=@bindir@/cinnamon2d
66
Categories=GNOME;GTK;System;Core;
77
OnlyShowIn=X-Cinnamon;
88
NoDisplay=true

data/meson.build

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,33 @@ install_subdir(
1313

1414
desktop_conf = configuration_data()
1515
desktop_conf.set('bindir', join_paths(prefix, bindir))
16+
desktop_conf.set('libexecdir', join_paths(prefix, libexecdir))
1617
desktop_conf.set('VERSION', meson.project_version())
1718

18-
desktop = configure_file(
19-
input: 'cinnamon.desktop.in.in',
20-
output: 'cinnamon.desktop.in',
21-
configuration: desktop_conf,
22-
)
19+
desktop_files = [
20+
'cinnamon.desktop',
21+
'cinnamon2d.desktop',
22+
]
2323

24-
custom_target(
25-
'desktop',
26-
input: desktop,
27-
output: 'cinnamon.desktop',
28-
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
29-
install: true,
30-
install_dir: desktopdir,
31-
)
24+
foreach desktop_file : desktop_files
25+
desktop = configure_file(
26+
input: desktop_file + '.in.in',
27+
output: desktop_file + '.in',
28+
configuration: desktop_conf,
29+
)
30+
31+
custom_target(
32+
desktop_file,
33+
input: desktop,
34+
output: desktop_file,
35+
command: [intltool_merge, '-d', '-u', po_dir, '@INPUT@', '@OUTPUT@'],
36+
install: true,
37+
install_dir: desktopdir,
38+
)
39+
endforeach
40+
41+
subdir('xsessions')
42+
subdir('services')
3243

3344
install_data(
3445
'org.cinnamon.gschema.xml',

data/services/meson.build

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
service_files = [
2+
'org.cinnamon.CalendarServer.service',
3+
'org.Cinnamon.HotplugSniffer.service',
4+
'org.Cinnamon.Melange.service',
5+
'org.Cinnamon.Slideshow.service',
6+
]
7+
8+
foreach service_file : service_files
9+
configure_file(
10+
input: service_file + '.in',
11+
output: service_file,
12+
configuration: desktop_conf,
13+
install_dir: servicedir
14+
)
15+
endforeach
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[D-BUS Service]
22
Name=org.Cinnamon.HotplugSniffer
3-
Exec=@pkglibexecdir@/cinnamon-hotplug-sniffer
3+
Exec=@libexecdir@/cinnamon-hotplug-sniffer
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[D-BUS Service]
2+
Name=org.Cinnamon.Melange
3+
Exec=@bindir@/cinnamon-looking-glass daemon
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[D-BUS Service]
22
Name=org.Cinnamon.Slideshow
3-
Exec=/usr/bin/cinnamon-slideshow
3+
Exec=@bindir@/cinnamon-slideshow
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[D-BUS Service]
22
Name=org.cinnamon.CalendarServer
3-
Exec=@BINDIR@/cinnamon-calendar-server
3+
Exec=@bindir@/cinnamon-calendar-server

files/usr/share/xsessions/cinnamon.desktop renamed to data/xsessions/cinnamon.desktop.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Name=Cinnamon
33
Comment=This session logs you into Cinnamon
44
Exec=cinnamon-session-cinnamon
5-
TryExec=/usr/bin/cinnamon
5+
TryExec=@bindir@/cinnamon
66
Icon=
77
Type=Application
88

files/usr/share/xsessions/cinnamon2d.desktop renamed to data/xsessions/cinnamon2d.desktop.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Name=Cinnamon (Software Rendering)
33
Comment=This session logs you into Cinnamon (using software rendering)
44
Exec=cinnamon-session-cinnamon2d
5-
TryExec=/usr/bin/cinnamon2d
5+
TryExec=@bindir@/cinnamon2d
66
Icon=
77
Type=Application
88
X-Ubuntu-Gettext-Domain=cinnamon

0 commit comments

Comments
 (0)