Skip to content

Commit

Permalink
build: Add meson support
Browse files Browse the repository at this point in the history
  • Loading branch information
bobby285271 committed May 15, 2024
1 parent 5bd9be1 commit 9d1e102
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 0 deletions.
53 changes: 53 additions & 0 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
icon_files = [
'a11y.svg',
'active.png',
'arrow_left.png',
'arrow_right.png',
'battery.svg',
'battery_10.svg',
'battery_25.svg',
'battery_50.svg',
'dialog_close.png',
'dialog_close_highlight.png',
'dialog_close_press.png',
'hibernate_highlight.png',
'hibernate.png',
'keyboard.svg',
'message.png',
'remote_login_help.png',
'restart_highlight.png',
'restart.png',
'shadow.png',
'shutdown_highlight.png',
'shutdown.png',
'shutdown.svg',
'suspend_highlight.png',
'suspend.png',
'switcher_corner.png',
'switcher_left.png',
'switcher_top.png',
]

install_data(
icon_files,
install_dir: pkgdatadir,
)

install_data(
'x.dm.slick-greeter.gschema.xml',
install_dir: datadir / 'glib-2.0' / 'schemas',
)

install_data(
'slick-greeter.desktop',
install_dir: datadir / 'xgreeters',
)

man_files = [
'slick-greeter-set-keyboard-layout.1',
'slick-greeter-check-hidpi.1',
'slick-greeter-enable-tap-to-click.1',
'slick-greeter.8',
]

install_man(man_files)
10 changes: 10 additions & 0 deletions files/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
install_subdir(
'usr' / 'bin',
install_dir: bindir,
strip_directory: true,
)

install_subdir(
'usr' / 'share',
install_dir: prefix,
)
51 changes: 51 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
project(
'slick-greeter',
'vala', 'c',
version: '2.0.3',
meson_version: '>= 0.57.0'
)

cc = meson.get_compiler('c')

gnome = import('gnome')
i18n = import('i18n')

gettext_package = meson.project_name()

prefix = get_option('prefix')
bindir = get_option('bindir')
datadir = get_option('datadir')
localedir = get_option('localedir')
pkgdatadir = datadir / meson.project_name()

cairo_dep = dependency('cairo')
gdk_x11_dep = dependency('gdk-x11-3.0')
gio_dep = dependency('gio-2.0')
gio_unix_dep = dependency('gio-unix-2.0')
gtk_dep = dependency('gtk+-3.0', version: '>= 3.20.0')
libcanberra_dep = dependency('libcanberra')
liblightdm_gobject_dep = dependency('liblightdm-gobject-1', version: '>= 1.12.0')
m_dep = cc.find_library('m')
pixman_dep = dependency('pixman-1')
posix_dep = meson.get_compiler('vala').find_library('posix')
x11_dep = dependency('x11')
xapp_dep = dependency('xapp')
xext_dep = cc.find_library('Xext')

config_data = configuration_data()
config_data.set_quoted('GETTEXT_PACKAGE', gettext_package)
config_data.set_quoted('LOCALEDIR', prefix / localedir)
config_data.set_quoted('PKGDATADIR', prefix / pkgdatadir)
config_data.set_quoted('VERSION', meson.project_version())
configure_file(
configuration: config_data,
output: 'config.h',
)
config_h_dir = include_directories('.')

subdir('data')
subdir('files')
subdir('po')
subdir('src')

gnome.post_install(glib_compile_schemas: true)
4 changes: 4 additions & 0 deletions po/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
i18n.gettext(
gettext_package,
preset: 'glib'
)
82 changes: 82 additions & 0 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
slick_greeter_sources = files(
'config.vapi',
'fixes.vapi',
'xsync.vapi',
'animate-timer.vala',
'background.vala',
'cached-image.vala',
'cairo-utils.vala',
'email-autocompleter.vala',
'dash-box.vala',
'dash-button.vala',
'dash-entry.vala',
'fadable.vala',
'fadable-box.vala',
'fading-label.vala',
'flat-button.vala',
'greeter-list.vala',
'idle-monitor.vala',
'list-stack.vala',
'main-window.vala',
'menu.vala',
'menubar.vala',
'prompt-box.vala',
'session-list.vala',
'remote-login-service.vala',
'settings.vala',
'shutdown-dialog.vala',
'toggle-box.vala',
'slick-greeter.vala',
'user-list.vala',
'user-prompt-box.vala',
)

logo_generator_sources = files(
'logo-generator.vala',
)

dependencies = [
cairo_dep,
gdk_x11_dep,
gio_dep,
gio_unix_dep,
gtk_dep,
libcanberra_dep,
liblightdm_gobject_dep,
m_dep,
pixman_dep,
posix_dep,
x11_dep,
xapp_dep,
xext_dep,
]

c_args = [
'-w',
'-include', 'config.h',
]

vala_args = [
'--debug',
'--target-glib', '2.32',
'-D', 'HAVE_GTK_3_20_0',
]

executable(
'slick-greeter',
slick_greeter_sources,
dependencies: dependencies,
include_directories: config_h_dir,
c_args: c_args,
vala_args: vala_args,
install: true,
)

executable(
'logo-generator',
logo_generator_sources,
dependencies: dependencies,
include_directories: config_h_dir,
c_args: c_args,
vala_args: vala_args,
)

0 comments on commit 9d1e102

Please sign in to comment.