Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meson build support #392

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions applets/brightness/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
po_dir = join_paths(meson.source_root(), 'po')

source_files = files(
'gpm-common.c',
'brightness-applet.c'
)

cflags = [
'-DMATELOCALEDIR="@0@"'.format(matelocaledir),
'-DG_LOG_DOMAIN="~/mate-power-manager.log"',
'-DGPM_ICONS_DATA="@0@"'.format(mateicons),
'-DBRIGHTNESS_MENU_UI_DIR="@0@"'.format(mateui),
'-DEGG_VERBOSE="GPM_VERBOSE"',
'-DEGG_LOGGING="GPM_LOGGING"',
'-DEGG_CONSOLE="GPM_CONSOLE"'
]

executable('mate-brightness-applet',
sources: source_files,
dependencies : [
gtk,
glib,
cairo,
notify,
dbus,
dbusglib,
matepanel
],
include_directories : config_inc,
c_args : cflags,
install : true,
install_dir: mateexecdir,
)

# .service files

service_data = configuration_data()
service_data.set('LIBEXECDIR', join_paths(prefix, get_option('libexecdir')))

configure_file(
input : 'org.mate.panel.applet.BrightnessAppletFactory.service.in',
output : 'org.mate.panel.applet.BrightnessAppletFactory.service',
configuration : service_data,
install : true,
install_dir : join_paths(matedatadir, 'dbus-1/services')
)

desktop_data = configuration_data()
desktop_data.set('VERSION', meson.project_version())
desktop_data.set('LIBEXECDIR', join_paths(prefix, get_option('libexecdir')))
desktop_in_file = configure_file(
input : 'org.mate.BrightnessApplet.mate-panel-applet.desktop.in.in',
output : 'org.mate.BrightnessApplet.mate-panel-applet.desktop.in',
configuration : desktop_data
)

i18n.merge_file(
input : desktop_in_file,
output : 'org.mate.BrightnessApplet.mate-panel-applet',
type : 'desktop',
po_dir : po_dir,
install : true,
install_dir : join_paths(matedatadir, 'mate-panel', 'applets')
)

install_data('brightness-applet-menu.xml',
install_dir : join_paths(pkgdatadir, 'ui')
)
68 changes: 68 additions & 0 deletions applets/inhibit/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
po_dir = join_paths(meson.source_root(), 'po')

source_files = files(
'gpm-common.c',
'inhibit-applet.c'
)

cflags = [
'-DMATELOCALEDIR="@0@"'.format(matelocaledir),
'-DG_LOG_DOMAIN="~/mate-power-manager.log"',
'-DGPM_ICONS_DATA="@0@"'.format(mateicons),
'-DINHIBIT_MENU_UI_DIR="@0@"'.format(mateui),
'-DEGG_VERBOSE="GPM_VERBOSE"',
'-DEGG_LOGGING="GPM_LOGGING"',
'-DEGG_CONSOLE="GPM_CONSOLE"'
]

executable('mate-inhibit-applet',
sources: source_files,
dependencies : [
gtk,
glib,
cairo,
notify,
dbus,
dbusglib,
matepanel
],
include_directories : config_inc,
c_args : cflags,
install : true,
install_dir: mateexecdir,
)

# .service files

service_data = configuration_data()
service_data.set('LIBEXECDIR', join_paths(prefix, get_option('libexecdir')))

configure_file(
input : 'org.mate.panel.applet.InhibitAppletFactory.service.in',
output : 'org.mate.panel.applet.InhibitAppletFactory.service',
configuration : service_data,
install : true,
install_dir : join_paths(matedatadir, 'dbus-1/services')
)

desktop_data = configuration_data()
desktop_data.set('VERSION', meson.project_version())
desktop_data.set('LIBEXECDIR', join_paths(prefix, get_option('libexecdir')))
desktop_in_file = configure_file(
input : 'org.mate.InhibitApplet.mate-panel-applet.desktop.in.in',
output : 'org.mate.InhibitApplet.mate-panel-applet.desktop.in',
configuration : desktop_data
)

i18n.merge_file(
input : desktop_in_file,
output : 'org.mate.InhibitApplet.mate-panel-applet',
type : 'desktop',
po_dir : po_dir,
install : true,
install_dir : join_paths(matedatadir, 'mate-panel', 'applets')
)

