Skip to content

Commit

Permalink
meson: Allow custom prefixes for third-party packages
Browse files Browse the repository at this point in the history
labwc, magpie, gsd does not always share the same prefix as
budgie-desktop and sometimes they are just installed in some
unusual paths. For example, in NixOS labwc is installed in
/nix/store/xxx-labwc-0.8.2/bin, and in Arch Linux gsd-media-keys
is installed in /usr/lib/. Simply don't hardcode these paths.
  • Loading branch information
bobby285271 committed Jan 25, 2025
1 parent b015e58 commit fad08aa
Show file tree
Hide file tree
Showing 18 changed files with 59 additions and 22 deletions.
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ add_global_arguments('-DGETTEXT_PACKAGE="budgie-desktop"', language: 'c')

# Globals that we need
prefix = get_option('prefix')
bindir = join_paths(prefix, get_option('bindir'))
libdir = join_paths(prefix, get_option('libdir'))
libexecdir = join_paths(prefix, get_option('libexecdir'), meson.project_name())
confdir = join_paths(prefix, get_option('sysconfdir'))
Expand Down
3 changes: 3 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
option('ci', type: 'boolean', value: false, description: 'Continuous Integration flag (internal use only)')
option('gsd-libexecdir', type: 'string', description: 'Directory containing the gsd-* executables')
option('labwc-bindir', type: 'string', description: 'Directory containing the labwc executable')
#option('magpie-bindir', type: 'string', description: 'Directory containing the magpie-wm executable')
option('use-old-zenity', type: 'boolean', value: false, description: 'Use old zenity CLI API for out-of-process dialog handling')
option('with-bluetooth', type: 'boolean', value: true, description: 'Enable Bluetooth (Vala option)')
option('with-gtk-doc', type: 'boolean', value: true, description: 'Build gtk-doc documentation')
Expand Down
4 changes: 2 additions & 2 deletions src/session/budgie-desktop-magpie.desktop.in.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Desktop Entry]
_Name=Budgie Desktop (magpie)
_Comment=This session logs you into the Budgie Desktop using magpie as the window manager
Exec=@prefix@/bin/magpie-wm -s /usr/bin/budgie-desktop
TryExec=@prefix@/bin/magpie-wm
Exec=@magpie_bindir@/magpie-wm -s @bindir@/budgie-desktop
TryExec=@magpie_bindir@/magpie-wm
Icon=
Type=Application
DesktopNames=Budgie
4 changes: 2 additions & 2 deletions src/session/budgie-desktop.desktop.in.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[Desktop Entry]
_Name=Budgie Desktop
_Comment=This session logs you into the Budgie Desktop using labwc as the window manager
Exec=@prefix@/bin/labwc -S /usr/bin/budgie-desktop
TryExec=@prefix@/bin/labwc
Exec=@labwc_bindir@/labwc -S @bindir@/budgie-desktop
TryExec=@labwc_bindir@/labwc
Icon=
Type=Application
DesktopNames=Budgie
43 changes: 38 additions & 5 deletions src/session/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@ session_components = budgie_components + budgie_session_324_components
session_data.set('SESSION_COMPONENTS', ';'.join(session_components))
# Set the prefix
session_data.set('prefix', join_paths(get_option('prefix')))
# Set bindir to budgie-desktop
session_data.set('bindir', bindir)

# Set bindir to labwc
labwc_bindir = get_option('labwc-bindir')
if labwc_bindir == ''
labwc_bindir = bindir
endif
session_data.set('labwc_bindir', labwc_bindir)

# Set bindir to magpie-wm
#magpie_bindir = get_option('magpie-bindir')
#if magpie_bindir == ''
# magpie_bindir = bindir
#endif
#session_data.set('magpie_bindir', magpie_bindir)

# Set libexecdir to gnome-settings-daemon
# Unfortunately this info is not provided by its pkgconfig file
gsd_libexecdir = get_option('gsd-libexecdir')
if gsd_libexecdir == ''
gsd_libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
endif
session_data.set('gsd_libexecdir', gsd_libexecdir)

# Write the budgie-desktop.session.in file from the .in.in
session_conf = configure_file(
Expand Down Expand Up @@ -120,8 +144,17 @@ custom_target('desktop-file-powerdialog',

# install gnome-settings-daemon desktop files to ensure they autostart

install_subdir(
'settingsdaemon',
install_dir: xdg_appdir,
strip_directory: true
)
settings_daemon_components = budgie_session_324_components + [
'org.buddiesofbudgie.SettingsDaemon.DiskUtilityNotify',
'org.buddiesofbudgie.SettingsDaemon.UsbProtection',
'org.buddiesofbudgie.SettingsDaemon.Wwan',
]

foreach component: settings_daemon_components
configure_file(
input: join_paths('settingsdaemon', component + '.desktop.in'),
output: '@BASENAME@',
configuration: session_data,
install_dir: xdg_appdir,
)
endforeach
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie Desktop accessibility
Exec=/usr/libexec/gsd-a11y-settings
Exec=@gsd_libexecdir@/gsd-a11y-settings
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie date & time
Exec=/usr/libexec/gsd-datetime
Exec=@gsd_libexecdir@/gsd-datetime
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=gnome-disk-utility notification plugin for GNOME Settings Daemon (Budgie)
Exec=/usr/libexec/gsd-disk-utility-notify
Exec=@gsd_libexecdir@/gsd-disk-utility-notify
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-AutoRestart=true
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie Desktop maintenance of expirable data
Exec=/usr/libexec/gsd-housekeeping
Exec=@gsd_libexecdir@/gsd-housekeeping
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie power management
Exec=/usr/libexec/gsd-power
Exec=@gsd_libexecdir@/gsd-power
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie Desktop printer notifications
Exec=/usr/libexec/gsd-print-notifications
Exec=@gsd_libexecdir@/gsd-print-notifications
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie Desktop RFKill support
Exec=/usr/libexec/gsd-rfkill
Exec=@gsd_libexecdir@/gsd-rfkill
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie Desktop file sharing
Exec=/usr/libexec/gsd-sharing
Exec=@gsd_libexecdir@/gsd-sharing
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie Desktop smartcard
Exec=/usr/libexec/gsd-smartcard
Exec=@gsd_libexecdir@/gsd-smartcard
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie Desktop sound sample caching
Exec=/usr/libexec/gsd-sound
Exec=@gsd_libexecdir@/gsd-sound
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie Desktop USB protection
Exec=/usr/libexec/gsd-usb-protection
Exec=@gsd_libexecdir@/gsd-usb-protection
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie Desktop Wacom tablet support
Exec=/usr/libexec/gsd-wacom
Exec=@gsd_libexecdir@/gsd-wacom
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
Name=Budgie Desktop WWan support
Exec=/usr/libexec/gsd-wwan
Exec=@gsd_libexecdir@/gsd-wwan
OnlyShowIn=Budgie;
NoDisplay=true
X-GNOME-Autostart-Phase=Initialization
Expand Down

0 comments on commit fad08aa

Please sign in to comment.