mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-09-29 20:44:17 +00:00
general: Add xdp-gnome imported code to the build
Make it a private static library to be used in commming commits. Contrary to upstream, we use the imported *.impl.* definitions. For convenience (not to move a lot of meson code around), define the HAVE_GTK_WAYLAND and HAVE_GTK_X11 in config.h instead of compiler flags.
This commit is contained in:
parent
90b63ac2a2
commit
b2ff00856e
13
meson.build
13
meson.build
|
@ -114,6 +114,11 @@ gmodule = dependency('gmodule-no-export-2.0', version: glib_ver)
|
||||||
gnome_autoar = dependency('gnome-autoar-0', version: '>= 0.4.4')
|
gnome_autoar = dependency('gnome-autoar-0', version: '>= 0.4.4')
|
||||||
gnome_desktop = dependency('gnome-desktop-4', version: '>= 43')
|
gnome_desktop = dependency('gnome-desktop-4', version: '>= 43')
|
||||||
gtk = dependency('gtk4', version: '>= 4.13.6')
|
gtk = dependency('gtk4', version: '>= 4.13.6')
|
||||||
|
gtk_x11 = dependency('gtk4-x11', required: false)
|
||||||
|
gtk_wayland = dependency('gtk4-wayland', required: false)
|
||||||
|
if gtk_wayland.found()
|
||||||
|
dependency('wayland-client')
|
||||||
|
endif
|
||||||
libadwaita = dependency('libadwaita-1', version: '>= 1.6.alpha')
|
libadwaita = dependency('libadwaita-1', version: '>= 1.6.alpha')
|
||||||
libportal = dependency('libportal', version: '>= 0.5')
|
libportal = dependency('libportal', version: '>= 0.5')
|
||||||
libportal_gtk4 = dependency('libportal-gtk4', version: '>= 0.5')
|
libportal_gtk4 = dependency('libportal-gtk4', version: '>= 0.5')
|
||||||
|
@ -168,6 +173,13 @@ conf.set('ENABLE_PACKAGEKIT', get_option('packagekit'))
|
||||||
conf.set('HAVE_SELINUX', get_option('selinux'))
|
conf.set('HAVE_SELINUX', get_option('selinux'))
|
||||||
conf.set('HAVE_CLOUDPROVIDERS', get_option('cloudproviders'))
|
conf.set('HAVE_CLOUDPROVIDERS', get_option('cloudproviders'))
|
||||||
|
|
||||||
|
if gtk_x11.found()
|
||||||
|
conf.set('HAVE_GTK_X11', 1)
|
||||||
|
endif
|
||||||
|
if gtk_wayland.found()
|
||||||
|
conf.set('HAVE_GTK_WAYLAND', 1)
|
||||||
|
endif
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
# config.h dependency, add to target dependencies if needed #
|
# config.h dependency, add to target dependencies if needed #
|
||||||
#############################################################
|
#############################################################
|
||||||
|
@ -200,6 +212,7 @@ nautilus_include_dirs = include_directories(
|
||||||
subdirs = [
|
subdirs = [
|
||||||
'data',
|
'data',
|
||||||
'eel',
|
'eel',
|
||||||
|
'xdp-gnome',
|
||||||
'libnautilus-extension',
|
'libnautilus-extension',
|
||||||
'po',
|
'po',
|
||||||
'src',
|
'src',
|
||||||
|
|
|
@ -285,6 +285,7 @@ nautilus_deps = [
|
||||||
nautilus_extension,
|
nautilus_extension,
|
||||||
selinux,
|
selinux,
|
||||||
tracker_sparql,
|
tracker_sparql,
|
||||||
|
xdp_gnome,
|
||||||
cloudproviders,
|
cloudproviders,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -1,153 +1,64 @@
|
||||||
gnome = import('gnome')
|
|
||||||
pkg = import('pkgconfig')
|
|
||||||
|
|
||||||
xdg_desktop_portal_dep = dependency('xdg-desktop-portal', version: '>= 1.17.0')
|
|
||||||
|
|
||||||
# Desktop Portal D-Bus interfaces
|
# Desktop Portal D-Bus interfaces
|
||||||
desktop_portal_dbus_interfaces = gnome_portal_interfaces + [
|
desktop_portal_dbus_interfaces = [
|
||||||
|
'org.freedesktop.impl.portal.FileChooser',
|
||||||
'org.freedesktop.impl.portal.Request',
|
'org.freedesktop.impl.portal.Request',
|
||||||
'org.freedesktop.impl.portal.Session',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
desktop_portal_interfaces_dir = xdg_desktop_portal_dep.get_variable(
|
|
||||||
pkgconfig: 'interfaces_dir')
|
|
||||||
|
|
||||||
desktop_portal_dbus_interfaces_files = []
|
desktop_portal_dbus_interfaces_files = []
|
||||||
foreach intf: desktop_portal_dbus_interfaces
|
foreach intf: desktop_portal_dbus_interfaces
|
||||||
desktop_portal_dbus_interfaces_files += [desktop_portal_interfaces_dir / '@0@.xml'.format(intf)]
|
desktop_portal_dbus_interfaces_files += ['data' / '@0@.xml'.format(intf)]
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
built_sources = gnome.gdbus_codegen(
|
xdp_gnome_generated = gnome.gdbus_codegen(
|
||||||
'xdg-desktop-portal-dbus',
|
'xdg-desktop-portal-dbus',
|
||||||
sources: desktop_portal_dbus_interfaces_files,
|
sources: desktop_portal_dbus_interfaces_files,
|
||||||
interface_prefix: 'org.freedesktop.impl.portal.',
|
interface_prefix: 'org.freedesktop.impl.portal.',
|
||||||
namespace: 'XdpImpl',
|
namespace: 'XdpImpl',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Mutter / GNOME Shell D-Bus interfaces
|
shell_dbus_interfaces = [
|
||||||
top_srcdir = meson.project_source_root()
|
'data' / 'org.gnome.Mutter.ServiceChannel.xml',
|
||||||
shell_dbus_interfaces = files(
|
|
||||||
top_srcdir / 'data' / 'org.freedesktop.Accounts.User.xml',
|
|
||||||
top_srcdir / 'data' / 'org.freedesktop.Accounts.xml',
|
|
||||||
top_srcdir / 'data' / 'org.gnome.Mutter.DisplayConfig.xml',
|
|
||||||
top_srcdir / 'data' / 'org.gnome.Mutter.InputCapture.xml',
|
|
||||||
top_srcdir / 'data' / 'org.gnome.Mutter.RemoteDesktop.xml',
|
|
||||||
top_srcdir / 'data' / 'org.gnome.Mutter.ScreenCast.xml',
|
|
||||||
top_srcdir / 'data' / 'org.gnome.Mutter.ServiceChannel.xml',
|
|
||||||
top_srcdir / 'data' / 'org.gnome.Shell.Introspect.xml',
|
|
||||||
top_srcdir / 'data' / 'org.gnome.Shell.Screenshot.xml',
|
|
||||||
)
|
|
||||||
|
|
||||||
built_sources += gnome.gdbus_codegen(
|
|
||||||
'shell-dbus',
|
|
||||||
sources: shell_dbus_interfaces,
|
|
||||||
interface_prefix: 'org.freedesktop.impl.portal.',
|
|
||||||
)
|
|
||||||
|
|
||||||
# GResources
|
|
||||||
built_sources += gnome.compile_resources(
|
|
||||||
'xdg-desktop-portal-gnome-resources',
|
|
||||||
'xdg-desktop-portal-gnome.gresource.xml',
|
|
||||||
c_name: '_xdg_desktop',
|
|
||||||
)
|
|
||||||
|
|
||||||
# config.h
|
|
||||||
config_h = configuration_data()
|
|
||||||
config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name())
|
|
||||||
config_h.set_quoted('LOCALEDIR', prefix / get_option('localedir'))
|
|
||||||
config_h.set_quoted('PACKAGE_NAME', meson.project_name())
|
|
||||||
config_h.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), meson.project_version()))
|
|
||||||
built_sources += configure_file(output: 'config.h', configuration: config_h)
|
|
||||||
|
|
||||||
# Sources
|
|
||||||
adw_min_version = '>= 1.4.0'
|
|
||||||
|
|
||||||
libadwaita_dep = dependency(
|
|
||||||
'libadwaita-1',
|
|
||||||
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', version: '>= 2.62'),
|
|
||||||
dependency('gio-unix-2.0'),
|
|
||||||
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,
|
|
||||||
]
|
]
|
||||||
|
|
||||||
sources = built_sources + files(
|
# Mutter / GNOME Shell D-Bus interfaces
|
||||||
'access.c',
|
xdp_gnome_generated += gnome.gdbus_codegen(
|
||||||
'account.c',
|
'shell-dbus',
|
||||||
'accountdialog.c',
|
sources: shell_dbus_interfaces,
|
||||||
'appchooser.c',
|
|
||||||
'appchooserrow.c',
|
|
||||||
'appchooserdialog.c',
|
|
||||||
'background.c',
|
|
||||||
'clipboard.c',
|
|
||||||
'displaystatetracker.c',
|
|
||||||
'dynamic-launcher.c',
|
|
||||||
'externalwindow.c',
|
|
||||||
'fc-monitor.c',
|
|
||||||
'filechooser.c',
|
|
||||||
'inputcapture.c',
|
|
||||||
'inputcapturedialog.c',
|
|
||||||
'gnomeinputcapture.c',
|
|
||||||
'gnomescreencast.c',
|
|
||||||
'lockdown.c',
|
|
||||||
'print.c',
|
|
||||||
'remotedesktop.c',
|
|
||||||
'remotedesktopdialog.c',
|
|
||||||
'request.c',
|
|
||||||
'screenshot.c',
|
|
||||||
'screenshotdialog.c',
|
|
||||||
'screencast.c',
|
|
||||||
'screencastgeometrycontainer.c',
|
|
||||||
'screencastwidget.c',
|
|
||||||
'screencastdialog.c',
|
|
||||||
'session.c',
|
|
||||||
'settings.c',
|
|
||||||
'shellintrospect.c',
|
|
||||||
'utils.c',
|
|
||||||
'wallpaperdialog.c',
|
|
||||||
'wallpaperpreview.c',
|
|
||||||
'wallpaper.c',
|
|
||||||
'xdg-desktop-portal-gnome.c',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
common_flags = []
|
# Sources
|
||||||
|
|
||||||
gtk_x11_dep = dependency('gtk4-x11', required: false)
|
xdp_gnome_deps = [
|
||||||
if gtk_x11_dep.found()
|
declare_dependency(sources: xdp_gnome_generated),
|
||||||
sources += files('externalwindow-x11.c')
|
config_h,
|
||||||
deps += [dependency('x11')]
|
libm,
|
||||||
common_flags += ['-DHAVE_GTK_X11']
|
glib,
|
||||||
|
gtk,
|
||||||
|
gio_unix,
|
||||||
|
]
|
||||||
|
|
||||||
|
xdp_gnome_sources = xdp_gnome_generated + files(
|
||||||
|
'externalwindow.c',
|
||||||
|
'externalwindow.h',
|
||||||
|
'request.c',
|
||||||
|
'request.h',
|
||||||
|
)
|
||||||
|
|
||||||
|
if gtk_x11.found()
|
||||||
|
xdp_gnome_sources += files('externalwindow-x11.c')
|
||||||
|
xdp_gnome_deps += [dependency('x11')]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
gtk_wayland_dep = dependency('gtk4-wayland', required: false)
|
if gtk_wayland.found()
|
||||||
if gtk_wayland_dep.found()
|
|
||||||
wayland_scanner = find_program('wayland-scanner')
|
wayland_scanner = find_program('wayland-scanner')
|
||||||
|
|
||||||
wayland_protocols_dir = top_srcdir / 'data'
|
|
||||||
|
|
||||||
wayland_protocols = [
|
wayland_protocols = [
|
||||||
'mutter-x11-interop',
|
'mutter-x11-interop',
|
||||||
]
|
]
|
||||||
|
|
||||||
foreach protocol : wayland_protocols
|
foreach protocol : wayland_protocols
|
||||||
client_header = custom_target('@0@ client header'.format(protocol),
|
client_header = custom_target('@0@ client header'.format(protocol),
|
||||||
input: wayland_protocols_dir / '@0@.xml'.format(protocol),
|
input: 'data' / '@0@.xml'.format(protocol),
|
||||||
output: '@0@-client-protocol.h'.format(protocol),
|
output: '@0@-client-protocol.h'.format(protocol),
|
||||||
command: [
|
command: [
|
||||||
wayland_scanner,
|
wayland_scanner,
|
||||||
|
@ -156,7 +67,7 @@ if gtk_wayland_dep.found()
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
protocol_code = custom_target('@0@ source'.format(protocol),
|
protocol_code = custom_target('@0@ source'.format(protocol),
|
||||||
input: wayland_protocols_dir / '@0@.xml'.format(protocol),
|
input: 'data' / '@0@.xml'.format(protocol),
|
||||||
output: '@0@-protocol.c'.format(protocol),
|
output: '@0@-protocol.c'.format(protocol),
|
||||||
command: [
|
command: [
|
||||||
wayland_scanner,
|
wayland_scanner,
|
||||||
|
@ -165,29 +76,23 @@ if gtk_wayland_dep.found()
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
sources += [client_header, protocol_code]
|
xdp_gnome_sources += [client_header, protocol_code]
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
sources += files('externalwindow-wayland.c')
|
xdp_gnome_sources += files('externalwindow-wayland.c')
|
||||||
common_flags += ['-DHAVE_GTK_WAYLAND']
|
xdp_gnome_deps += [
|
||||||
deps += [
|
|
||||||
dependency('wayland-client'),
|
dependency('wayland-client'),
|
||||||
]
|
]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
add_project_arguments(common_flags, language: 'c')
|
libxdp_gnome = static_library(
|
||||||
|
'xdp-gnome',
|
||||||
executable(
|
xdp_gnome_sources,
|
||||||
'xdg-desktop-portal-gnome',
|
dependencies: xdp_gnome_deps,
|
||||||
sources,
|
|
||||||
dependencies: deps,
|
|
||||||
install: true,
|
|
||||||
install_dir: libexecdir,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
install_data (
|
xdp_gnome = declare_dependency(
|
||||||
'xdg-desktop-portal-gnome.gschema.xml',
|
link_with: libxdp_gnome,
|
||||||
install_dir : datadir / 'glib-2.0' / 'schemas',
|
include_directories: nautilus_include_dirs,
|
||||||
)
|
dependencies: xdp_gnome_deps
|
||||||
|
)
|
||||||
gnome.post_install(glib_compile_schemas: true)
|
|
Loading…
Reference in a new issue