install_data('inhibit-applet-menu.xml',
install_dir : join_paths(pkgdatadir, 'ui')
)
154 changes: 154 additions & 0 deletions data/icons/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
apps_icons = [
['16x16', 'mate-brightness-applet.png', 'mate-inhibit-applet.png', 'mate-power-manager.png', 'mate-power-statistics.png'],
['22x22', 'mate-brightness-applet.png', 'mate-inhibit-applet.png', 'mate-power-manager.png', 'mate-power-statistics.png'],
['24x24', 'mate-brightness-applet.png', 'mate-inhibit-applet.png', 'mate-power-manager.png', 'mate-power-statistics.png'],
['32x32', 'mate-brightness-applet.png', 'mate-inhibit-applet.png', 'mate-power-manager.png', 'mate-power-statistics.png'],
['48x48', 'mate-brightness-applet.png', 'mate-inhibit-applet.png', 'mate-power-manager.png', 'mate-power-statistics.png'],
['64x64', 'mate-brightness-applet.png', 'mate-inhibit-applet.png', 'mate-power-manager.png', 'mate-power-statistics.png'],
['96x96', 'mate-brightness-applet.png', 'mate-inhibit-applet.png', 'mate-power-manager.png', 'mate-power-statistics.png'],
['128x128', 'mate-brightness-applet.png', 'mate-inhibit-applet.png', 'mate-power-manager.png', 'mate-power-statistics.png'],
['256x256', 'mate-brightness-applet.png', 'mate-inhibit-applet.png', 'mate-power-manager.png', 'mate-power-statistics.png'],
]
actions_icons = [
['16x16', 'gpm-hibernate.png', 'gpm-suspend.png'],
['22x22', 'gpm-hibernate.png', 'gpm-suspend.png'],
['24x24', 'gpm-hibernate.png', 'gpm-suspend.png'],
['32x32', 'gpm-hibernate.png', 'gpm-suspend.png'],
['48x48', 'gpm-hibernate.png', 'gpm-suspend.png'],
['64x64', 'gpm-hibernate.png', 'gpm-suspend.png'],
['96x96', 'gpm-hibernate.png', 'gpm-suspend.png'],
['128x128', 'gpm-hibernate.png', 'gpm-suspend.png'],
['256x256', 'gpm-hibernate.png', 'gpm-suspend.png'],
]

icons = [
'gpm-ac-adapter.png',
'gpm-battery-000-charging.png',
'gpm-battery-000.png',
'gpm-battery-020-charging.png',
'gpm-battery-020.png',
'gpm-battery-040-charging.png',
'gpm-battery-040.png',
'gpm-battery-060-charging.png',
'gpm-battery-060.png',
'gpm-battery-080-charging.png',
'gpm-battery-080.png',
'gpm-battery-100-charging.png',
'gpm-battery-100.png',
'gpm-battery-charged.png',
'gpm-battery-empty.png',
'gpm-battery-missing.png',
'gpm-brightness-kbd-disabled.png',
'gpm-brightness-kbd-invalid.png',
'gpm-brightness-kbd.png',
'gpm-brightness-lcd-disabled.png',
'gpm-brightness-lcd-invalid.png',
'gpm-brightness-lcd.png',
'gpm-gaming-input-000.png',
'gpm-gaming-input-020.png',
'gpm-gaming-input-040.png',
'gpm-gaming-input-060.png',
'gpm-gaming-input-080.png',
'gpm-gaming-input-100.png',
'gpm-inhibit-invalid.png',
'gpm-inhibit.png',
'gpm-keyboard-000.png',
'gpm-keyboard-020.png',
'gpm-keyboard-040.png',
'gpm-keyboard-060.png',
'gpm-keyboard-080.png',
'gpm-keyboard-100.png',
'gpm-mouse-000.png',
'gpm-mouse-020.png',
'gpm-mouse-040.png',
'gpm-mouse-060.png',
'gpm-mouse-080.png',
'gpm-mouse-100.png',
'gpm-phone-000.png',
'gpm-phone-020.png',
'gpm-phone-040.png',
'gpm-phone-060.png',
'gpm-phone-080.png',
'gpm-phone-100.png',
'gpm-ups-000-charging.png',
'gpm-ups-000.png',
'gpm-ups-020-charging.png',
'gpm-ups-020.png',
'gpm-ups-040-charging.png',
'gpm-ups-040.png',
'gpm-ups-060-charging.png',
'gpm-ups-060.png',
'gpm-ups-080-charging.png',
'gpm-ups-080.png',
'gpm-ups-100-charging.png',
'gpm-ups-100.png',
'gpm-ups-missing.png',
]

