Skip to content

Commit

Permalink
Update all meson files
Browse files Browse the repository at this point in the history
  • Loading branch information
lainsce committed Jan 24, 2024
1 parent 3181749 commit 7804e6c
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 30 deletions.
24 changes: 13 additions & 11 deletions data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ libexecdir_conf = configuration_data()
libexecdir_conf.set('libexecdir', prefix / libexecdir)

# Portal
tau_portal_interfaces = [
gnome_portal_interfaces = [
'org.freedesktop.impl.portal.Settings',
]
tau_portal_conf = configuration_data()
tau_portal_conf.set('PORTALS', ';'.join(tau_portal_interfaces))
gnome_portal_conf = configuration_data()
gnome_portal_conf.set('PORTALS', ';'.join(gnome_portal_interfaces))

portal_dir = datadir / 'xdg-desktop-portal' / 'portals'
configure_file(
input: 'tau.portal.in',
output: 'tau.portal',
configuration: tau_portal_conf,
configuration: gnome_portal_conf,
install_dir: portal_dir,
)

Expand All @@ -27,12 +27,14 @@ configure_file(
)

# systemd unit
configure_file(
input: 'xdg-desktop-portal-tau.service.in',
output: 'xdg-desktop-portal-tau.service',
configuration: libexecdir_conf,
install_dir: systemduserunitdir,
)
if systemduserunitdir != ''
configure_file(
input: 'xdg-desktop-portal-tau.service.in',
output: 'xdg-desktop-portal-tau.service',
configuration: libexecdir_conf,
install_dir: systemduserunitdir,
)
endif

# Desktop file
desktop_in = configure_file(
Expand All @@ -45,7 +47,7 @@ i18n.merge_file(
type: 'desktop',
input: desktop_in,
output: 'xdg-desktop-portal-tau.desktop',
po_dir: meson.source_root() / 'po',
po_dir: meson.project_source_root() / 'po',
install: true,
install_dir: datadir / 'applications',
)
21 changes: 14 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'xdg-desktop-portal-tau',
'c',
version: '1.1.1',
version: '1.1.14',
license: 'LGPLv2.1+'
)

Expand All @@ -10,13 +10,16 @@ datadir = get_option('datadir')
libdir = get_option('libdir')
libexecdir = get_option('libexecdir')

build_systemd_service = get_option('systemd')
systemduserunitdir = get_option('systemduserunitdir')
if systemduserunitdir == ''
systemd = dependency('systemd')
systemduserunitdir = systemd.get_pkgconfig_variable(
'systemduserunitdir',
define_variable: ['prefix', get_option('prefix')]
)
systemd = dependency('systemd', version: '>= 242', required: build_systemd_service)
if build_systemd_service.allowed() and systemd.found()
systemduserunitdir = systemd.get_variable(
pkgconfig: 'systemduserunitdir',
pkgconfig_define: ['prefix', prefix]
)
endif
endif

dbus_service_dir = get_option('dbus_service_dir')
Expand All @@ -34,5 +37,9 @@ summary({
'libdir': libdir,
'libexecdir': libexecdir,
'dbus_service_dir': dbus_service_dir,
'systemduserunitdir': systemduserunitdir,
})

summary({
'systemd-service': build_systemd_service,
'systemduserunitdir': systemduserunitdir,
}, section: 'systemd session service')
8 changes: 7 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ option('dbus_service_dir',
description: 'Directory for D-Bus service files'
)

option('systemd',
type: 'feature',
value: 'auto',
description: 'Enable systemd support'
)

option('systemduserunitdir',
type: 'string',
description: 'Directory for systemd user service files'
)
)
31 changes: 21 additions & 10 deletions src/meson.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
gnome = import('gnome')
pkg = import('pkgconfig')

xdg_desktop_portal_dep = dependency('xdg-desktop-portal', version: '>= 1.17.0')

top_srcdir = meson.project_source_root()

# Desktop Portal D-Bus interfaces
desktop_portal_dbus_interfaces = [
'org.freedesktop.impl.portal.Settings',
desktop_portal_dbus_interfaces = gnome_portal_interfaces + [
'org.freedesktop.impl.portal.Request',
'org.freedesktop.impl.portal.Session',
]

desktop_portal_interfaces_dir = xdg_desktop_portal_dep.get_variable(
Expand All @@ -24,6 +24,8 @@ built_sources = gnome.gdbus_codegen(
namespace: 'XdpImpl',
)

# Mutter / GNOME Shell D-Bus interfaces
top_srcdir = meson.project_source_root()
shell_dbus_interfaces = files(
top_srcdir / 'data' / 'org.gnome.Mutter.ServiceChannel.xml',
top_srcdir / 'data' / 'org.gnome.Shell.Introspect.xml',
Expand Down Expand Up @@ -51,19 +53,29 @@ config_h.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), mes
built_sources += configure_file(output: 'config.h', configuration: config_h)

# Sources
adw_min_version = '>= 1.4.0'

libadwaita_dep = dependency(
'libadwaita-1',
fallback: ['libadwaita', 'libadwaita_dep'],
default_options: ['examples=false', 'introspection=disabled', 'tests=false', 'vapi=false'],
version: adw_min_version,
default_options: [
'examples=false',
'introspection=disabled',
'tests=false',
'vapi=false',
],
)
deps = [
declare_dependency(sources: built_sources),
meson.get_compiler('c').find_library('m'),
dependency('fontconfig'),
dependency('glib-2.0'),
dependency('glib-2.0', version: '>= 2.62'),
dependency('gio-unix-2.0'),
dependency('gtk4'),
dependency('gtk4', version: '>= 4.0'),
dependency('gtk4-unix-print', version: '>= 4.0'),
dependency('gsettings-desktop-schemas'),
dependency('gnome-desktop-4'),
dependency('gnome-bg-4'),
libadwaita_dep,
xdg_desktop_portal_dep,
]
Expand Down Expand Up @@ -128,7 +140,6 @@ endif

add_project_arguments(common_flags, language: 'c')


executable(
'xdg-desktop-portal-tau',
sources,
Expand All @@ -142,4 +153,4 @@ install_data (
install_dir : datadir / 'glib-2.0' / 'schemas',
)

gnome.post_install(glib_compile_schemas: true)
gnome.post_install(glib_compile_schemas: true)
2 changes: 1 addition & 1 deletion xdg-desktop-portal-tau.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Name: xdg-desktop-portal-tau
Version: 1.1
Release: 13
Release: 14
Summary: Backend implementation for xdg-desktop-portal for tauOS

License: LGPLv2+
Expand Down

0 comments on commit 7804e6c

Please sign in to comment.