Commit 3aade670 authored by Max Kellermann's avatar Max Kellermann

basic udisks2 support

To get udisks2 support started, this commit contains the configure.ac option and a "neighbor" plugin which shows block devices. Later, this will allow mounting removable media with a new storage plugin.
parent dc111bbe
......@@ -835,6 +835,7 @@ libneighbor_a_SOURCES = \
src/neighbor/NeighborPlugin.hxx
libneighbor_a_CPPFLAGS = $(AM_CPPFLAGS) \
$(DBUS_CFLAGS) \
$(UPNP_CFLAGS) \
$(SMBCLIENT_CFLAGS)
......@@ -857,6 +858,15 @@ NEIGHBOR_LIBS += \
$(UPNP_LIBS)
endif
if ENABLE_UDISKS
libneighbor_a_SOURCES += \
$(UDISKS_SOURCES) \
src/neighbor/plugins/UdisksNeighborPlugin.cxx src/neighbor/plugins/UdisksNeighborPlugin.hxx
NEIGHBOR_LIBS += \
$(DBUS_LIBS) \
libodbus.a
endif
endif
# database plugins
......
......@@ -632,6 +632,15 @@ dnl ---------------------------------------------------------------------------
MPD_ENABLE_AUTO_PKG(dbus, DBUS, [dbus-1], [D-Bus support], [dbus-1 not found])
AC_ARG_ENABLE(udisks,
AS_HELP_STRING([--enable-udisks],
[support for removable media via udisks2]),,
[enable_udisks=auto])
MPD_DEPENDS([enable_udisks], [found_dbus], [support for removable media via udisks2], [dbus-1 not found])
MPD_AUTO(udisks, [support for removable media via udisks2], [udisks not available], [found_udisks=yes])
MPD_DEFINE_CONDITIONAL(enable_udisks, ENABLE_UDISKS, [support for removable media via udisks2])
dnl ---------------------------------------------------------------------------
dnl Metadata Plugins
dnl ---------------------------------------------------------------------------
......@@ -799,6 +808,9 @@ if test x$enable_neighbor_plugins = xauto; then
if test x$enable_upnp = xyes; then
enable_neighbor_plugins=yes
fi
if test x$enable_udisks = xyes; then
enable_neighbor_plugins=yes
fi
fi
MPD_DEFINE_CONDITIONAL(enable_neighbor_plugins, ENABLE_NEIGHBOR_PLUGINS,
......@@ -1508,6 +1520,7 @@ results(libmpdclient, [libmpdclient])
results(inotify, [inotify])
results(sqlite, [SQLite])
results(dbus, [DBUS])
results(udisks, [UDISKS])
printf '\nMetadata support:\n\t'
results(id3,[ID3])
......
......@@ -226,6 +226,9 @@ static void version(void)
#ifdef ENABLE_DBUS
" dbus"
#endif
#ifdef ENABLE_UDISKS
" udisks"
#endif
#ifdef USE_EPOLL
" epoll"
#endif
......
......@@ -22,6 +22,7 @@
#include "NeighborPlugin.hxx"
#include "plugins/SmbclientNeighborPlugin.hxx"
#include "plugins/UpnpNeighborPlugin.hxx"
#include "plugins/UdisksNeighborPlugin.hxx"
#include <string.h>
......@@ -32,6 +33,9 @@ const NeighborPlugin *const neighbor_plugins[] = {
#ifdef ENABLE_UPNP
&upnp_neighbor_plugin,
#endif
#ifdef ENABLE_UDISKS
&udisks_neighbor_plugin,
#endif
nullptr
};
......
/*
* Copyright 2003-2018 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_NEIGHBOR_UDISKS_HXX
#define MPD_NEIGHBOR_UDISKS_HXX
struct NeighborPlugin;
extern const NeighborPlugin udisks_neighbor_plugin;
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment