Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Makefiles to match the new plugin build procedure #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AnClark
Copy link
Contributor

@AnClark AnClark commented Feb 9, 2023

This patch corresponds with my rewrite of plugin build procedure in ZynAddSubFX#221.

NOTICE: Currently only Makefile.linux.mk is tested.

Known issues:

  • Cannot cross-build via Makefile.windows.mk. Error occurs when building libuv. (Seems that it's due to header file error in MinGW-w64).

@@ -87,9 +87,11 @@ copy_zest_files: preinstall_zynaddsubfx
touch $(ZYN_FUSION_OUT)/qml/MainWindow.qml

cp -a $(ZEST_PATH)/package/schema $(ZYN_FUSION_OUT)/
mkdir $(ZYN_FUSION_OUT)/ZynAddSubFX.lv2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat, I didn't realize you could bypass this for the initial folder

mkdir $(ZYN_FUSION_OUT)/ZynAddSubFX.lv2
cp $(ZYNADDSUBFX_BUILD_DIR)/src/Plugin/ZynAddSubFX/lv2/* $(ZYN_FUSION_OUT)/ZynAddSubFX.lv2/
cp $(ZYNADDSUBFX_BUILD_DIR)/src/Plugin/ZynAddSubFX/vst/ZynAddSubFX.so $(ZYN_FUSION_OUT)/
cp -r $(ZYNADDSUBFX_INSTALL_DIR)/usr/lib/lv2/ZynAddSubFX.lv2 $(ZYN_FUSION_OUT)/ZynAddSubFX.lv2/
Copy link
Contributor Author

@AnClark AnClark Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

neat, I didn't realize you could bypass this for the initial folder

Because of this line. I copy the whole LV2 bundle folder from the pre-install path.

cp $(ZYNADDSUBFX_BUILD_DIR)/src/zynaddsubfx.exe $(ZYN_FUSION_OUT)/
cp -r $(ZYNADDSUBFX_BUILD_DIR)/build/bin/ZynAddSubFX.lv2 $(ZYN_FUSION_OUT)/ZynAddSubFX.lv2/
cp -r $(ZYNADDSUBFX_BUILD_DIR)/build/bin/ZynAddSubFX.vst3 $(ZYN_FUSION_OUT)/ZynAddSubFX.vst3/
cp $(ZYNADDSUBFX_BUILD_DIR)/build/bin/ZynAddSubFX-vst2.dll $(ZYN_FUSION_OUT)/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC from some early development, a few hosts will get uppity if the name of the vst2 dll changes. Either my memory is wrong or we ought to make sure the vst2 lib doesn't change filenames.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DPF CMake module's default VST2 output name is suffixed with -vst2. I kept this because I was afraid of confusion of DLL names.

Maybe I should rename them into ZynAddSubFX.dll (Windows) or ZynAddSubFX.so (Linux), as your description?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm perfectly fine with them using the -vst2 relabel in the cmake/dpf level, as long as they're renamed in the ZYN_FUSION_OUT folder. Right now a supported use case is unzipping that folder and pointing a DAW at it.

Copy link
Contributor Author

@AnClark AnClark Feb 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many hosts recognize VST plugins by FOURCC, for example, REAPER. If there are mutiple plugin files with different filenames but the same FOURCC, then only one plugin is recognized.

I'm not sure how other hosts behave.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say let's just make sure the name is consistent to minimize the chances of any oddball hosts behaving strangely.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, that will be easy: simply rename during cp.

@AnClark
Copy link
Contributor Author

AnClark commented Feb 10, 2023

Wait a moment, I've forgot to push my modification of VST3 output path to my ZynAddSubFX fork.


Update BJT 12:45: Done! I force-pushed my updates. Now VST3 plugin should be installed into right place.

@AnClark
Copy link
Contributor Author

AnClark commented Feb 11, 2023

I encountered build error around libuv, when cross-compiling for Windows. Problem is duplicated Winsock definition in libuv's Win-API header. What about yours?

Applying this patch can help: https://github.com/AnClark/zyn-fusion-build/blob/a716bad589b0dfecd9ecdbf1310d6822a5e4127f/patch/libuv-winapi-fix-redefinition.patch (according to Msys2 package maintainers).

ZynAddSubFX now use DPF's CMake module for plugin build, which brings
the following changes:
- New plugin formats: VST3, CLAP
- LV2 build for Windows (DAWs like REAPER and Ardour support LV2 there)
- Plugin will be installed to different directories

This patch mainly updates recipe `copy_zest_files`.

It also added CMAKE_SYSTEM_PROCESSOR parameter in toolchain files
(resides in z/), which is needed when cross-building VST3 plugins.
@fundamental
Copy link
Member

I encountered build error around libuv, when cross-compiling for Windows. Problem is duplicated Winsock definition in libuv's Win-API header. What about yours?

I do not encounter this error using the ubuntu-windows dockerfile configuration included in this repo. Such an error either implies mingw is different on your system or a different libuv version is getting used.

@fundamental
Copy link
Member

Good to merge conditioned on zynaddsubfx/zynaddsubfx#221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants