Browse Source

Add final steps for carla-vst via wine

tags/v2.1-alpha1-winvst
falkTX 6 years ago
parent
commit
61c78d5745
4 changed files with 47 additions and 9 deletions
  1. +6
    -0
      Makefile
  2. +29
    -2
      source/plugin/Makefile
  3. +3
    -0
      source/plugin/carla-vst-export.def
  4. +9
    -7
      source/plugin/carla-vst.cpp

+ 6
- 0
Makefile View File

@@ -113,6 +113,9 @@ else
$(error Trying to build Windows binaries with a regular toolchain, this cannot work) $(error Trying to build Windows binaries with a regular toolchain, this cannot work)
endif endif


$(MODULEDIR)/dgl.wine.a: .FORCE
@$(MAKE) -C source/modules/dgl wine

$(MODULEDIR)/%.a: .FORCE $(MODULEDIR)/%.a: .FORCE
@$(MAKE) -C source/modules/$* @$(MAKE) -C source/modules/$*


@@ -146,6 +149,9 @@ libjack: libs
plugin: backend bridges-plugin bridges-ui discovery plugin: backend bridges-plugin bridges-ui discovery
@$(MAKE) -C source/plugin @$(MAKE) -C source/plugin


plugin-wine: $(MODULEDIR)/dgl.wine.a
@$(MAKE) -C source/plugin wine

rest: libs rest: libs
@$(MAKE) -C source/rest @$(MAKE) -C source/rest




+ 29
- 2
source/plugin/Makefile View File

@@ -87,10 +87,19 @@ SYMBOLS_VST = # TODO
endif endif


# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------
# ...
# Other libs


LIBS_ui = $(MODULEDIR)/water.a LIBS_ui = $(MODULEDIR)/water.a


LIBS_wine = $(MODULEDIR)/dgl.wine.a
LIBS_wine += $(MODULEDIR)/water.files.a

WINE_LINK_FLAGS = $(LINK_FLAGS)
WINE_LINK_FLAGS += -L$(BINDIR) -lcarla_native-plugin
WINE_LINK_FLAGS += -lstdc++ -lopengl32 -lgdi32
WINE_LINK_FLAGS += -Wl,-rpath,/usr/local/lib/carla
WINE_LINK_FLAGS += -Wl,-rpath,/usr/lib/carla

# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------


TARGETS = \ TARGETS = \
@@ -127,6 +136,10 @@ endif


all: $(TARGETS) all: $(TARGETS)


ifneq ($(WIN32),true)
wine: $(BINDIR)/CarlaVstShell.dll
endif

# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------


