Signed-off-by: falkTX <falktx@falktx.com>tags/22.02
@@ -2,7 +2,7 @@ | |||||
# -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||
# DISTRHO Plugin Framework (DPF) | # DISTRHO Plugin Framework (DPF) | ||||
# Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||||
# Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com> | |||||
# | # | ||||
# Permission to use, copy, modify, and/or distribute this software for any purpose with | # Permission to use, copy, modify, and/or distribute this software for any purpose with | ||||
# or without fee is hereby granted, provided that the above copyright notice and this | # or without fee is hereby granted, provided that the above copyright notice and this | ||||
@@ -42,7 +42,7 @@ if __name__ == '__main__': | |||||
filename = sys.argv[1] | filename = sys.argv[1] | ||||
if not os.path.exists(filename): | if not os.path.exists(filename): | ||||
print("Folder '%s' does not exist" % filename) | |||||
print("File '%s' does not exist" % filename) | |||||
quit() | quit() | ||||
# dump code now | # dump code now |
@@ -0,0 +1,51 @@ | |||||
#!/usr/bin/env python3 | |||||
# -*- coding: utf-8 -*- | |||||
# DISTRHO Plugin Framework (DPF) | |||||
# Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com> | |||||
# | |||||
# Permission to use, copy, modify, and/or distribute this software for any purpose with | |||||
# or without fee is hereby granted, provided that the above copyright notice and this | |||||
# permission notice appear in all copies. | |||||
# | |||||
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD | |||||
# TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN | |||||
# NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL | |||||
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | |||||
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | |||||
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |||||
import os | |||||
import sys | |||||
import xml.etree.ElementTree as ET | |||||
# ----------------------------------------------------- | |||||
def svg2stub(filename_in, filename_out): | |||||
node = ET.parse(filename_in).getroot() | |||||
with open(filename_out, 'w') as fh: | |||||
fh.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n') | |||||
fh.write('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"') | |||||
for key, value in node.items(): | |||||
if '{' in key: | |||||
continue | |||||
fh.write(' %s="%s"' % (key, value)) | |||||
fh.write('></svg>') | |||||
# ----------------------------------------------------- | |||||
if __name__ == '__main__': | |||||
if len(sys.argv) != 3: | |||||
print("Usage: %s <in-filename> <out-filename>" % sys.argv[0]) | |||||
quit() | |||||
filename_in = sys.argv[1] | |||||
filename_out = sys.argv[2] | |||||
if not os.path.exists(filename_in): | |||||
print("File '%s' does not exist" % filename_in) | |||||
quit() | |||||
# dump code now | |||||
svg2stub(filename_in, filename_out) |
@@ -854,7 +854,7 @@ RESOURCE_FILES += MindMeldModular/res/ShapeMaster/CommunityShapes | |||||
RESOURCE_FILES += MindMeldModular/res/ShapeMaster/MindMeldPresets | RESOURCE_FILES += MindMeldModular/res/ShapeMaster/MindMeldPresets | ||||
RESOURCE_FILES += MindMeldModular/res/ShapeMaster/MindMeldShapes | RESOURCE_FILES += MindMeldModular/res/ShapeMaster/MindMeldShapes | ||||
# MOD builds only have FX variant for now | |||||
# MOD builds only have LV2 FX variant for now | |||||
ifeq ($(MOD_BUILD),true) | ifeq ($(MOD_BUILD),true) | ||||
LV2_RESOURCES = $(PLUGIN_LIST:%=../bin/CardinalFX.lv2/resources/PluginManifests/%.json) | LV2_RESOURCES = $(PLUGIN_LIST:%=../bin/CardinalFX.lv2/resources/PluginManifests/%.json) | ||||
LV2_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.lv2/resources/%) | LV2_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.lv2/resources/%) | ||||
@@ -865,7 +865,6 @@ LV2_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalSynth.lv2/resources/PluginManife | |||||
LV2_RESOURCES += $(RESOURCE_FILES:%=../bin/Cardinal.lv2/resources/%) | LV2_RESOURCES += $(RESOURCE_FILES:%=../bin/Cardinal.lv2/resources/%) | ||||
LV2_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.lv2/resources/%) | LV2_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.lv2/resources/%) | ||||
LV2_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalSynth.lv2/resources/%) | LV2_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalSynth.lv2/resources/%) | ||||
endif | |||||
ifeq ($(MACOS),true) | ifeq ($(MACOS),true) | ||||
VST2_RESOURCES = $(PLUGIN_LIST:%=../bin/CardinalFX.vst/Contents/Resources/PluginManifests/%.json) | VST2_RESOURCES = $(PLUGIN_LIST:%=../bin/CardinalFX.vst/Contents/Resources/PluginManifests/%.json) | ||||
@@ -885,6 +884,7 @@ VST3_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalSynth.vst3/Contents/Resources/P | |||||
VST3_RESOURCES += $(RESOURCE_FILES:%=../bin/Cardinal.vst3/Contents/Resources/%) | VST3_RESOURCES += $(RESOURCE_FILES:%=../bin/Cardinal.vst3/Contents/Resources/%) | ||||
VST3_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.vst3/Contents/Resources/%) | VST3_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.vst3/Contents/Resources/%) | ||||
VST3_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalSynth.vst3/Contents/Resources/%) | VST3_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalSynth.vst3/Contents/Resources/%) | ||||
endif | |||||
resources: $(LV2_RESOURCES) $(VST2_RESOURCES) $(VST3_RESOURCES) | resources: $(LV2_RESOURCES) $(VST2_RESOURCES) $(VST3_RESOURCES) | ||||
@@ -900,6 +900,12 @@ resources: $(LV2_RESOURCES) $(VST2_RESOURCES) $(VST3_RESOURCES) | |||||
-@mkdir -p "$(shell dirname $@)" | -@mkdir -p "$(shell dirname $@)" | ||||
$(SILENT)ln -sf $(abspath $<) $@ | $(SILENT)ln -sf $(abspath $<) $@ | ||||
ifeq ($(MOD_BUILD),true) | |||||
../bin/CardinalFX.lv2/resources/%.svg: %.svg ../deps/svg2stub.py | |||||
-@mkdir -p "$(shell dirname $@)" | |||||
$(SILENT)python3 ../deps/svg2stub.py $< $@ | |||||
endif | |||||
../bin/Cardinal.lv2/resources/PluginManifests/%.json: %/plugin.json | ../bin/Cardinal.lv2/resources/PluginManifests/%.json: %/plugin.json | ||||
-@mkdir -p "$(shell dirname $@)" | -@mkdir -p "$(shell dirname $@)" | ||||
$(SILENT)ln -sf $(abspath $<) $@ | $(SILENT)ln -sf $(abspath $<) $@ | ||||
@@ -987,10 +993,10 @@ $(TARGET): $(PLUGIN_OBJS) | |||||
$(SILENT)rm -f $@ | $(SILENT)rm -f $@ | ||||
$(SILENT)$(AR) crs $@ $^ | $(SILENT)$(AR) crs $@ $^ | ||||
$(BUILD_DIR)/%.bin.c: % res2c.py | |||||
$(BUILD_DIR)/%.bin.c: % ../deps/res2c.py | |||||
-@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" | -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" | ||||
@echo "Generating $*.bin.c" | @echo "Generating $*.bin.c" | ||||
$(SILENT)python3 ./res2c.py $< > $@ | |||||
$(SILENT)python3 ../deps/res2c.py $< > $@ | |||||
$(BUILD_DIR)/%.bin.o: $(BUILD_DIR)/%.bin.c | $(BUILD_DIR)/%.bin.o: $(BUILD_DIR)/%.bin.c | ||||
-@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" | -@mkdir -p "$(shell dirname $(BUILD_DIR)/$<)" | ||||
@@ -250,9 +250,9 @@ BUILD_CXX_FLAGS += -DCARDINAL_PLUGIN_PREFIX='"$(PREFIX)"' | |||||
# Enable all possible plugin types and setup resources | # Enable all possible plugin types and setup resources | ||||
ifeq ($(CARDINAL_VARIANT),main) | ifeq ($(CARDINAL_VARIANT),main) | ||||
all: jack lv2 vst3 resources | |||||
all: jack lv2 vst3 | |||||
else | else | ||||
all: lv2 vst2 vst3 resources | |||||
all: lv2 vst2 vst3 | |||||
endif | endif | ||||
CORE_RESOURCES = $(subst ../Rack/res/,,$(wildcard ../Rack/res/ComponentLibrary/*.svg ../Rack/res/fonts/*.ttf)) | CORE_RESOURCES = $(subst ../Rack/res/,,$(wildcard ../Rack/res/ComponentLibrary/*.svg ../Rack/res/fonts/*.ttf)) | ||||
@@ -289,6 +289,12 @@ $(TARGET_DIR)/$(NAME).lv2/resources/%: ../Rack/res/% | |||||
-@mkdir -p "$(shell dirname $@)" | -@mkdir -p "$(shell dirname $@)" | ||||
$(SILENT)ln -sf $(abspath $<) $@ | $(SILENT)ln -sf $(abspath $<) $@ | ||||
ifeq ($(MOD_BUILD),true) | |||||
$(TARGET_DIR)/$(NAME).lv2/resources/%.svg: ../Rack/res/%.svg ../../deps/svg2stub.py | |||||
-@mkdir -p "$(shell dirname $@)" | |||||
$(SILENT)python3 ../../deps/svg2stub.py $< $@ | |||||
endif | |||||
$(TARGET_DIR)/$(NAME).vst/resources/%: ../Rack/res/% | $(TARGET_DIR)/$(NAME).vst/resources/%: ../Rack/res/% | ||||
-@mkdir -p "$(shell dirname $@)" | -@mkdir -p "$(shell dirname $@)" | ||||
$(SILENT)ln -sf $(abspath $<) $@ | $(SILENT)ln -sf $(abspath $<) $@ | ||||