Skip to content

Commit

Permalink
Merge branch 'move-plugin-libs'
Browse files Browse the repository at this point in the history
* move-plugin-libs:
  SFI: glib-extra.cc: load plugins and drivers from .libs/ if present
  SFI: glib-extra.cc: adjust INSTALLPATH_BSELIBDIR_PLUGINS and INSTALLPATH_BSELIBDIR_DRIVERS
  DRIVERS: install under $(beastdatadir)/drivers/
  PLUGINS: install under $(beastdatadir)/plugins/

Signed-off-by: Tim Janik <[email protected]>
  • Loading branch information
tim-janik committed Mar 4, 2018
2 parents 70bac7b + 9b7d923 commit bbb360f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DEFS += @DEFINE__FILE_DIR__@ $(strip -DG_LOG_DOMAIN=\"BSE-ALSA\") -DBSE_P
AM_CXXFLAGS += $(BSE_CFLAGS) $(RAPICORN_CFLAGS) -DBSE_CONVENIENCE

# Plugin bsedevice-alsa
driversdir = $(bselibdir)/drivers
driversdir = $(beastdatadir)/drivers
drivers_LTLIBRARIES = bsepcmdevice-alsa.la bsemididevice-alsa.la
drivers_ldflags = -avoid-version
drivers_libs = ../bse/libbse-@[email protected] $(SFI_LIBS)
Expand Down
2 changes: 1 addition & 1 deletion plugins/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ plugins_built_sources =
CLEANFILES += $(plugins_built_sources)
# .FPU plugins
plugin_FPU_LTLIBRARIES = cxxplugins.FPU.la
plugin_FPUdir = $(bselibdir)/plugins
plugin_FPUdir = $(beastdatadir)/plugins
FPU_PLUGIN_CFLAGS = $(AM_CFLAGS) $(PLUGIN_FLAGS) $(FPU_FLAGS)
FPU_PLUGIN_CXXFLAGS = $(AM_CXXFLAGS) $(PLUGIN_FLAGS) $(FPU_FLAGS)

Expand Down
2 changes: 1 addition & 1 deletion plugins/evaluator/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ include $(top_srcdir)/Makefile.decl
#AM_CPPFLAGS += -DBSE_PLUGIN_FALLBACK="\"$(strip $(basename $(<F)))\""
#
## install plugins under:
#plugindir = $(bselibdir)/plugins
#plugindir = $(beastdatadir)/plugins
#
## setup generation of C++ plugins from idl files
#SFIDL = ../../sfi/sfidl
Expand Down
2 changes: 1 addition & 1 deletion plugins/freeverb/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DEFS += @DEFINE__FILE_DIR__@ -DG_LOG_DOMAIN="\"$(strip $(basename $(<F)))
AM_CXXFLAGS += $(BSE_CFLAGS) $(RAPICORN_CFLAGS) -DBSE_CONVENIENCE

# install plugins under:
plugindir = $(bselibdir)/plugins
plugindir = $(beastdatadir)/plugins

freeverb_la_SOURCES = allpass.cpp comb.cpp revmodel.cpp bsefreeverbcpp.cpp bsefreeverb.cc
freeverb_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version
Expand Down
16 changes: 13 additions & 3 deletions sfi/glib-extra.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "bcore.hh"
#include <string.h>
#include <libintl.h>
#include <sys/stat.h>

void
g_object_disconnect_any (gpointer object,
Expand Down Expand Up @@ -1039,11 +1040,20 @@ installpath_override (const String &topdir)
installpath_topdir = topdir;
}

static std::string
append_objdir (const std::string &path) // return path/.libs if it exists
{
const std::string path_libs = path + "/" + CONFIGURE_INSTALLPATH_OBJDIR;
struct stat sbuf = { 0, };
if (stat (path_libs.c_str(), &sbuf) == 0)
return path_libs;
return path;
}

std::string
installpath (InstallpathType installpath_type)
{
const bool ovr = !installpath_topdir.empty();
const std::string _libs = ovr ? std::string ("/") + CONFIGURE_INSTALLPATH_OBJDIR : "";
switch (installpath_type)
{
case INSTALLPATH_BSEINCLUDEDIR: return CONFIGURE_INSTALLPATH_BSEINCLUDEDIR;
Expand All @@ -1053,8 +1063,8 @@ installpath (InstallpathType installpath_type)
case INSTALLPATH_DOCDIR: return CONFIGURE_INSTALLPATH_DOCDIR;
case INSTALLPATH_USER_DATA: return CONFIGURE_INSTALLPATH_USER_DATA;
case INSTALLPATH_BSELIBDIR: return ovr ? installpath_topdir : CONFIGURE_INSTALLPATH_BSELIBDIR;
case INSTALLPATH_BSELIBDIR_PLUGINS: return installpath (INSTALLPATH_BSELIBDIR) + "/plugins" + _libs;
case INSTALLPATH_BSELIBDIR_DRIVERS: return installpath (INSTALLPATH_BSELIBDIR) + "/drivers" + _libs;
case INSTALLPATH_BSELIBDIR_PLUGINS: return append_objdir (installpath (INSTALLPATH_DATADIR) + "/plugins");
case INSTALLPATH_BSELIBDIR_DRIVERS: return append_objdir (installpath (INSTALLPATH_DATADIR) + "/drivers");
case INSTALLPATH_DATADIR: return ovr ? installpath_topdir : CONFIGURE_INSTALLPATH_DATADIR;
case INSTALLPATH_DATADIR_DEMO: return installpath (INSTALLPATH_DATADIR) + "/Demos";
case INSTALLPATH_DATADIR_SAMPLES: return installpath (INSTALLPATH_DATADIR) + "/Samples";
Expand Down

0 comments on commit bbb360f

Please sign in to comment.