clean: clean:
@@ -193,9 +206,16 @@ $(BINDIR)/CarlaPatchbayFX$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.patchbay-fx.o $(OBJ
@echo "Linking CarlaPatchbayFX$(LIB_EXT)" @echo "Linking CarlaPatchbayFX$(LIB_EXT)"
@$(CXX) $^ $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@ @$(CXX) $^ $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@


$(BINDIR)/CarlaVstShell$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.shell.o $(OBJDIR)/carla-vst-export.cpp.o
ifneq ($(WIN32),true)
$(BINDIR)/CarlaVstShell.dll: $(OBJDIR)/carla-vst.cpp.shell.o $(OBJDIR)/carla-vst-export.cpp.dll.o carla-vst-export.def
-@mkdir -p $(BINDIR) -@mkdir -p $(BINDIR)
@echo "Linking CarlaRackVstShell$(LIB_EXT)" @echo "Linking CarlaRackVstShell$(LIB_EXT)"
@$(WINECC) $^ $(LIBS_START) $(LIBS_wine) $(LIBS_END) $(SHARED) $(WINE_LINK_FLAGS) -o $@
endif

$(BINDIR)/CarlaVstShell$(LIB_EXT): $(OBJDIR)/carla-vst.cpp.shell.o $(OBJDIR)/carla-vst-export.cpp.o
-@mkdir -p $(BINDIR)
@echo "Linking CarlaVstShell$(LIB_EXT)"
@$(CXX) $^ $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@ @$(CXX) $^ $(LIBS_START) $(LIBS) $(LIBS_END) $(SHARED) $(LINK_FLAGS) -o $@


# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------
@@ -259,6 +279,11 @@ $(OBJDIR)/carla-vst-export.cpp.o: carla-vst-export.cpp
@echo "Compiling $<" @echo "Compiling $<"
@$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@


$(OBJDIR)/carla-vst-export.cpp.dll.o: carla-vst-export.cpp
-@mkdir -p $(OBJDIR)
@echo "Compiling $< (Wine)"
@$(WINECC) $< $(BUILD_CXX_FLAGS) -c -o $@

# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------


$(BINDIR)/carla.lv2/manifest.ttl: $(OBJDIR)/carla-lv2-export.cpp.o $(BINDIR)/carla.lv2/manifest.ttl: $(OBJDIR)/carla-lv2-export.cpp.o
@@ -286,6 +311,7 @@ $(OBJDIR)/carla-lv2-export.cpp.o: carla-lv2-export.cpp


# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------


-include $(OBJDIR)/carla-native-plugin.cpp.d
-include $(OBJDIR)/carla-lv2.cpp.d -include $(OBJDIR)/carla-lv2.cpp.d
-include $(OBJDIR)/carla-lv2-export.cpp.d -include $(OBJDIR)/carla-lv2-export.cpp.d
-include $(OBJDIR)/carla-vst.cpp.patchbay-fx.d -include $(OBJDIR)/carla-vst.cpp.patchbay-fx.d
@@ -295,5 +321,6 @@ $(OBJDIR)/carla-lv2-export.cpp.o: carla-lv2-export.cpp
-include $(OBJDIR)/carla-vst.cpp.rack-syn.d -include $(OBJDIR)/carla-vst.cpp.rack-syn.d
-include $(OBJDIR)/carla-vst.cpp.shell.d -include $(OBJDIR)/carla-vst.cpp.shell.d
-include $(OBJDIR)/carla-vst-export.cpp.d -include $(OBJDIR)/carla-vst-export.cpp.d
-include $(OBJDIR)/carla-vst-export.cpp.dll.d


# --------------------------------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------------------------------

+ 3
- 0
source/plugin/carla-vst-export.def View File

@@ -0,0 +1,3 @@
LIBRARY CarlaVST
DESCRIPTION 'Carla VST Plugin'
EXPORTS VSTPluginMain

+ 9
- 7
source/plugin/carla-vst.cpp View File

@@ -15,6 +15,10 @@
* For a full copy of the GNU General Public License see the doc/GPL.txt file. * For a full copy of the GNU General Public License see the doc/GPL.txt file.
*/ */


#ifdef __WINE__
#error This file is not supposed to be built with wine!
#endif

#ifndef CARLA_VST_SHELL #ifndef CARLA_VST_SHELL
#ifndef CARLA_PLUGIN_PATCHBAY #ifndef CARLA_PLUGIN_PATCHBAY
#error CARLA_PLUGIN_PATCHBAY undefined #error CARLA_PLUGIN_PATCHBAY undefined
@@ -79,8 +83,12 @@ public:


File curExe = File::getSpecialLocation(File::currentExecutableFile).getLinkedTarget(); File curExe = File::getSpecialLocation(File::currentExecutableFile).getLinkedTarget();
File resDir = curExe.getSiblingFile("resources"); File resDir = curExe.getSiblingFile("resources");

// FIXME: proper fallback path for other OSes
if (! resDir.exists()) if (! resDir.exists())
resDir = File("/usr/share/carla/resources/");
resDir = File("/usr/local/share/carla/resources");
if (! resDir.exists())
resDir = File("/usr/share/carla/resources");


// find host type // find host type
const String hostFilename(File::getSpecialLocation(File::hostApplicationPath).getFileName()); const String hostFilename(File::getSpecialLocation(File::hostApplicationPath).getFileName());
@@ -755,12 +763,10 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index,
effect->numInputs = pluginDesc->audioIns; effect->numInputs = pluginDesc->audioIns;
effect->numOutputs = pluginDesc->audioOuts; effect->numOutputs = pluginDesc->audioOuts;


/*
if (pluginDesc->hints & NATIVE_PLUGIN_HAS_UI) if (pluginDesc->hints & NATIVE_PLUGIN_HAS_UI)
effect->flags |= effFlagsHasEditor; effect->flags |= effFlagsHasEditor;
else else
effect->flags &= ~effFlagsHasEditor; effect->flags &= ~effFlagsHasEditor;
*/


if (pluginDesc->hints & NATIVE_PLUGIN_IS_SYNTH) if (pluginDesc->hints & NATIVE_PLUGIN_IS_SYNTH)
effect->flags |= effFlagsIsSynth; effect->flags |= effFlagsIsSynth;
@@ -928,10 +934,6 @@ intptr_t vst_dispatcherCallback(AEffect* effect, int32_t opcode, int32_t index,


if (desc->midiIns > 1 || desc->midiOuts > 1) if (desc->midiIns > 1 || desc->midiOuts > 1)
continue; continue;
if (std::strncmp(desc->label, "carlarack", 9) == 0)
continue;
if (std::strncmp(desc->label, "carlapatchbay", 13) == 0)
continue;


std::strncpy(cptr, desc->label, 32); std::strncpy(cptr, desc->label, 32);
return effect->uniqueID; return effect->uniqueID;


Loading…
Cancel
Save