[gvfs/wip/inigomartinez/meson: 1/2] build: Port to meson build system
- From: Iñigo Martínez <inigomartinez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/wip/inigomartinez/meson: 1/2] build: Port to meson build system
- Date: Fri, 11 Aug 2017 12:19:49 +0000 (UTC)
commit 88a207fb3a607b5e243abcc918de6d9d13dcdcc7
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Fri Aug 11 11:45:48 2017 +0200
build: Port to meson build system
client/meson.build | 90 ++++++
client/symbol.map | 9 +
common/meson.build | 104 +++++++
daemon/meson.build | 464 ++++++++++++++++++++++++++++++
daemon/trashlib/meson.build | 19 ++
man/meson.build | 68 +++++
meson.build | 650 +++++++++++++++++++++++++++++++++++++++++++
meson_options.txt | 27 ++
meson_post_install.py | 15 +
metadata/meson.build | 99 +++++++
monitor/afc/meson.build | 57 ++++
monitor/gdu/meson.build | 59 ++++
monitor/goa/meson.build | 54 ++++
monitor/gphoto2/meson.build | 58 ++++
monitor/meson.build | 25 ++
monitor/mtp/meson.build | 55 ++++
monitor/proxy/meson.build | 64 +++++
monitor/proxy/symbol.map | 8 +
monitor/udisks2/meson.build | 71 +++++
po/meson.build | 1 +
programs/meson.build | 37 +++
test/gvfs-all-tests.in | 4 +
test/meson.build | 94 +++++++
23 files changed, 2132 insertions(+), 0 deletions(-)
---
diff --git a/client/meson.build b/client/meson.build
new file mode 100644
index 0000000..26cee97
--- /dev/null
+++ b/client/meson.build
@@ -0,0 +1,90 @@
+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'
+)
+
+deps = glib_deps + [libgvfscommon_dep]
+
+cflags = [
+ '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name().to_upper()),
+ '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir),
+ '-DGVFS_MODULE_DIR="@0@"'.format(join_paths(gvfs_libdir, 'gvfs', 'modules'))
+]
+
+symbol_map = 'symbol.map'
+
+ldflags = []
+if have_version_script
+ ldflags += '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbol_map)
+endif
+
+libgvfsdbus = shared_module(
+ 'gvfsdbus',
+ sources: sources + [metadata_dbus],
+ include_directories: top_inc,
+ dependencies: deps + [libmetadata_dep],
+ c_args: cflags,
+ link_args: ldflags,
+ link_depends: symbol_map,
+ install: true,
+ install_dir: gio_module_dir
+)
+
+test_name = 'test-uri-utils'
+
+executable(
+ test_name,
+ [test_name + '.c'] + uri_utils,
+ include_directories: top_inc,
+ dependencies: deps,
+ c_args: cflags
+)
+
+## FUSE daemon
+if have_fuse
+ # FIXME: reusing USE_LIBSYSTEMD_LOGIN as systemd has no universal header or pkg-config file
+ if have_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: deps + [fuse_dep],
+ c_args: cflags + ['-UG_LOG_DOMAIN'],
+ install: true,
+ install_dir: gvfs_libexecdir
+ )
+endif
diff --git a/client/symbol.map b/client/symbol.map
new file mode 100644
index 0000000..73699b0
--- /dev/null
+++ b/client/symbol.map
@@ -0,0 +1,9 @@
+{
+global:
+ g_vfs_*;
+ g_io_module_load;
+ g_io_module_unload;
+ g_io_module_query;
+local:
+ *;
+};
diff --git a/common/meson.build b/common/meson.build
new file mode 100644
index 0000000..8374cf8
--- /dev/null
+++ b/common/meson.build
@@ -0,0 +1,104 @@
+common_inc = include_directories('.')
+
+common_cflags = ['-DG_LOG_DOMAIN="@0@"'.format(meson.project_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_datadir, 'gvfs', 'remote-volume-monitors')
+]
+
+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 have_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,
+ pic: true
+)
+
+libgvfscommon_monitor_dep = declare_dependency(
+ link_with: libgvfscommon_monitor,
+ include_directories: common_inc
+)
+
+if have_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,
+ pic: true
+ )
+
+ libgvfscommon_dnssd_dep = declare_dependency(
+ link_with: libgvfscommon_dnssd,
+ include_directories: common_inc
+ )
+endif
+
+if have_libmtp or (have_gudev and have_gphoto2)
+ libgvfscommon_gphoto2 = static_library(
+ 'gvfscommon-gphoto2',
+ sources: 'gvfsgphoto2utils.c',
+ include_directories: top_inc,
+ dependencies: gudev_dep,
+ pic: true
+ )
+
+ libgvfscommon_gphoto2_dep = declare_dependency(
+ link_with: libgvfscommon_gphoto2,
+ include_directories: common_inc
+ )
+endif
diff --git a/daemon/meson.build b/daemon/meson.build
new file mode 100644
index 0000000..0453a10
--- /dev/null
+++ b/daemon/meson.build
@@ -0,0 +1,464 @@
+subdir('trashlib')
+
+# D-Bus and systemd service files
+service = 'org.gtk.vfs.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 + [libgvfscommon_dep]
+
+if have_gcr
+ deps += gcr_dep
+endif
+
+if have_keyring
+ deps += libsecret_dep
+endif
+
+gvfs_mountdir = join_paths(gvfs_datadir, 'gvfs', 'mounts')
+
+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
+)
+
+sources = files(
+ 'main.c',
+ 'mount.c'
+)
+
+executable(
+ 'gvfsd',
+ sources,
+ include_directories: top_inc,
+ dependencies: deps,
+ c_args: cflags,
+ link_with: libgvfsdaemon,
+ install: true,
+ install_dir: gvfs_libexecdir
+)
+
+daemon_main_sources = files(
+ 'daemon-main.c',
+ 'daemon-main-generic.c'
+)
+
+ftp_sources = files(
+ 'gvfsftpconnection.c',
+ 'gvfsftpdircache.c',
+ 'gvfsftpfile.c',
+ 'gvfsftptask.c',
+ 'ParseFTPList.c'
+)
+
+ftp_flags = ['-DMAX_JOB_THREADS=10']
+
+trash_deps = [libtrash_dep]
+
+trash_flags = ['-DMAX_JOB_THREADS=10']
+
+recent_flags = [
+ '-DBACKEND_USES_GVFS=1',
+ '-DMAX_JOB_THREADS=10'
+]
+
+computer_flags = [
+ '-DBACKEND_USES_GVFS=1',
+ '-DMAX_JOB_THREADS=1'
+]
+
+network_flags = [
+ '-DBACKEND_USES_GVFS=1',
+ '-DMAX_JOB_THREADS=1'
+]
+
+burn_flags = ['-DMAX_JOB_THREADS=1']
+
+'''
+name: gvfsd-{v},
+backend source: 'gvfsbackend{v}.c gvfsbackend{v}.h'
+extra sources: source files - {backend source + daemon main sources}
+g_vfs_type_backend: G_VFS_TYPE_BACKEND_{v}
+default backend: default backend name
+extra backends: backend names - {default backend name}
+dependencies: backend dependencies - {dependencies}
+c_args:
+ -DBACKEND_HEADER=gvfsbackend{backend source}.h,
+ -DDEFAULT_BACKEND_TYPE={default backend},
+ -DBACKEND_TYPES={"{backend}", G_VFS_TYPE_BACKEND_{g_vfs_type_backend},
+ - c_flags
+install exe: boolean
+mount names: names for .mount files
+'''
+programs = [
+ ['test', 'test', [], 'TEST', 'test', [], [], [], false, []],
+ ['localtest', 'localtest', [], 'LOCALTEST', 'localtest', [], [], [], true, ['localtest']],
+ ['ftp', 'ftp', ftp_sources, 'FTP', 'ftp', ['ftps'], [], ftp_flags, true, ['ftp', 'ftps']],
+ ['trash', 'trash', [], 'TRASH', 'trash', [], trash_deps, trash_flags, true, ['trash']],
+ ['recent', 'recent', [], 'RECENT', 'recent', [], [], recent_flags, true, ['recent']],
+ ['computer', 'computer', [], 'COMPUTER', 'computer', [], [], computer_flags, true, ['computer']],
+ ['network', 'network', [], 'NETWORK', 'network', [], [], network_flags, true, ['network']],
+ ['burn', 'burn', [], 'BURN', 'burn', [], [], burn_flags, true, ['burn']]
+]
+
+schema_data = []
+convert_data = []
+
+if have_openpty
+ sftp_sources = files('pty_open.c')
+
+ sftp_deps = [util_dep]
+
+ sftp_flags = [
+ '-DMAX_JOB_THREADS=1',
+ '-DSSH_PROGRAM="@0@"'.format(find_program('ssh').path())
+ ]
+
+ programs += [['sftp', 'sftp', sftp_sources, 'SFTP', 'sftp', [], sftp_deps, sftp_flags, true, ['sftp']]]
+endif
+
+if have_samba
+ smb_deps = [smbclient_dep]
+
+ smb_flags = ['-DMAX_JOB_THREADS=1']
+
+ smb_browse_sources = files('gvfsbackendsmb.c')
+
+ smb_browse_flags = smb_flags + ['-DMOUNTABLE_DBUS_NAME=org.gtk.vfs.mountpoint_smb_browse']
+
+ programs += [
+ ['smb', 'smb', [], 'SMB', 'smb-share', [], smb_deps, smb_flags, true, ['smb']],
+ ['smb-browse', 'smbbrowse', smb_browse_sources, 'SMB_BROWSE', 'smb-network', ['smb-server'], smb_deps,
smb_flags, true, ['smb-browse']]
+ ]
+
+ schema_data += files('org.gnome.system.smb.gschema.xml')
+ convert_data += files('gvfs-smb.convert')
+endif
+
+if have_avahi
+ dnssd_deps = [
+ avahi_client_dep,
+ avahi_glib_dep,
+ libgvfscommon_dnssd_dep
+ ]
+
+ dnssd_flags = [
+ '-DMAX_JOB_THREADS=1',
+ '-DMOUNTABLE_DBUS_NAME=org.gtk.vfs.mountpoint_dnssd'
+ ]
+
+ programs += [['dnssd', 'dnssd', [], 'DNS_SD', 'dns-sd', [], dnssd_deps, dnssd_flags, true, ['dns-sd']]]
+
+ schema_data += files('org.gnome.system.dns_sd.gschema.xml')
+ convert_data += files('gvfs-dns-sd.convert')
+endif
+
+if have_archive
+ archive_deps = [libarchive_dep]
+
+ archive_flags = [
+ '-DBACKEND_USES_GVFS=1',
+ '-DMAX_JOB_THREADS=1'
+ ]
+
+ programs += [['archive', 'archive', [], 'ARCHIVE', 'archive', [], archive_deps, archive_flags, true,
['archive']]]
+endif
+
+if have_cdda
+ cdda_deps = [
+ gudev_dep,
+ libcdio_paranoia_dep
+ ]
+
+ cdda_flags = ['-DMAX_JOB_THREADS=1']
+
+ programs += [['cdda', 'cdda', [], 'CDDA', 'cdda', [], cdda_deps, cdda_flags, true, ['cdda']]]
+endif
+
+if have_admin
+ admin_deps = [
+ libcap_dep,
+ polkit_gobject_dep
+ ]
+
+ programs += [['admin', 'admin', [], 'ADMIN', 'admin', [], admin_deps, [], true, ['admin']]]
+
+ policy = 'org.gtk.vfs.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(
+ 'org.gtk.vfs.file-operations.rules',
+ install_dir: join_paths(gvfs_datadir, 'polkit-1', 'rules.d')
+ )
+endif
+
+if have_google
+ google_deps = [
+ goa_dep,
+ libgdata_dep
+ ]
+
+ programs += [['google', 'google', [], 'GOOGLE', 'google-drive', [], google_deps, [], true, ['google']]]
+endif
+
+if have_gudev and have_gphoto2
+ gphoto2_deps = [
+ gudev_dep,
+ libgphoto2_dep,
+ libgvfscommon_gphoto2_dep
+ ]
+
+ gphoto2_flags = ['-DMAX_JOB_THREADS=1']
+
+ programs += [['gphoto2', 'gphoto2', [], 'GPHOTO2', 'gphoto2', [], gphoto2_deps, [], true, ['gphoto2']]]
+endif
+
+if have_libmtp
+ mtp_deps = [
+ gudev_dep,
+ libgvfscommon_gphoto2_dep,
+ libmtp_dep
+ ]
+
+ if have_libusb
+ mtp_deps += [libusb_dep]
+ endif
+
+ mtp_flags = ['-DMAX_JOB_THREADS=1']
+
+ programs += [['mtp', 'mtp', [], 'MTP', 'mtp', [], mtp_deps, [], true, ['mtp']]]
+endif
+
+if have_http
+ http_sources = files('gvfshttpinputstream.c')
+
+ http_deps = [
+ libsoup_dep,
+ libxml_dep
+ ]
+
+ http_flags = [
+ '-DMOUNTABLE_DBUS_NAME=org.gtk.vfs.mountpoint_http',
+ '-DMAX_JOB_THREADS=1'
+ ]
+
+ dav_sources = http_sources + files('gvfsbackendhttp.c')
+
+ dav_deps = http_deps
+
+ dav_flags = ['-DMAX_JOB_THREADS=1']
+
+ dav_backends = []
+ dav_mounts = ['dav']
+
+ if have_avahi
+ dav_deps += [libgvfscommon_dnssd_dep]
+ dav_backends += ['dav+sd', 'davs+sd']
+ dav_mounts += ['dav+sd']
+ endif
+
+ programs += [
+ ['http', 'http', http_sources, 'HTTP', 'http', [], http_deps, [], true, ['http']],
+ ['dav', 'dav', dav_sources, 'DAV', 'dav', dav_backends, dav_deps, dav_flags, true, dav_mounts]
+ ]
+endif
+
+if have_afc
+ afc_deps = [
+ libimobiledevice_dep,
+ libplist_dep
+ ]
+
+ afc_flags = [
+ '-DBACKEND_USES_GVFS=1',
+ '-DMAX_JOB_THREADS=1'
+ ]
+
+ programs += [['afc', 'afc', [], 'AFC', 'afc', [], afc_deps, afc_flags, true, ['afc']]]
+endif
+
+if have_afp
+ afp_sources = files(
+ 'gvfsafptypes.h',
+ 'gvfsafputils.c',
+ 'gvfsafpconnection.c',
+ 'gvfsafpserver.c',
+ 'gvfsafpvolume.c'
+ )
+
+ afp_deps = []
+ if have_gcrypt
+ afp_deps += libgcrypt_dep
+ endif
+
+ afp_flags = ['-DMAX_JOB_THREADS=1']
+
+ programs += [
+ ['afp', 'afp', afp_sources, 'AFP', 'afp-volume', [], afp_deps, afp_flags, true, ['afp']],
+ ['afp-browse', 'afpbrowse', afp_sources, 'AFP_BROWSE', 'afp-server', [], afp_deps, afp_flags, true,
['afp-browse']]
+ ]
+endif
+
+if have_nfs
+ nfs_deps = [libnfs_dep]
+
+ nfs_flags = ['-DMAX_JOB_THREADS=1']
+
+ programs += [['nfs', 'nfs', [], 'NFS', 'nfs', [], nfs_deps, nfs_flags, true, ['nfs']]]
+endif
+
+localmount_conf = configuration_data()
+localmount_conf.set('libexecdir', meson.current_build_dir())
+
+foreach program: programs
+ program_cflags = cflags + program[7] + [
+ '-DBACKEND_HEADER=gvfsbackend' + program[1] + '.h',
+ '-DDEFAULT_BACKEND_TYPE=' + program[4],
+ ]
+
+ g_vfs_type_backend = 'G_VFS_TYPE_BACKEND_' + program[3]
+
+ backend_cflags = '-DBACKEND_TYPES="@0@", @1@,'.format(program[4], g_vfs_type_backend)
+ foreach backend: program[5]
+ backend_cflags += ' "@0@", @1@,'.format(backend, g_vfs_type_backend)
+ endforeach
+
+ executable(
+ 'gvfsd-' + program[0],
+ ['gvfsbackend' + program[1] + '.c'] + program[2] + daemon_main_sources,
+ include_directories: top_inc,
+ dependencies: deps + program[6],
+ c_args: program_cflags + [backend_cflags],
+ link_with: libgvfsdaemon,
+ install: program[8],
+ install_dir: gvfs_libexecdir
+ )
+
+ foreach name: program[9]
+ mount = name + '.mount'
+
+ configure_file(
+ input: mount + '.in',
+ output: mount,
+ install: true,
+ install_dir: gvfs_mountdir,
+ configuration: service_conf
+ )
+ endforeach
+endforeach
+
+install_data(
+ schema_data,
+ install_dir: gvfs_schema_dir
+)
+
+install_data(
+ convert_data,
+ install_dir: join_paths(gvfs_datadir, 'GConf', 'gsettings')
+)
diff --git a/daemon/trashlib/meson.build b/daemon/trashlib/meson.build
new file mode 100644
index 0000000..610bb62
--- /dev/null
+++ b/daemon/trashlib/meson.build
@@ -0,0 +1,19 @@
+sources = files(
+ 'dirwatch.c',
+ 'trashdir.c',
+ 'trashitem.c',
+ 'trashwatcher.c',
+ 'trashexpunge.c'
+)
+
+libtrash = static_library(
+ 'trash',
+ sources: sources,
+ include_directories: top_inc,
+ dependencies: glib_deps
+)
+
+libtrash_dep = declare_dependency(
+ link_with: libtrash,
+ include_directories: include_directories('.')
+)
diff --git a/man/meson.build b/man/meson.build
new file mode 100644
index 0000000..1b754e4
--- /dev/null
+++ b/man/meson.build
@@ -0,0 +1,68 @@
+xsltproc = find_program('xsltproc', required: false)
+assert(xsltproc.found(), 'xsltproc is required for enable-man')
+
+xsltproc_cmd = [
+ xsltproc,
+ '--output', '@OUTPUT@',
+ '--nonet',
+ '--stringparam', 'man.output.quietly', '1',
+ '--stringparam', 'funcsynopsis.style', 'ansi',
+ '--stringparam', 'man.th.extra1.suppress', '1',
+ '--stringparam', 'man.authors.section.enabled', '0',
+ '--stringparam', 'man.copyright.section.enabled', '0',
+ 'http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl',
+ '@INPUT@'
+]
+
+mans = [
+ ['gvfs-cat', 'gio cat', 1],
+ ['gvfs-copy', 'gio copy', 1],
+ ['gvfs-info', 'gio info', 1],
+ ['gvfs-less', '', 1],
+ ['gvfs-ls', 'gio list', 1],
+ ['gvfs-mime', 'gio mime', 1],
+ ['gvfs-mkdir', 'gio mkdir', 1],
+ ['gvfs-monitor-dir', 'gio monitor', 1],
+ ['gvfs-monitor-file', 'gio monitor', 1],
+ ['gvfs-mount', 'gio mount', 1],
+ ['gvfs-move', 'gio move', 1],
+ ['gvfs-open', 'gio open', 1],
+ ['gvfs-rename', 'gio rename', 1],
+ ['gvfs-rm', 'gio remove', 1],
+ ['gvfs-save', 'gio save', 1],
+ ['gvfs-set-attribute', 'gio set', 1],
+ ['gvfs-trash', 'gio trash', 1],
+ ['gvfs-tree', 'gio tree', 1],
+ ['gvfs', '', 7],
+ ['gvfsd', '', 1],
+ ['gvfsd-fuse', '', 1],
+ ['gvfsd-metadata', '', 1]
+]
+
+foreach man: mans
+ if man[1].strip() == ''
+ xml = man[0] + '.xml'
+ else
+ conf = configuration_data()
+ conf.set('original', man[0])
+ conf.set('replacement', man[1])
+
+ xml = configure_file(
+ input: 'deprecated.xml.in',
+ output: man[0] + '.xml',
+ configuration: conf
+ )
+ endif
+
+ output = '@0@.@1@'.format(man[0], man[2])
+ man_dir = 'man@0@'.format(man[2])
+
+ custom_target(
+ output,
+ input: xml,
+ output: output,
+ command: xsltproc_cmd,
+ install: true,
+ install_dir: join_paths(gvfs_mandir, man_dir)
+ )
+endforeach
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..513637b
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,650 @@
+project(
+ 'gvfs', 'c',
+ version: '1.33.90',
+ license: 'LGPL2.1',
+ default_options: [
+ 'buildtype=debugoptimized',
+ 'warning_level=1',
+ 'b_lundef=true'
+ ],
+ meson_version: '>= 0.41.0'
+)
+
+gvfs_version = meson.project_version()
+version_array = gvfs_version.split('.')
+gvfs_major_version = version_array[0].to_int()
+gvfs_minor_version = version_array[1].to_int()
+gvfs_micro_version = version_array[2].to_int()
+
+gvfs_namespace = 'org.gtk.vfs'
+
+gvfs_prefix = get_option('prefix')
+gvfs_bindir = join_paths(gvfs_prefix, get_option('bindir'))
+gvfs_datadir = join_paths(gvfs_prefix, get_option('datadir'))
+gvfs_includedir = join_paths(gvfs_prefix, get_option('includedir'))
+gvfs_libdir = join_paths(gvfs_prefix, get_option('libdir'))
+gvfs_libexecdir = join_paths(gvfs_prefix, get_option('libexecdir'))
+gvfs_localedir = join_paths(gvfs_prefix, get_option('localedir'))
+gvfs_mandir = join_paths(gvfs_prefix, get_option('mandir'))
+
+gvfs_pkgdatadir = join_paths(gvfs_datadir, meson.project_name())
+gvfs_pkglibdir = join_paths(gvfs_libdir, meson.project_name())
+
+gvfs_dbus_service_dir = join_paths(gvfs_datadir, 'dbus-1', 'services')
+gvfs_remote_volume_monitors_dir = join_paths(gvfs_pkgdatadir, 'remote-volume-monitors')
+gvfs_schema_dir = join_paths(gvfs_datadir, 'glib-2.0', 'schemas')
+
+gio_module_dir = join_paths(gvfs_libdir, 'gio', 'modules')
+
+gvfs_debug = get_option('buildtype').contains('debug')
+
+cc = meson.get_compiler('c')
+
+config_h = configuration_data()
+
+# defines
+set_defines = [
+ # package
+ ['PACKAGE', meson.project_name()],
+ ['PACKAGE_BUGREPORT', 'http://bugzilla.gnome.org/enter_bug.cgi?product=' + meson.project_name()],
+ ['PACKAGE_NAME', meson.project_name()],
+ ['PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), gvfs_version)],
+ ['PACKAGE_TARNAME', meson.project_name()],
+ ['PACKAGE_URL', ''],
+ ['PACKAGE_VERSION', gvfs_version],
+ ['VERSION', gvfs_version],
+ # i18n
+ ['GETTEXT_PACKAGE', meson.project_name()]
+]
+
+foreach define: set_defines
+ config_h.set_quoted(define[0], define[1])
+endforeach
+
+config_h.set('STDC_HEADERS', true)
+
+# Globally define_GNU_SOURCE and therefore enable the GNU extensions
+config_h.set('_GNU_SOURCE', true)
+config_h.set('_FILE_OFFSET_BITS', 64)
+
+# Pull in the right libraries for various functions which might not be
+# bundled into an exploded libc.
+have_socketpair = cc.has_function('socketpair')
+if not have_socketpair
+ socket_dep = cc.find_library('socket', required: false)
+ have_socketpair = socket_dep.found() and cc.has_function('socketpair', dependencies: socket_dep)
+endif
+
+config_h.set('HAVE_SOCKETPAIR', have_socketpair,
+ description: 'Define if you have the socketpair function.')
+
+util_dep = cc.find_library('util', required: false)
+config_h.set('HAVE_UTIL_H', cc.has_header('util.h', dependendencies: util_dep))
+
+have_openpty = cc.has_function('openpty')
+if not have_openpty
+ have_openpty = util_dep.found() and cc.has_function('openpty', dependencies: util_dep)
+endif
+
+config_h.set('HAVE_OPENPTY', have_openpty,
+ description: 'Define if you have the openpty function.')
+
+config_h.set('HAVE_LOGIN_TTY', util_dep.found() and cc.has_function('login_tty', dependencies: util_dep),
+ description: 'Whether login_tty is available')
+
+# if statfs() takes 2 arguments (Posix) or 4 (Solaris)
+statfs_code = '''
+ #include <sys/statfs.h>
+ #include <sys/vfs.h>
+ int main() {
+ struct statfs st;
+ @0@;
+ };
+'''
+
+if cc.compiles(statfs_code.format('statfs("/", &st)'))
+ config_h.set('STATFS_ARGS', 2)
+elif cc.compiles(statfs_code.format('statfs("/", &st, sizeof (st), 0)'))
+ config_h.set('STATFS_ARGS', 4)
+else
+ error('unable to determine number of arguments to statfs()')
+endif
+
+# headers
+check_headers = [
+ ['HAVE_DLFCN_H', 'dlfcn.h'],
+ ['HAVE_INTTYPES_H', 'inttypes.h'],
+ ['HAVE_MEMORY_H', 'memory.h'],
+ ['HAVE_STDINT_H', 'stdint.h'],
+ ['HAVE_STDLIB_H', 'stdlib.h'],
+ ['HAVE_STRINGS_H', 'strings.h'],
+ ['HAVE_STRING_H', 'string.h'],
+ ['HAVE_SYS_STAT_H', 'sys/stat.h'],
+ ['HAVE_SYS_TYPES_H', 'sys/types.h'],
+ ['HAVE_UNISTD_H', 'unistd.h'],
+ # pty + fs
+ ['HAVE_SYS_PARAM_H', 'sys/param.h'],
+ # pty
+ ['HAVE_STROPTS_H', 'stropts.h'],
+ ['HAVE_SYS_UIO_H', 'sys/uio.h'],
+ ['HAVE_SYS_UN_H', 'sys/un.h'],
+ ['HAVE_TERMIOS_H', 'termios.h'],
+ ['HAVE_UTMP_H', 'utmp.h'],
+ # fs
+ ['HAVE_SYS_MOUNT_H', 'sys/mount.h'],
+ ['HAVE_SYS_STATFS_H', 'sys/statfs.h'],
+ ['HAVE_SYS_STATVFS_H', 'sys/statvfs.h'],
+ ['HAVE_SYS_VFS_H', 'sys/vfs.h']
+]
+
+foreach header: check_headers
+ config_h.set10(header[0], cc.has_header(header[1]))
+endforeach
+
+# functions
+check_functions = [
+ # i18n
+ ['HAVE_DCGETTEXT', 'dcgettext'],
+ ['HAVE_GETTEXT', 'gettext'],
+ ['HAVE_ICONV', 'iconv'],
+ # pty
+ ['HAVE_GETPT', 'getpt'],
+ ['HAVE_GRANTPT', 'grantpt'],
+ ['HAVE_POSIX_OPENPT', 'posix_openpt'],
+ ['HAVE_PTSNAME', 'ptsname'],
+ ['HAVE_PTSNAME_R', 'ptsname_r'],
+ ['HAVE_UNLOCKPT', 'unlockpt'],
+ # fs
+ ['HAVE_STATFS', 'statfs'],
+ ['HAVE_STATVFS', 'statvfs']
+]
+
+if host_machine.system().contains('darwin')
+ check_functions += [
+ ['HAVE_CFLOCALECOPYCURRENT', 'CFLocaleCopyCurrent'],
+ ['HAVE_CFPREFERENCESCOPYAPPVALUE', 'CFPreferencesCopyAppValue']
+ ]
+endif
+
+foreach func: check_functions
+ config_h.set(func[0], cc.has_function(func[1]))
+endforeach
+
+# symbols
+check_symbols = [
+ # i18n
+ ['HAVE_NL_ADDRESS_LANG_TERM', 'langinfo.h', '_NL_ADDRESS_LANG_TERM'],
+ ['HAVE_NL_ADDRESS_COUNTRY_AB3', 'langinfo.h', '_NL_ADDRESS_COUNTRY_AB3']
+]
+
+foreach symbol: check_symbols
+ config_h.set(symbol[0], cc.has_header_symbol(symbol[1], symbol[2]))
+endforeach
+
+# fs, check major, minor and makedev functions
+check_major_functions = ['major', 'minor', 'makedev']
+
+check_major_headers = [
+ ['MAJOR_IN_MKDEV', 'sys/mkdev.h'],
+ ['MAJOR_IN_SYSMACROS', 'sys/sysmacros.h']
+]
+
+foreach header: check_major_headers
+ have_major = true
+ foreach function: check_major_functions
+ have_major = have_major and cc.has_header_symbol(header[1], function)
+ endforeach
+
+ config_h.set10(header[0], have_major)
+endforeach
+
+# types
+check_types = [
+ # type, header, fallback type
+ ['gid_t', 'sys/types.h', 'int'],
+ ['pid_t', 'sys/types.h', 'int'],
+ ['size_t', 'sys/types.h', 'unsigned int'],
+ ['uid_t', 'sys/types.h', 'int']
+]
+
+foreach type: check_types
+ if not cc.has_type(type[0], prefix: '#include<@0@>'.format(type[1]))
+ config_h.set(type[0], type[2])
+ endif
+endforeach
+
+# members
+check_members = [
+ # define, typename, membername, prefix
+ ['HAVE_STRUCT_STATFS_F_BAVAIL', 'struct statfs', 'f_bavail', '#include<sys/statfs.h>'],
+ ['HAVE_STRUCT_STATFS_F_FSTYPENAME', 'struct statfs', 'f_fstypename', '#include<sys/statfs.h>'],
+ ['HAVE_STRUCT_STATVFS_F_BASETYPE', 'struct statvfs', 'f_basetype', '#include<sys/statvfs.h>'],
+ ['HAVE_STRUCT_STAT_ST_ATIMENSEC', 'struct stat', 'st_atimensec', '#include<sys/stat.h>'],
+ ['HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC', 'struct stat', 'st_atim.tv_nsec', '#include<sys/stat.h>'],
+ ['HAVE_STRUCT_STAT_ST_CTIMENSEC', 'struct stat', 'st_ctimensec', '#include<sys/stat.h>'],
+ ['HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC', 'struct stat', 'st_ctim.tv_nsec', '#include<sys/stat.h>'],
+ ['HAVE_STRUCT_STAT_ST_MTIMENSEC', 'struct stat', 'st_mtimensec', '#include<sys/stat.h>'],
+ ['HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC', 'struct stat', 'st_mtim.tv_nsec', '#include<sys/stat.h>']
+]
+
+foreach member: check_members
+ config_h.set(member[0], cc.has_members(member[1], member[2], prefix: member[3]))
+endforeach
+
+# compiler flags
+common_flags = ['-DHAVE_CONFIG_H',]
+
+if gvfs_debug
+ test_flags = [
+ '-Wcast-align',
+ '-Wmissing-declarations',
+ '-Wmissing-prototypes',
+ '-Wnested-externs',
+ '-Wno-sign-compare',
+ '-Wno-strict-aliasing'
+ ]
+
+ foreach flag: test_flags
+ if cc.has_argument(flag)
+ common_flags += [flag]
+ endif
+ endforeach
+endif
+
+add_project_arguments(common_flags, language: 'c')
+
+ldflag = '-Wl,--version-script'
+have_version_script = host_machine.system().contains('linux') and cc.has_argument(ldflag)
+
+glib_deps = [
+ dependency('gio-2.0'),
+ dependency('gio-unix-2.0'),
+ dependency('glib-2.0', version: '>= 2.51.0'),
+ dependency('gmodule-no-export-2.0'),
+ dependency('gobject-2.0')
+]
+
+# *** Check for libXML ***
+libxml_dep = dependency('libxml-2.0', required: false)
+have_libxml = libxml_dep.found()
+
+config_h.set('HAVE_LIBXML', have_libxml)
+
+# *** Check for libgcrypt ***
+libgcrypt_config = find_program('libgcrypt-config')
+libgcrypt_version = run_command(libgcrypt_config, '--version').stdout().strip()
+
+libgcrypt_cflags = run_command(libgcrypt_config, '--cflags').stdout().strip().split()
+libgcrypt_libs = run_command(libgcrypt_config, '--libs').stdout().strip().split()
+
+libgcrypt_dep = declare_dependency(
+ compile_args: libgcrypt_cflags,
+ link_args: libgcrypt_libs,
+ version: libgcrypt_version
+)
+
+have_gcrypt = libgcrypt_version.version_compare('>= 1.2.2')
+
+config_h.set('HAVE_GCRYPT', have_gcrypt)
+
+# *** Check for dbus service dir ***
+dbus_service_dir = get_option('with-dbus-service-dir').strip()
+if dbus_service_dir == ''
+ dbus_service_dir = join_paths(gvfs_datadir, 'dbus-1', 'services')
+endif
+
+# *** Check for systemd user units ***
+systemd_user_dir = get_option('with-systemduserunitdir').strip()
+have_systemd_user_unit = systemd_user_dir != 'no'
+
+if have_systemd_user_unit
+ systemd_dep = dependency('systemd', version: '>= 206')
+
+ if systemd_user_dir == ''
+ systemd_user_dir = join_paths(gvfs_libdir, 'systemd', 'user')
+ endif
+endif
+
+# *** Check for gcr ***
+enable_gcr = get_option('enable-gcr')
+have_gcr = false
+
+if enable_gcr != 'no'
+ gcr_dep = dependency('gcr-base-3', required: (enable_gcr == 'yes'))
+ have_gcr = gcr_dep.found()
+endif
+
+config_h.set('HAVE_GCR', have_gcr)
+
+# *** Check if we should build with admin backend ***
+enable_admin = get_option('enable-admin')
+have_admin = false
+
+if enable_admin != 'no'
+ required = (enable_admin == 'yes')
+
+ libcap_dep = dependency('libcap', required: required)
+ polkit_gobject_dep = dependency('polkit-gobject-1', required: required)
+
+ have_admin = libcap_dep.found() and polkit_gobject_dep.found()
+endif
+
+config_h.set('HAVE_ADMIN', have_admin)
+
+# *** Check if we should build with http backend ***
+enable_http = get_option('enable-http')
+have_http = false
+
+if enable_http != 'no'
+ required = (enable_http == 'yes')
+
+ assert(not required and libxml_dep.found(), 'http required but libxml-2.0 not found')
+
+ libsoup_dep = dependency('libsoup-2.4', version: '>= 2.42.0', required: required)
+
+ have_http = libxml_dep.found() and libsoup_dep.found()
+endif
+
+config_h.set('HAVE_HTTP', have_http)
+
+# *** Check if we should build with DNS-SD backend ***
+enable_avahi = get_option('enable-avahi')
+have_avahi = false
+
+if enable_avahi != 'no'
+ required = (enable_avahi == 'yes')
+
+ avahi_client_dep = dependency('avahi-client', version: '>= 0.6', required: required)
+ avahi_glib_dep = dependency('avahi-glib', version: '>= 0.6', required: required)
+
+ have_avahi = avahi_client_dep.found() and avahi_glib_dep.found()
+endif
+
+config_h.set('HAVE_AVAHI', have_avahi)
+
+# *** Check for libudev ***
+enable_udev = get_option('enable-udev')
+have_udev = false
+
+if enable_udev != 'no'
+ libudev_dep = dependency('libudev', version: '>= 138', required: (enable_udev == 'yes'))
+ have_udev = libudev_dep.found()
+endif
+
+config_h.set('HAVE_LIBUDEV', have_udev)
+
+# *** Check for gudev ***
+enable_gudev = get_option('enable-gudev')
+have_gudev = false
+
+if enable_gudev != 'no'
+ gudev_dep = dependency('gudev-1.0', version: '>= 147', required: (enable_gudev == 'yes'))
+ have_gudev = gudev_dep.found()
+endif
+
+config_h.set('HAVE_GUDEV', have_gudev)
+
+# *** Check for FUSE ***
+enable_fuse = get_option('enable-fuse')
+have_fuse = false
+
+if enable_fuse != 'no'
+ fuse_dep = dependency('fuse', version: '>= 2.8.0', required: (enable_fuse == 'yes'))
+ have_fuse = fuse_dep.found()
+endif
+
+config_h.set('HAVE_FUSE', have_fuse)
+
+# *** Check for gnome-disk-utility ***
+enable_gdu = get_option('enable-gdu')
+have_gdu = false
+
+if enable_gdu != 'no'
+ gdu_dep = dependency('gdu', version: '>= 3.0.2', required: (enable_gdu == 'yes'))
+ have_gdu = gdu_dep.found()
+endif
+
+config_h.set('HAVE_GDU', have_gdu)
+
+# *** Check for udisks2 ***
+enable_udisks2 = get_option('enable-udisks2')
+have_udisks2 = false
+
+if enable_udisks2 != 'no'
+ udisks2_dep = dependency('udisks2', version: '>= 1.97', required: (enable_udisks2 == 'yes'))
+ have_udisks2 = udisks2_dep.found()
+endif
+
+config_h.set('HAVE_UDISKS2', have_udisks2)
+
+# *** Check for libsystemd-login ***
+enable_libsystemd_login = get_option('enable-libsystemd-login')
+have_libsystemd_login = false
+
+if enable_libsystemd_login != 'no'
+ libsystemd_login_dep = dependency('libsystemd', required: false)
+ if not libsystemd_login_dep.found()
+ libsystemd_login_dep = dependency('libsystemd-login', version: '>= 44', required:
(enable_libsystemd_login == 'yes'))
+ endif
+ have_libsystemd_login = libsystemd_login_dep.found()
+endif
+
+config_h.set('HAVE_LIBSYSTEMD_LOGIN', have_libsystemd_login)
+
+# *** Check if we should build with AFC backend ***
+enable_afc = get_option('enable-afc')
+have_afc = false
+
+if enable_afc != 'no'
+ required = (enable_afc == 'yes')
+
+ libimobiledevice_dep = dependency('libimobiledevice-1.0', version: '>= 1.2', required: required)
+ libplist_dep = dependency('libplist', version: '>= 0.15', required: required)
+
+ have_afc = libimobiledevice_dep.found() and libplist_dep.found()
+endif
+
+config_h.set('HAVE_AFC', have_afc)
+
+# *** Check if we should build with GOA volume monitor ***
+enable_goa = get_option('enable-goa')
+have_goa = false
+
+if enable_goa != 'no'
+ goa_dep = dependency('goa-1.0', version: '>= 3.17.1', required: (enable_goa == 'yes'))
+ have_goa = goa_dep.found()
+endif
+
+config_h.set('HAVE_GOA', have_goa)
+
+# *** Check for GNOME Keyring ***
+enable_keyring = get_option('enable-keyring')
+have_keyring = false
+
+if enable_keyring != 'no'
+ libsecret_dep = dependency('libsecret-unstable', required: (enable_keyring == 'yes'))
+ have_keyring = libsecret_dep.found()
+endif
+
+config_h.set('HAVE_KEYRING', have_keyring)
+
+# *** Check if we should build with libbluray ***
+enable_bluray = get_option('enable-bluray')
+have_bluray = false
+
+if enable_bluray != 'no'
+ libbluray_dep = dependency('libbluray', required: (enable_bluray == 'yes'))
+ have_bluray = libbluray_dep.found()
+endif
+
+config_h.set('HAVE_BLURAY', have_bluray)
+
+# *** Check if we should build with libusb-1.0 ***
+enable_libusb = get_option('enable-libusb')
+have_libusb = false
+
+if enable_libusb != 'no'
+ libusb_dep = dependency('libusb-1.0', version: '>= 1.0.21', required: (enable_libusb == 'yes'))
+ have_libusb = libusb_dep.found()
+endif
+
+config_h.set10('HAVE_LIBUSB', have_libusb)
+
+# *** Check for samba ***
+enable_samba = get_option('enable-samba')
+have_samba = false
+
+if enable_samba != 'no'
+ smbclient_dep = dependency('smbclient', required: (enable_samba == 'yes'))
+ have_samba = smbclient_dep.found()
+endif
+
+config_h.set('HAVE_SAMBA', have_samba)
+
+# *** Check for libarchive ***
+enable_archive = get_option('enable-archive')
+have_archive = false
+
+if enable_archive != 'no'
+ libarchive_dep = dependency('libarchive', required: (enable_archive == 'yes'))
+ have_archive = libarchive_dep.found()
+endif
+
+config_h.set('HAVE_ARCHIVE', have_archive)
+
+# *** Check if we should build with CDDA backend ***
+enable_cdda = get_option('enable-cdda')
+have_cdda = false
+
+if have_gudev and enable_cdda != 'no'
+ libcdio_paranoia_dep = dependency('libcdio_paranoia', version: '>= 0.78.2', required: (enable_cdda ==
'yes'))
+
+ have_cdda = libcdio_paranoia_dep.found()
+ config_h.set('HAVE_PARANOIA_NEW_INCLUDES', cc.has_header('cdio/paranoia/paranoia.h', dependencies:
libcdio_paranoia_dep))
+endif
+
+config_h.set('HAVE_CDDA', have_cdda)
+
+# *** Check if we should build with Google backend ***
+enable_google = get_option('enable-google')
+have_google = false
+
+if have_goa and enable_google != 'no'
+ libgdata_dep = dependency('libgdata', version: '>= 0.17.3', required: (enable_google == 'yes'))
+ have_google = libgdata_dep.found()
+ config_h.set10('HAVE_LIBGDATA_0_17_7', libgdata_dep.version().version_compare('>= 0.17.7'))
+endif
+
+config_h.set('HAVE_GOOGLE', have_google)
+
+# *** Check for gphoto2 ***
+enable_gphoto2 = get_option('enable-gphoto2')
+have_gphoto2 = false
+
+if enable_gphoto2 != 'no'
+ libgphoto2_dep = dependency('libgphoto2', version: '>= 2.4.0', required: (enable_gphoto2 == 'yes'))
+ have_gphoto2 = libgphoto2_dep.found()
+ config_h.set('HAVE_GPHOTO25', libgphoto2_dep.version().version_compare('>= 2.5.0'))
+
+ use_gphoto2 = host_machine.system().contains('linux') or host_machine.system().contains('bsd')
+endif
+
+config_h.set('HAVE_GPHOTO2', have_gphoto2)
+
+# *** Check for libmtp ***
+enable_libmtp = get_option('enable-libmtp')
+have_libmtp = false
+
+if have_gudev and enable_libmtp != 'no'
+ libmtp_dep = dependency('libmtp', version: '>= 1.1.0', required: (enable_libmtp == 'yes'))
+ have_libmtp = libmtp_dep.found()
+
+ config_h.set10('HAVE_LIBMTP_1_1_5', libmtp_dep.version().version_compare('>= 1.1.5'))
+ config_h.set10('HAVE_LIBMTP_1_1_6', libmtp_dep.version().version_compare('>= 1.1.6'))
+ config_h.set10('HAVE_LIBMTP_1_1_9', libmtp_dep.version().version_compare('>= 1.1.9'))
+ config_h.set10('HAVE_LIBMTP_1_1_12', libmtp_dep.version().version_compare('>= 1.1.12'))
+endif
+
+config_h.set('HAVE_LIBMTP', have_libmtp)
+
+# *** AFP backend ***
+have_afp = get_option('enable-afp')
+msg_afp = 'false'
+
+if have_afp
+ msg_afp = (have_gcrypt ? 'true' : 'partial (crypt support missing! Only anonymous logins)')
+endif
+
+# *** NFS backend ***
+enable_nfs = get_option('enable-nfs')
+have_nfs = false
+
+if enable_nfs != 'no'
+ libnfs_dep = dependency('libnfs', version: '>= 1.9.8', required: (enable_nfs == 'yes'))
+ have_nfs = libnfs_dep.found()
+endif
+
+config_h.set('HAVE_NFS', have_nfs)
+
+configure_file(
+ output: 'config.h',
+ configuration: config_h
+)
+
+gnome = import('gnome')
+i18n = import('i18n')
+pkg = import('pkgconfig')
+
+service_conf = configuration_data()
+service_conf.set('libexecdir', gvfs_libexecdir)
+
+po_dir = join_paths(meson.source_root(), 'po')
+
+top_inc = include_directories('.')
+
+subdir('common')
+subdir('metadata')
+subdir('client')
+subdir('daemon')
+subdir('monitor')
+subdir('po')
+subdir('programs')
+
+if get_option('enable-man')
+ subdir('man')
+endif
+
+# installed tests
+enable_installed_tests = get_option('enable-installed-tests')
+if enable_installed_tests
+ subdir('test')
+endif
+
+meson.add_install_script('meson_post_install.py')
+
+output = '\ngvfs configuration summary:\n\n'
+output += ' gio module directory: ' + gio_module_dir + '\n\n'
+output += ' Blu-ray metadata support: ' + have_bluray.to_string() + '\n'
+output += ' Google support: ' + have_google.to_string() + '\n'
+output += ' HTTP/WebDAV support: ' + have_http.to_string() + '\n'
+output += ' Samba support: ' + have_samba.to_string() + '\n'
+output += ' FUSE support: ' + have_fuse.to_string() + '\n'
+output += ' CDDA support: ' + have_cdda.to_string() + '\n'
+output += ' Gphoto2 support: ' + have_gphoto2.to_string() + '\n'
+output += ' MTP support: ' + have_libmtp.to_string() + '\n'
+output += ' Polkit support: ' + have_admin.to_string() + '\n'
+output += ' USB support: ' + have_libusb.to_string() + '\n'
+output += ' archive support: ' + have_archive.to_string() + '\n'
+output += ' AFC support: ' + have_afc.to_string() + '\n'
+output += ' AFP support: ' + msg_afp + '\n'
+output += ' NFS support: ' + have_nfs.to_string() + '\n'
+output += ' DNS-SD support: ' + have_avahi.to_string() + '\n'
+output += ' Build GDU volume monitor: ' + have_gdu.to_string() + '\n'
+output += ' Build udisks2 volume monitor: ' + have_udisks2.to_string() + '\n'
+output += ' Build GOA volume monitor: ' + have_goa.to_string() + '\n'
+output += ' Use systemd user unit: ' + have_systemd_user_unit.to_string() + '\n'
+output += ' Use libsystemd-login: ' + have_libsystemd_login.to_string() + '\n'
+output += ' Use GCR: ' + have_gcr.to_string() + '\n'
+output += ' GNOME Keyring support: ' + have_keyring.to_string() + '\n'
+output += ' Installed tests: ' + enable_installed_tests.to_string()
+message(output)
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..32002e5
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,27 @@
+option('with-dbus-service-dir', type: 'string', value: '', description: 'choose directory for dbus service
files [default=PREFIX/share/dbus-1/services]')
+option('with-systemduserunitdir', type: 'string', value: '', description: 'choose directory for systemd user
units, or \'no\' to disable [default=PREFIX/lib/systemd/user]')
+option('enable-gcr', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build with
gcr')
+option('enable-admin', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with admin backend')
+option('enable-http', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build with
http/dav backend')
+option('enable-avahi', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with avahi backend')
+option('enable-udev', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build with
libudev')
+option('enable-gudev', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with gudev support')
+option('enable-fuse', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build with
FUSE support')
+option('enable-gdu', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build with
GDU volume monitor')
+option('enable-udisks2', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with libudisks2')
+option('enable-libsystemd-login', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description:
'build with libsystemd-login')
+option('enable-afc', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build with
AFC backend')
+option('enable-goa', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build with
GOA volume monitor')
+option('enable-keyring', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with GNOME Keyring support')
+option('enable-bluray', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with bluray metadata support')
+option('enable-libusb', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with libusb support')
+option('enable-samba', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with samba support')
+option('enable-archive', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with archive support')
+option('enable-nfs', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build with
NFS support')
+option('enable-cdda', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build with
CDDA backend')
+option('enable-google', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with Google backend')
+option('enable-gphoto2', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with gphoto2 support')
+option('enable-libmtp', type: 'combo', choices: ['yes', 'no', 'auto'], value: 'auto', description: 'build
with libmtp support')
+option('enable-afp', type: 'boolean', value: true, description: 'build with AFP support')
+option('enable-man', type: 'boolean', value: false, description: 'generate man pages')
+option('enable-installed-tests', type: 'boolean', value: false, description: 'enable installed unit tests')
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 0000000..5ea9cbd
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+import os
+import subprocess
+
+install_prefix = os.environ['MESON_INSTALL_PREFIX']
+schemadir = os.path.join(install_prefix, 'share', 'glib-2.0', 'schemas')
+giomoduledir = os.path.join(install_prefix, 'lib', 'gio', 'modules')
+
+if not os.environ.get('DESTDIR'):
+ print('Compiling gsettings schemas...')
+ subprocess.call(['glib-compile-schemas', schemadir])
+
+ print('GIO module cache creation...')
+ subprocess.call(['gio-querymodules', giomoduledir])
diff --git a/metadata/meson.build b/metadata/meson.build
new file mode 100644
index 0000000..3bca1c8
--- /dev/null
+++ b/metadata/meson.build
@@ -0,0 +1,99 @@
+service = 'org.gtk.vfs.Metadata.service'
+
+metadata_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-metadata.service'
+
+ configure_file(
+ input: service + '.in',
+ output: service,
+ install: true,
+ install_dir: systemd_user_dir,
+ configuration: service_conf
+ )
+endif
+
+name = 'dbus-interface'
+
+metadata_dbus = gnome.gdbus_codegen(
+ 'metadata-dbus',
+ name + '.xml',
+ interface_prefix: gvfs_namespace + '.',
+ namespace: 'GVfs'
+)
+
+sources = files(
+ 'crc32.c',
+ 'metabuilder.c',
+ 'metatree.c'
+)
+
+cflags = [
+ '-DDBUS_API_SUBJECT_TO_CHANGE',
+ '-DG_LOG_DOMAIN="@0@"'.format(meson.project_name().to_upper()),
+ '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir)
+]
+
+libmetadata = static_library(
+ 'metadata',
+ sources: sources + [metadata_dbus],
+ include_directories: [top_inc, common_inc],
+ dependencies: glib_deps,
+ c_args: cflags,
+ pic: true
+)
+
+libmetadata_dep = declare_dependency(
+ link_with: libmetadata,
+ include_directories: include_directories('.')
+)
+
+apps = [
+ 'meta-ls',
+ 'meta-get',
+ 'meta-set',
+ 'meta-get-tree'
+]
+
+foreach app: apps
+ executable(
+ app,
+ app + '.c',
+ include_directories: top_inc,
+ dependencies: glib_deps + [libgvfscommon_dep],
+ c_args: cflags,
+ link_with: libmetadata
+ )
+endforeach
+
+if have_libxml
+ executable(
+ 'convert-nautilus-metadata',
+ 'metadata-nautilus.c',
+ include_directories: top_inc,
+ dependencies: glib_deps + [libxml_dep],
+ c_args: cflags,
+ link_with: libmetadata
+ )
+endif
+
+executable(
+ 'gvfsd-metadata',
+ 'meta-daemon.c',
+ include_directories: top_inc,
+ dependencies: glib_deps + [
+ libgvfscommon_dep,
+ libudev_dep
+ ],
+ c_args: cflags,
+ link_with: libmetadata,
+ install: true,
+ install_dir: gvfs_libexecdir
+)
diff --git a/monitor/afc/meson.build b/monitor/afc/meson.build
new file mode 100644
index 0000000..cbc985c
--- /dev/null
+++ b/monitor/afc/meson.build
@@ -0,0 +1,57 @@
+afc_monitor = files('afc.monitor')
+
+install_data(
+ afc_monitor,
+ install_dir: gvfs_remote_volume_monitors_dir
+)
+
+service = 'org.gtk.vfs.AfcVolumeMonitor.service'
+
+afc_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-afc-volume-monitor.service'
+
+ configure_file(
+ input: service + '.in',
+ output: service,
+ install: true,
+ install_dir: systemd_user_dir,
+ configuration: service_conf
+ )
+endif
+
+sources = files(
+ 'afcvolumemonitordaemon.c',
+ 'afcvolume.c',
+ 'afcvolumemonitor.c'
+)
+
+deps = glib_deps + [
+ libimobiledevice_dep,
+ libplist_dep,
+ libgvfscommon_dep,
+ libgvfsproxyvolumemonitordaemon_noin_dep
+]
+
+cflags = [
+ '-DG_LOG_DOMAIN="GVFS-AFC"',
+ '-DGIO_MODULE_DIR="@0@"'.format(gio_module_dir),
+ '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir)
+]
+
+executable(
+ 'gvfs-afc-volume-monitor',
+ sources,
+ include_directories: top_inc,
+ dependencies: deps,
+ c_args: cflags,
+ install: true,
+ install_dir: gvfs_libexecdir
+)
diff --git a/monitor/gdu/meson.build b/monitor/gdu/meson.build
new file mode 100644
index 0000000..516b27d
--- /dev/null
+++ b/monitor/gdu/meson.build
@@ -0,0 +1,59 @@
+gdu_monitor = files('gdu.monitor')
+
+install_data(
+ gdu_monitor,
+ install_dir: gvfs_remote_volume_monitors_dir
+)
+
+gdu_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-gdu-volume-monitor.service'
+
+ configure_file(
+ input: service + '.in',
+ output: service,
+ install: true,
+ install_dir: systemd_user_dir,
+ configuration: service_conf
+ )
+endif
+
+sources = files(
+ 'gdu-volume-monitor-daemon.c',
+ 'ggdudrive.c',
+ 'ggdumount.c',
+ 'ggduvolume.c',
+ 'ggduvolumemonitor.c'
+)
+
+deps = glib_deps + [
+ gdu_dep,
+ gudev_dep,
+ libgvfscommon_dep,
+ libgvfscommon_monitor_dep,
+ libgvfsproxyvolumemonitordaemon_noin_dep
+]
+
+cflags = [
+ '-DG_LOG_DOMAIN="GVFS-Gdu"',
+ '-DGDU_API_IS_SUBJECT_TO_CHANGE',
+ '-DGIO_MODULE_DIR="@0@"'.format(gio_modules_dir),
+ '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir)
+]
+
+executable(
+ 'gvfs-gdu-volume-monitor',
+ sources,
+ include_directories: top_inc,
+ dependencies: deps,
+ c_args: cflags,
+ install: true,
+ install_dir: gvfs_libexecdir
+)
diff --git a/monitor/goa/meson.build b/monitor/goa/meson.build
new file mode 100644
index 0000000..e93d0a8
--- /dev/null
+++ b/monitor/goa/meson.build
@@ -0,0 +1,54 @@
+install_data(
+ 'goa.monitor',
+ install_dir: gvfs_remote_volume_monitors_dir
+)
+
+service = 'org.gtk.vfs.GoaVolumeMonitor.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-goa-volume-monitor.service'
+
+ configure_file(
+ input: service + '.in',
+ output: service,
+ install: true,
+ install_dir: systemd_user_dir,
+ configuration: service_conf
+ )
+endif
+
+sources = files(
+ 'goavolumemonitordaemon.c',
+ 'goavolume.c',
+ 'goavolumemonitor.c'
+)
+
+deps = glib_deps + [
+ goa_dep,
+ libgvfscommon_dep,
+ libgvfsproxyvolumemonitordaemon_noin_dep
+]
+
+cflags = [
+ '-DG_LOG_DOMAIN="GVFS-GOA"',
+ '-DGIO_MODULE_DIR="@0@"'.format(gio_module_dir),
+ '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir)
+]
+
+executable(
+ 'gvfs-goa-volume-monitor',
+ sources,
+ include_directories: top_inc,
+ dependencies: deps,
+ c_args: cflags,
+ install: true,
+ install_dir: gvfs_libexecdir
+)
diff --git a/monitor/gphoto2/meson.build b/monitor/gphoto2/meson.build
new file mode 100644
index 0000000..569b480
--- /dev/null
+++ b/monitor/gphoto2/meson.build
@@ -0,0 +1,58 @@
+gphoto2_monitor = files('gphoto2.monitor')
+
+install_data(
+ gphoto2_monitor,
+ install_dir: gvfs_remote_volume_monitors_dir
+)
+
+service = 'org.gtk.vfs.GPhoto2VolumeMonitor.service'
+
+gphoto2_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-gphoto2-volume-monitor.service'
+
+ configure_file(
+ input: service + '.in',
+ output: service,
+ install: true,
+ install_dir: systemd_user_dir,
+ configuration: service_conf
+ )
+endif
+
+sources = files(
+ 'gphoto2-volume-monitor-daemon.c',
+ 'ggphoto2volume.c',
+ 'ggphoto2volumemonitor.c'
+)
+
+deps = glib_deps + [
+ libgphoto2_dep,
+ gudev_dep,
+ libgvfscommon_dep,
+ libgvfscommon_gphoto2_dep,
+ libgvfsproxyvolumemonitordaemon_noin_dep
+]
+
+cflags = [
+ '-DG_LOG_DOMAIN="GVFS-GPhoto2"',
+ '-DGIO_MODULE_DIR="@0@"'.format(gio_module_dir),
+ '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir)
+]
+
+executable(
+ 'gvfs-gphoto2-volume-monitor',
+ sources,
+ include_directories: top_inc,
+ dependencies: deps,
+ c_args: cflags,
+ install: true,
+ install_dir: gvfs_libexecdir
+)
diff --git a/monitor/meson.build b/monitor/meson.build
new file mode 100644
index 0000000..1674990
--- /dev/null
+++ b/monitor/meson.build
@@ -0,0 +1,25 @@
+subdir('proxy')
+
+if have_gdu
+ subdir('gdu')
+endif
+
+if have_udisks2
+ subdir('udisks2')
+endif
+
+if have_gphoto2
+ subdir('gphoto2')
+endif
+
+if have_afc
+ subdir('afc')
+endif
+
+if have_libmtp
+ subdir('mtp')
+endif
+
+if have_goa
+ subdir('goa')
+endif
diff --git a/monitor/mtp/meson.build b/monitor/mtp/meson.build
new file mode 100644
index 0000000..eb2c3e4
--- /dev/null
+++ b/monitor/mtp/meson.build
@@ -0,0 +1,55 @@
+install_data(
+ 'mtp.monitor',
+ install_dir: gvfs_remote_volume_monitors_dir
+)
+
+service = 'org.gtk.vfs.MTPVolumeMonitor.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-mtp-volume-monitor.service'
+
+ configure_file(
+ input: service + '.in',
+ output: service,
+ install: true,
+ install_dir: systemd_user_dir,
+ configuration: service_conf
+ )
+endif
+
+sources = files(
+ 'mtp-volume-monitor-daemon.c',
+ 'gmtpvolume.c',
+ 'gmtpvolumemonitor.c'
+)
+
+deps = glib_deps + [
+ gudev_dep,
+ libgvfscommon_dep,
+ libgvfscommon_gphoto2_dep,
+ libgvfsproxyvolumemonitordaemon_noin_dep
+]
+
+cflags = [
+ '-DG_LOG_DOMAIN="GVFS-MTP"',
+ '-DGIO_MODULE_DIR="@0@"'.format(gio_module_dir),
+ '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir)
+]
+
+executable(
+ 'gvfs-mtp-volume-monitor',
+ sources,
+ include_directories: top_inc,
+ dependencies: deps,
+ c_args: cflags,
+ install: true,
+ install_dir: gvfs_libexecdir
+)
diff --git a/monitor/proxy/meson.build b/monitor/proxy/meson.build
new file mode 100644
index 0000000..8856673
--- /dev/null
+++ b/monitor/proxy/meson.build
@@ -0,0 +1,64 @@
+dbus_sources = gnome.gdbus_codegen(
+ 'gvfsvolumemonitordbus',
+ 'dbus-interfaces.xml',
+ interface_prefix: 'org.gtk.Private.',
+ namespace: 'GVfs'
+)
+
+sources = files(
+ 'remote-volume-monitor-module.c',
+ 'gproxydrive.c',
+ 'gproxymount.c',
+ 'gproxymountoperation.c',
+ 'gproxyshadowmount.c',
+ 'gproxyvolume.c',
+ 'gproxyvolumemonitor.c'
+)
+
+deps = glib_deps + [libgvfscommon_dep]
+
+cflags = [
+ '-DG_LOG_DOMAIN="GVFS-RemoveVolumeMonitor"',
+ '-DGIO_MODULE_DIR="@0@"'.format(gio_module_dir),
+ '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir),
+ '-DREMOTE_VOLUME_MONITORS_DIR="@0@"'.format(gvfs_remote_volume_monitors_dir)
+]
+
+symbol_map = 'symbol.map'
+
+ldflags = []
+if have_version_script
+ ldflags += '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), symbol_map)
+endif
+
+libgioremove_volume_monitor = shared_module(
+ 'gioremote-volume-monitor',
+ sources: sources + [dbus_sources],
+ include_directories: top_inc,
+ dependencies: deps,
+ c_args: cflags,
+ link_args: ldflags,
+ link_depends: symbol_map,
+ install: true,
+ install_dir: gio_module_dir
+)
+
+sources = files('gvfsproxyvolumemonitordaemon.c')
+
+cflags = [
+ '-DG_LOG_DOMAIN="GVFS-RemoteVolumeMonitorDaemon"',
+ '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir)
+]
+
+libgvfsproxyvolumemonitordaemon_noin = static_library(
+ 'gvfsproxyvolumemonitordaemon-noin',
+ sources: sources + [dbus_sources],
+ include_directories: top_inc,
+ dependencies: deps,
+ c_args: cflags
+)
+
+libgvfsproxyvolumemonitordaemon_noin_dep = declare_dependency(
+ link_with: libgvfsproxyvolumemonitordaemon_noin,
+ include_directories: include_directories('.')
+)
diff --git a/monitor/proxy/symbol.map b/monitor/proxy/symbol.map
new file mode 100644
index 0000000..451e539
--- /dev/null
+++ b/monitor/proxy/symbol.map
@@ -0,0 +1,8 @@
+{
+global:
+ g_io_module_load;
+ g_io_module_unload;
+ g_io_module_query;
+local:
+ *;
+};
diff --git a/monitor/udisks2/meson.build b/monitor/udisks2/meson.build
new file mode 100644
index 0000000..df30600
--- /dev/null
+++ b/monitor/udisks2/meson.build
@@ -0,0 +1,71 @@
+udisks2_monitor = files('udisks2.monitor')
+
+install_data(
+ udisks2_monitor,
+ install_dir: gvfs_remote_volume_monitors_dir
+)
+
+service = 'org.gtk.vfs.UDisks2VolumeMonitor.service'
+
+udisks2_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-udisks2-volume-monitor.service'
+
+ configure_file(
+ input: service + '.in',
+ output: service,
+ install: true,
+ install_dir: systemd_user_dir,
+ configuration: service_conf
+ )
+endif
+
+sources = files(
+ 'udisks2volumemonitordaemon.c',
+ 'gvfsudisks2drive.c',
+ 'gvfsudisks2mount.c',
+ 'gvfsudisks2utils.c',
+ 'gvfsudisks2volume.c',
+ 'gvfsudisks2volumemonitor.c'
+)
+
+deps = glib_deps + [
+ udisks2_dep,
+ gudev_dep,
+ libgvfscommon_dep,
+ libgvfscommon_monitor_dep,
+ libgvfsproxyvolumemonitordaemon_noin_dep
+]
+
+if have_libsystemd_login
+ deps += libsystemd_login_dep
+endif
+
+if have_keyring
+ deps += libsecret_dep
+endif
+
+cflags = [
+ '-DG_LOG_DOMAIN="GVFS-UDisks2"',
+ '-DG_DISABLE_DEPRECATED',
+ '-DGIO_MODULE_DIR="@0@"'.format(gio_module_dir),
+ '-DGVFS_LOCALEDIR="@0@"'.format(gvfs_localedir),
+ '-DUDISKS_API_IS_SUBJECT_TO_CHANGE'
+]
+
+executable(
+ 'gvfs-udisks2-volume-monitor',
+ sources,
+ include_directories: top_inc,
+ dependencies: deps,
+ c_args: cflags,
+ install: true,
+ install_dir: gvfs_libexecdir
+)
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..e9b77d7
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext(meson.project_name(), preset: 'glib')
diff --git a/programs/deprecated.in b/programs/deprecated.in
old mode 100644
new mode 100755
diff --git a/programs/meson.build b/programs/meson.build
new file mode 100644
index 0000000..1dea6b7
--- /dev/null
+++ b/programs/meson.build
@@ -0,0 +1,37 @@
+script_names = [
+ ['mount', 'mount'],
+ ['cat', 'cat'],
+ ['open', 'open'],
+ ['save', 'save'],
+ ['ls', 'list'],
+ ['tree', 'tree'],
+ ['info', 'info'],
+ ['set-attribute', 'set'],
+ ['trash', 'trash'],
+ ['rename', 'rename'],
+ ['rm', 'remove'],
+ ['copy', 'copy'],
+ ['move', 'move'],
+ ['monitor-file', 'monitor'],
+ ['monitor-dir', 'monitor'],
+ ['mkdir', 'mkdir'],
+ ['mime', 'mime']
+]
+
+foreach name: script_names
+ conf = configuration_data()
+ conf.set('command', name[1])
+
+ configure_file(
+ input: 'deprecated.in',
+ output: 'gvfs-' + name[0],
+ install: true,
+ install_dir: gvfs_bindir,
+ configuration: conf
+ )
+endforeach
+
+install_data(
+ 'gvfs-less',
+ install_dir: gvfs_bindir
+)
diff --git a/test/gvfs-all-tests.in b/test/gvfs-all-tests.in
new file mode 100644
index 0000000..9bb619f
--- /dev/null
+++ b/test/gvfs-all-tests.in
@@ -0,0 +1,4 @@
+[Test]
+Type=session
+Exec=@installed_testdir@/gvfs-test
+Output=TAP
diff --git a/test/meson.build b/test/meson.build
new file mode 100644
index 0000000..93d163d
--- /dev/null
+++ b/test/meson.build
@@ -0,0 +1,94 @@
+installed_test_metadir = join_paths(gvfs_datadir, 'installed-tests', meson.project_name())
+installed_testdir = join_paths(gvfs_libexecdir, 'installed-tests', meson.project_name())
+
+session_conf = configuration_data()
+session_conf.set('testdir', installed_testdir)
+
+session = 'session.conf'
+
+configure_file(
+ input: session + '.in',
+ output: session,
+ install: true,
+ install_dir: installed_testdir,
+ configuration: session_conf
+)
+
+all_tests_conf = configuration_data()
+all_tests_conf.set('installed_testdir', installed_testdir)
+
+all_tests = 'gvfs-all-tests'
+
+configure_file(
+ input: all_tests + '.in',
+ output: all_tests + '.test',
+ install: true,
+ install_dir: installed_test_metadir,
+ configuration: all_tests_conf
+)
+
+install_subdir(
+ 'files',
+ install_dir: installed_testdir
+)
+
+test_data = [
+ 'gvfs-test',
+ daemon_service,
+ metadata_service
+]
+
+if have_afc
+ test_data += [afc_monitor, afc_service]
+endif
+
+if have_gdu
+ test_data += [gdu_monitor, gdu_service]
+endif
+
+if have_gphoto2
+ test_data += [gphoto2_monitor, gphoto2_service]
+endif
+
+if have_udisks2
+ test_data += [udisks2_monitor, udisks2_service]
+endif
+
+install_data(
+ test_data,
+ install_dir: installed_testdir
+)
+
+test_units = [
+ 'benchmark-gvfs-big-files',
+ 'benchmark-gvfs-small-files',
+ 'benchmark-posix-big-files',
+ 'benchmark-posix-small-files',
+ 'test-query-info-stream'
+]
+
+foreach unit: test_units
+ exe = executable(
+ unit,
+ unit + '.c',
+ include_directories: top_inc,
+ dependencies: glib_deps
+ )
+
+ test(unit, exe)
+endforeach
+
+'''
+# run tests against build tree
+check: $(CONFIG_FILES) gvfs-test
+ $(srcdir)/run-in-tree.sh $(srcdir)/gvfs-test $(TEST_NAMES)
+
+# run tests against the installed system packages
+# when running as root, use gvfs-testbed to enable all tests
+installcheck-local: gvfs-test
+ if [ `id -u` = 0 ]; then \
+ $(srcdir)/gvfs-testbed $(srcdir)/gvfs-test $(TEST_NAMES); \
+ else \
+ $(srcdir)/gvfs-test $(TEST_NAMES); \
+ fi
+'''
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]