Commit 899e2a93 authored by Iñigo Martínez's avatar Iñigo Martínez Committed by Ondrej Holy

build: Port to meson build system

meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=786149
parent 5db16517
......@@ -27,6 +27,10 @@ EXTRA_DIST = \
m4 \
gettext/its/polkit.loc \
gettext/its/polkit.its \
meson.build \
meson_options.txt \
meson_post_install.py \
po/meson.build \
$(NULL)
distclean-local:
......
......@@ -96,4 +96,6 @@ endif
EXTRA_DIST = \
gvfsd-fuse-tmpfiles.conf \
meson.build \
symbol.map \
$(NULL)
headers = files(
'gvfsurimapper.h',
'gvfsuriutils.h'
)
install_headers(
headers,
subdir: join_paths('gvfs-client', 'gvfs')
)
# Dynamic client lib
uri_parser_sources = files(
'afpuri.c',
'httpuri.c',
'smburi.c'
)
uri_utils = files('gvfsuriutils.c')
sources = uri_parser_sources + uri_utils + files(
'gdaemonmount.c',
'gdaemonfile.c',
'gdaemonfileenumerator.c',
'gdaemonfileinputstream.c',
'gdaemonfilemonitor.c',
'gdaemonfileoutputstream.c',
'gdaemonvfs.c',
'gdaemonvolumemonitor.c',
'gvfsdaemondbus.c',
'gvfsiconloadable.c',
'gvfsurimapper.c'
)
cflags = [
'-DG_LOG_DOMAIN="@0@"'.format(gvfs_name.to_upper()),
'-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir),
'-DGVFS_MODULE_DIR="@0@"'.format(join_paths(gvfs_libdir, 'gvfs', 'modules'))
]
symbol_map = join_paths(meson.current_source_dir(), 'symbol.map')
ldflags = []
if have_version_script
ldflags += '-Wl,--version-script,@0@'.format(symbol_map)
endif
libgvfsdbus = shared_module(
'gvfsdbus',
sources: sources,
include_directories: top_inc,
dependencies: [
libgvfscommon_dep,
libmetadata_dep
],
c_args: cflags,
link_args: ldflags,
link_depends: symbol_map,
install: true,
install_rpath: gvfs_rpath,
install_dir: gio_module_dir
)
if enable_devel_utils
test_name = 'test-uri-utils'
executable(
test_name,
[test_name + '.c'] + uri_utils,
include_directories: top_inc,
dependencies: glib_deps + [libgvfscommon_dep],
c_args: cflags
)
endif
# FUSE daemon
if enable_fuse
# FIXME: reusing USE_LIBSYSTEMD_LOGIN as systemd has no universal header or pkg-config file
if enable_libsystemd_login
install_data(
'gvfsd-fuse-tmpfiles.conf',
install_dir: join_paths(gvfs_libdir, 'tmpfiles.d')
)
endif
executable(
'gvfsd-fuse',
'gvfsfusedaemon.c',
include_directories: top_inc,
dependencies: glib_deps + [
fuse_dep,
libgvfscommon_dep
],
c_args: cflags + ['-UG_LOG_DOMAIN'],
install: true,
install_rpath: gvfs_rpath,
install_dir: gvfs_libexecdir
)
endif
{
global:
g_vfs_*;
g_io_module_load;
g_io_module_unload;
g_io_module_query;
local:
*;
};
......@@ -87,6 +87,9 @@ libgvfscommon_gphoto2_la_LIBADD = \
endif
EXTRA_DIST = org.gtk.vfs.xml
EXTRA_DIST = \
org.gtk.vfs.xml \
meson.build \
$(NULL)
CLEANFILES = $(dbus_built_sources)
common_inc = include_directories('.')
common_cflags = ['-DG_LOG_DOMAIN="@0@"'.format(gvfs_name.to_upper())]
sources = files(
'gmountoperationdbus.c',
'gmountsource.c',
'gmountspec.c',
'gmounttracker.c',
'gvfsdaemonprotocol.c',
'gvfsfileinfo.c',
'gvfsicon.c',
'gvfsmonitorimpl.c',
'gvfsutils.c'
)
sources += gnome.gdbus_codegen(
'gvfsdbus',
gvfs_namespace + '.xml',
interface_prefix: gvfs_namespace + '.',
namespace: 'GVfsDBus'
)
cflags = common_cflags + ['-DREMOTE_VOLUME_MONITORS_DIR="@0@"'.format(gvfs_remote_volume_monitors_dir)]
libgvfscommon = shared_library(
'gvfscommon',
sources: sources,
include_directories: top_inc,
dependencies: glib_deps,
c_args: cflags,
install: true,
install_dir: gvfs_pkglibdir
)
libgvfscommon_dep = declare_dependency(
link_with: libgvfscommon,
include_directories: common_inc
)
deps = glib_deps
if enable_bluray
deps += libbluray_dep
endif
libgvfscommon_monitor = static_library(
'gvfscommon-monitor',
sources: 'gvfsmountinfo.c',
include_directories: top_inc,
dependencies: deps,
c_args: common_cflags,
link_with: libgvfscommon
)
libgvfscommon_monitor_dep = declare_dependency(
link_with: libgvfscommon_monitor,
include_directories: common_inc
)
if enable_avahi
sources = files(
'gvfsdnssdresolver.c',
'gvfsdnssdutils.c'
)
deps = glib_deps + [
avahi_client_dep,
avahi_glib_dep
]
libgvfscommon_dnssd = static_library(
'gvfscommon-dnssd',
sources: sources,
include_directories: top_inc,
dependencies: deps,
c_args: common_cflags,
link_with: libgvfscommon
)
libgvfscommon_dnssd_dep = declare_dependency(
link_with: libgvfscommon_dnssd,
include_directories: common_inc
)
endif
if enable_libmtp or enable_gphoto2
libgvfscommon_gphoto2 = static_library(
'gvfscommon-gphoto2',
sources: 'gvfsgphoto2utils.c',
include_directories: top_inc,
dependencies: gudev_dep
)
libgvfscommon_gphoto2_dep = declare_dependency(
link_with: libgvfscommon_gphoto2,
include_directories: common_inc
)
endif
......@@ -149,6 +149,7 @@ EXTRA_DIST = \
$(gsettings_ENUM_FILES) \
org.gtk.vfs.file-operations.policy.in.in \
org.gtk.vfs.file-operations.rules \
meson.build \
$(NULL)
DISTCLEANFILES = $(mount_DATA) $(noinst_DATA)
......
subdir('trashlib')
# D-Bus and systemd service files
service = gvfs_namespace + '.Daemon.service'
daemon_service = configure_file(
input: service + '.in',
output: service,
install: true,
install_dir: gvfs_dbus_service_dir,
configuration: service_conf
)
if have_systemd_user_unit
service = 'gvfs-daemon.service'
configure_file(
input: service + '.in',
output: service,
install: true,
install_dir: systemd_user_dir,
configuration: service_conf
)
endif
gnome.mkenums(
'org.gnome.system.gvfs.enums.xml',
sources: 'gvfs-enums.h',
comments: '<!-- @comment@ -->',
fhead: '<schemalist>',
vhead: ' <@type@ id="org.gnome.system.gvfs.@EnumName@">',
vprod: ' <value nick="@valuenick@" value="@valuenum@"/>',
vtail: ' </@type@>',
ftail: '</schemalist>',
install_header: true,
install_dir: gvfs_schema_dir
)
sources = files(
'gvfsbackend.c',
'gvfschannel.c',
'gvfsdaemon.c',
'gvfsdaemonutils.c',
'gvfsjob.c',
'gvfsjobcloseread.c',
'gvfsjobclosewrite.c',
'gvfsjobcopy.c',
'gvfsjobcreatemonitor.c',
'gvfsjobdbus.c',
'gvfsjobdelete.c',
'gvfsjobenumerate.c',
'gvfsjoberror.c',
'gvfsjobmakedirectory.c',
'gvfsjobmakesymlink.c',
'gvfsjobmount.c',
'gvfsjobmountmountable.c',
'gvfsjobmove.c',
'gvfsjobopenforread.c',
'gvfsjobopenforwrite.c',
'gvfsjobopeniconforread.c',
'gvfsjobpollmountable.c',
'gvfsjobprogress.c',
'gvfsjobpull.c',
'gvfsjobpush.c',
'gvfsjobqueryattributes.c',
'gvfsjobqueryfsinfo.c',
'gvfsjobqueryinfo.c',
'gvfsjobqueryinforead.c',
'gvfsjobqueryinfowrite.c',
'gvfsjobread.c',
'gvfsjobseekread.c',
'gvfsjobseekwrite.c',
'gvfsjobsetattribute.c',
'gvfsjobsetdisplayname.c',
'gvfsjobsource.c',
'gvfsjobstartmountable.c',
'gvfsjobstopmountable.c',
'gvfsjobtrash.c',
'gvfsjobtruncate.c',
'gvfsjobunmount.c',
'gvfsjobunmountmountable.c',
'gvfsjobwrite.c',
'gvfskeyring.c',
'gvfsmonitor.c',
'gvfsreadchannel.c',
'gvfswritechannel.c'
)
deps = glib_deps + socket_deps + [libgvfscommon_dep]
if enable_gcr
deps += gcr_dep
endif
if enable_keyring
deps += libsecret_dep
endif
cflags = [
'-DLIBEXEC_DIR="@0@"'.format(gvfs_libexecdir),
'-DMOUNTABLE_DIR="@0@"'.format(gvfs_mountdir),
'-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir)
]
libgvfsdaemon = shared_library(
'gvfsdaemon',
sources: sources,
include_directories: top_inc,
dependencies: deps,
c_args: cflags,
install: true,
install_dir: gvfs_pkglibdir
)
libgvfsdaemon_dep = declare_dependency(
link_with: libgvfsdaemon,
include_directories: include_directories('.'),
dependencies: deps,
compile_args: cflags
)
sources = files(
'main.c',
'mount.c'
)
executable(
'gvfsd',
sources,
include_directories: top_inc,
dependencies: libgvfsdaemon_dep,
install: true,
install_rpath: gvfs_rpath,
install_dir: gvfs_libexecdir
)
daemon_main_sources = files(
'daemon-main.c',
'daemon-main-generic.c'
)
programs = []
mounts = []
schema_data = []
convert_data = []
sources = files('gvfsbackendlocaltest.c')
cflags = [
'-DBACKEND_HEADER=gvfsbackendlocaltest.h',
'-DDEFAULT_BACKEND_TYPE=localtest',
'-DBACKEND_TYPES="localtest", G_VFS_TYPE_BACKEND_LOCALTEST,'
]
programs += [['gvfsd-localtest', sources, [], cflags]]
mounts += ['localtest']
sources = files(
'gvfsbackendftp.c',
'gvfsftpconnection.c',
'gvfsftpdircache.c',
'gvfsftpfile.c',
'gvfsftptask.c',
'ParseFTPList.c'
)
cflags = [
'-DBACKEND_HEADER=gvfsbackendftp.h',
'-DDEFAULT_BACKEND_TYPE=ftp',
'-DBACKEND_TYPES="ftp", G_VFS_TYPE_BACKEND_FTP, "ftps", G_VFS_TYPE_BACKEND_FTP,',
'-DMAX_JOB_THREADS=10'
]
programs += [['gvfsd-ftp', sources, [], cflags]]
mounts += ['ftp', 'ftps']
sources = files('gvfsbackendtrash.c')
deps = [libtrash_dep]
cflags = [
'-DBACKEND_HEADER=gvfsbackendtrash.h',
'-DDEFAULT_BACKEND_TYPE=trash',
'-DBACKEND_TYPES="trash", G_VFS_TYPE_BACKEND_TRASH,',
'-DMAX_JOB_THREADS=10'
]
programs += [['gvfsd-trash', sources, deps, cflags]]
mounts += ['trash']
sources = files('gvfsbackendrecent.c')
cflags = [
'-DBACKEND_HEADER=gvfsbackendrecent.h',
'-DDEFAULT_BACKEND_TYPE=recent',
'-DBACKEND_TYPES="recent", G_VFS_TYPE_BACKEND_RECENT,',
'-DBACKEND_USES_GVFS=1',
'-DMAX_JOB_THREADS=10'
]
programs += [['gvfsd-recent', sources, [], cflags]]
mounts += ['recent']
sources = files('gvfsbackendcomputer.c')
cflags = [
'-DBACKEND_HEADER=gvfsbackendcomputer.h',
'-DDEFAULT_BACKEND_TYPE=computer',
'-DBACKEND_TYPES="computer", G_VFS_TYPE_BACKEND_COMPUTER,',
'-DBACKEND_USES_GVFS=1',
'-DMAX_JOB_THREADS=1'
]
programs += [['gvfsd-computer', sources, [], cflags]]
mounts += ['computer']
sources = files('gvfsbackendnetwork.c')
cflags = [
'-DBACKEND_HEADER=gvfsbackendnetwork.h',
'-DDEFAULT_BACKEND_TYPE=network',
'-DBACKEND_TYPES="network", G_VFS_TYPE_BACKEND_NETWORK,',
'-DBACKEND_USES_GVFS=1',
'-DMAX_JOB_THREADS=1'
]
programs += [['gvfsd-network', sources, [], cflags]]
mounts += ['network']
sources = files('gvfsbackendburn.c')
cflags = [
'-DBACKEND_HEADER=gvfsbackendburn.h',
'-DDEFAULT_BACKEND_TYPE=burn',
'-DBACKEND_TYPES="burn", G_VFS_TYPE_BACKEND_BURN,',
'-DMAX_JOB_THREADS=1'
]
programs += [['gvfsd-burn', sources, [], cflags]]
mounts += ['burn']
sources = files(
'gvfsbackendsftp.c',
'pty_open.c'
)
deps = socket_deps + [util_dep]
cflags = [
'-DBACKEND_HEADER=gvfsbackendsftp.h',
'-DDEFAULT_BACKEND_TYPE=sftp',
'-DBACKEND_TYPES="sftp", G_VFS_TYPE_BACKEND_SFTP,',
'-DMAX_JOB_THREADS=1',
'-DSSH_PROGRAM="@0@"'.format(find_program('ssh').path())
]
programs += [['gvfsd-sftp', sources, deps, cflags]]
mounts += ['sftp']
if enable_samba
sources = files('gvfsbackendsmb.c')
deps = [smbclient_dep]
cflags = [
'-DBACKEND_HEADER=gvfsbackendsmb.h',
'-DDEFAULT_BACKEND_TYPE=smb',
'-DBACKEND_TYPES="smb-share", G_VFS_TYPE_BACKEND_SMB,',
'-DMAX_JOB_THREADS=1'
]
programs += [['gvfsd-smb', sources, deps, cflags]]
mounts += ['smb']
schema_data += files('org.gnome.system.smb.gschema.xml')
convert_data += files('gvfs-smb.convert')
sources += files('gvfsbackendsmbbrowse.c')
cflags = [
'-DBACKEND_HEADER=gvfsbackendsmbbrowse.h',
'-DDEFAULT_BACKEND_TYPE=smb-network',
'-DBACKEND_TYPES="smb-network", G_VFS_TYPE_BACKEND_SMB_BROWSE, "smb-server", G_VFS_TYPE_BACKEND_SMB_BROWSE,',
'-DMAX_JOB_THREADS=1',
'-DMOUNTABLE_DBUS_NAME=' + gvfs_namespace + '.mountpoint_smb_browse'
]
programs += [['gvfsd-smb-browse', sources, deps, cflags]]
mounts += ['smb-browse']
endif
if enable_avahi
sources = files('gvfsbackenddnssd.c')
deps = [
avahi_client_dep,
avahi_glib_dep,
libgvfscommon_dnssd_dep
]
cflags = [
'-DBACKEND_HEADER=gvfsbackenddnssd.h',
'-DDEFAULT_BACKEND_TYPE=dns-sd',
'-DBACKEND_TYPES="dns-sd", G_VFS_TYPE_BACKEND_DNS_SD,',
'-DMAX_JOB_THREADS=1',
'-DMOUNTABLE_DBUS_NAME=' + gvfs_namespace + '.mountpoint_dnssd'
]
programs += [['gvfsd-dnssd', sources, deps, cflags]]
mounts += ['dns-sd']
schema_data += files('org.gnome.system.dns_sd.gschema.xml')
convert_data += files('gvfs-dns-sd.convert')
endif
if enable_archive
sources = files('gvfsbackendarchive.c')
deps = [libarchive_dep]
cflags = [
'-DBACKEND_HEADER=gvfsbackendarchive.h',
'-DDEFAULT_BACKEND_TYPE=archive',
'-DBACKEND_TYPES="archive", G_VFS_TYPE_BACKEND_ARCHIVE,',
'-DMAX_JOB_THREADS=1',
'-DBACKEND_USES_GVFS=1'
]
programs += [['gvfsd-archive', sources, deps, cflags]]
mounts += ['archive']
endif
if enable_cdda
sources = files('gvfsbackendcdda.c')
deps = [
gudev_dep,
libcdio_paranoia_dep
]
cflags = [
'-DBACKEND_HEADER=gvfsbackendcdda.h',
'-DDEFAULT_BACKEND_TYPE=cdda',
'-DBACKEND_TYPES="cdda", G_VFS_TYPE_BACKEND_CDDA,',
'-DMAX_JOB_THREADS=1'
]
programs += [['gvfsd-cdda', sources, deps, cflags]]
mounts += ['cdda']
endif
if enable_admin
sources = files('gvfsbackendadmin.c')
deps = [
libcap_dep,
polkit_gobject_dep
]
cflags = [
'-DBACKEND_HEADER=gvfsbackendadmin.h',
'-DDEFAULT_BACKEND_TYPE=admin',
'-DBACKEND_TYPES="admin", G_VFS_TYPE_BACKEND_ADMIN,'
]
programs += [['gvfsd-admin', sources, deps, cflags]]
mounts += ['admin']
policy = gvfs_namespace + '.file-operations.policy'
policy_in = configure_file(
input: policy + '.in.in',
output: policy + '.in',
configuration: service_conf
)
i18n.merge_file(
policy,
input: policy_in,
output: policy,
po_dir: po_dir,
install: true,
install_dir: join_paths(gvfs_datadir, 'polkit-1', 'actions')
)
install_data(
gvfs_namespace + '.file-operations.rules',
install_dir: join_paths(gvfs_datadir, 'polkit-1', 'rules.d')
)
endif
if enable_google
sources = files('gvfsbackendgoogle.c')
deps = [
goa_dep,
libgdata_dep
]
cflags = [
'-DBACKEND_HEADER=gvfsbackendgoogle.h',
'-DDEFAULT_BACKEND_TYPE=google-drive',
'-DBACKEND_TYPES="google-drive", G_VFS_TYPE_BACKEND_GOOGLE,'
]
programs += [['gvfsd-google', sources, deps, cflags]]
mounts += ['google']
endif
if enable_gphoto2
sources = files('gvfsbackendgphoto2.c')
deps = [
gudev_dep,
libgphoto2_dep,
libgvfscommon_gphoto2_dep
]
cflags = [
'-DBACKEND_HEADER=gvfsbackendgphoto2.h',
'-DDEFAULT_BACKEND_TYPE=gphoto2',
'-DBACKEND_TYPES="gphoto2", G_VFS_TYPE_BACKEND_GPHOTO2,',
'-DMAX_JOB_THREADS=1'
]
programs += [['gvfsd-gphoto2', sources, deps, cflags]]
mounts += ['gphoto2']
endif