pixels = [
'16x16',
'22x22',
'24x24',
'32x32',
'48x48',
'64x64',
'96x96',
'128x128',
'256x256',
]
pixels2 = [
'48x48',
'64x64',
'96x96',
'128x128',
'256x256',
]
foreach pixel: pixels

foreach icon: icons
install_data(
join_paths (pixel, 'status', icon),
install_dir : join_paths(pkgdatadir, 'icons/hicolor', pixel, 'status'))
endforeach

endforeach

foreach pixel: pixels2
install_data(
join_paths (pixel, 'status', 'gpm-monitor.png'),
install_dir : join_paths(pkgdatadir, 'icons/hicolor', pixel, 'status'))
endforeach

foreach icon: actions_icons
install_data(
join_paths(icon[0], 'actions', icon[1]),
install_dir: join_paths(pkgdatadir, 'icons/hicolor', icon[0], 'actions')
)
install_data(
join_paths(icon[0], 'actions', icon[2]),
install_dir: join_paths(pkgdatadir, 'icons/hicolor', icon[0], 'actions')
)
endforeach

foreach icon: apps_icons
install_data(
join_paths(icon[0], 'apps', icon[1]),
install_dir: join_paths(matedatadir, 'icons/hicolor', icon[0], 'apps')
)
install_data(
join_paths(icon[0], 'apps', icon[2]),
install_dir: join_paths(matedatadir, 'icons/hicolor', icon[0], 'apps')
)
install_data(
join_paths(icon[0], 'apps', icon[3]),
install_dir: join_paths(matedatadir, 'icons/hicolor', icon[0], 'apps')
)
install_data(
join_paths(icon[0], 'apps', icon[4]),
install_dir: join_paths(matedatadir, 'icons/hicolor', icon[0], 'apps')
)
endforeach

install_subdir('scalable/actions', install_dir : join_paths(pkgdatadir, 'icons', 'hicolor', 'scalable'))
install_subdir('scalable/status', install_dir : join_paths(pkgdatadir, 'icons', 'hicolor', 'scalable'))
install_subdir('scalable/apps', install_dir : join_paths(matedatadir, 'icons', 'hicolor', 'scalable'))
92 changes: 92 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
po_dir = join_paths(meson.source_root(), 'po')
man1_dir = join_paths(matemandir, 'man1')
subdir('icons')

schema_data = configuration_data()
schema_data.set('GETTEXT_PACKAGE', meson.project_name())
configure_file(
input : 'org.mate.power-manager.gschema.xml.in',
output : 'org.mate.power-manager.gschema.xml',
configuration : schema_data,
install : true,
install_dir : join_paths(matedatadir, 'glib-2.0', 'schemas')
)

# .service files

service_data = configuration_data()
service_data.set('servicedir', matebindir)

configure_file(
input : 'org.mate.PowerManager.service.in',
output : 'org.mate.PowerManager.service',
configuration : service_data,
install : true,
install_dir : join_paths(matedatadir, 'dbus-1/services')
)

# .desktop file

desktop_data = configuration_data()
desktop_data.set('VERSION', meson.project_version())
desktop_in_file = configure_file(
input : 'mate-power-statistics.desktop.in.in',
output : 'mate-power-statistics.desktop.in',
configuration : desktop_data
)

i18n.merge_file(
input : desktop_in_file,
output : 'mate-power-statistics.desktop',
type : 'desktop',
po_dir : po_dir,
install : true,
install_dir : join_paths(matedatadir, 'applications')
)

desktop_in_file = configure_file(
input : 'mate-power-preferences.desktop.in.in',
output : 'mate-power-preferences.desktop.in',
configuration : desktop_data
)

i18n.merge_file(
input : desktop_in_file,
output : 'mate-power-preferences.desktop',
type : 'desktop',
po_dir : po_dir,
install : true,
install_dir : join_paths(matedatadir, 'applications')
)

desktop_in_file = configure_file(
input : 'mate-power-manager.desktop.in.in',
output : 'mate-power-manager.desktop.in',
configuration : desktop_data
)

i18n.merge_file(
input : desktop_in_file,
output : 'mate-power-manager.desktop',
type : 'desktop',
po_dir : po_dir,
install : true,
install_dir: join_paths(get_option('sysconfdir'), 'xdg', 'autostart')
)

install_data('mate-power-statistics.1',
install_dir : man1_dir
)
install_data('mate-power-preferences.1',
install_dir : man1_dir
)
install_data('mate-power-manager.1',
install_dir : man1_dir
)
install_data('mate-power-backlight-helper.1',
install_dir : man1_dir
)

install_data('acme.ui',
install_dir : pkgdatadir
)
Loading