Rework how resource files are installed
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
47ac677388
commit
29122b180b
4 changed files with 25 additions and 21 deletions
|
|
@ -838,34 +838,40 @@ else
|
||||||
PLUGIN_LIST = $(subst /plugin.json,,$(wildcard */plugin.json))
|
PLUGIN_LIST = $(subst /plugin.json,,$(wildcard */plugin.json))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
RESOURCE_FILES = \
|
||||||
|
$(wildcard */presets) \
|
||||||
|
$(wildcard */res/*.svg) \
|
||||||
|
$(filter-out HetrickCV/res/illustrator - deprecated/MyModule.svg,$(wildcard */res/*/*.svg)) \
|
||||||
|
$(wildcard */res/*.ttf) $(wildcard */res/*/*.ttf)
|
||||||
|
|
||||||
PLUGIN_RESOURCES =
|
PLUGIN_RESOURCES =
|
||||||
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.lv2/resources/%)
|
|
||||||
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.lv2/resources/PluginManifests/%.json)
|
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.lv2/resources/PluginManifests/%.json)
|
||||||
|
PLUGIN_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.lv2/resources/%)
|
||||||
ifeq ($(MACOS),true)
|
ifeq ($(MACOS),true)
|
||||||
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst/Contents/Resources/%)
|
|
||||||
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst/Contents/Resources/PluginManifests/%.json)
|
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst/Contents/Resources/PluginManifests/%.json)
|
||||||
|
PLUGIN_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.vst/Contents/Resources/%)
|
||||||
else
|
else
|
||||||
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst/resources/%)
|
|
||||||
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst/resources/PluginManifests/%.json)
|
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst/resources/PluginManifests/%.json)
|
||||||
|
PLUGIN_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.vst/resources/%)
|
||||||
endif
|
endif
|
||||||
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst3/Contents/Resources/%)
|
|
||||||
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst3/Contents/Resources/PluginManifests/%.json)
|
PLUGIN_RESOURCES += $(PLUGIN_LIST:%=../bin/CardinalFX.vst3/Contents/Resources/PluginManifests/%.json)
|
||||||
|
PLUGIN_RESOURCES += $(RESOURCE_FILES:%=../bin/CardinalFX.vst3/Contents/Resources/%)
|
||||||
|
|
||||||
resources: $(PLUGIN_RESOURCES)
|
resources: $(PLUGIN_RESOURCES)
|
||||||
|
|
||||||
../bin/CardinalFX.lv2/resources/%: %/res
|
../bin/CardinalFX.lv2/resources/%: %
|
||||||
-@mkdir -p "$(shell dirname $@)"
|
-@mkdir -p "$(shell dirname $@)"
|
||||||
ln -sf $(abspath $<) $@
|
ln -sf $(abspath $<) $@
|
||||||
|
|
||||||
../bin/CardinalFX.vst/resources/%: %/res
|
../bin/CardinalFX.vst/resources/%: %
|
||||||
-@mkdir -p "$(shell dirname $@)"
|
-@mkdir -p "$(shell dirname $@)"
|
||||||
ln -sf $(abspath $<) $@
|
ln -sf $(abspath $<) $@
|
||||||
|
|
||||||
../bin/CardinalFX.vst/Contents/Resources/%: %/res
|
../bin/CardinalFX.vst/Contents/Resources/%: %
|
||||||
-@mkdir -p "$(shell dirname $@)"
|
-@mkdir -p "$(shell dirname $@)"
|
||||||
ln -sf $(abspath $<) $@
|
ln -sf $(abspath $<) $@
|
||||||
|
|
||||||
../bin/CardinalFX.vst3/Contents/Resources/%: %/res
|
../bin/CardinalFX.vst3/Contents/Resources/%: %
|
||||||
-@mkdir -p "$(shell dirname $@)"
|
-@mkdir -p "$(shell dirname $@)"
|
||||||
ln -sf $(abspath $<) $@
|
ln -sf $(abspath $<) $@
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit c1b128866786246a407c10713efb00ecc8486ced
|
Subproject commit 01c4fac9f2e91f60125d36767224f457b2057fb7
|
||||||
|
|
@ -223,7 +223,7 @@ ifeq ($(NAME),CardinalFX)
|
||||||
|
|
||||||
all: lv2 vst2 vst3 resources
|
all: lv2 vst2 vst3 resources
|
||||||
|
|
||||||
CORE_RESOURCES = $(filter-out icon.png,$(subst ../Rack/res/,,$(wildcard ../Rack/res/*))) template.vcv
|
CORE_RESOURCES = $(subst ../Rack/res/,,$(wildcard ../Rack/res/ComponentLibrary/*.svg ../Rack/res/fonts/*.ttf)) template.vcv
|
||||||
|
|
||||||
PLUGIN_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/CardinalFX.lv2/resources/%)
|
PLUGIN_RESOURCES += $(CORE_RESOURCES:%=$(TARGET_DIR)/CardinalFX.lv2/resources/%)
|
||||||
ifeq ($(MACOS),true)
|
ifeq ($(MACOS),true)
|
||||||
|
|
|
||||||
|
|
@ -50,14 +50,16 @@ std::string user(std::string filename) {
|
||||||
|
|
||||||
// get system resource, trimming "res/" prefix if we are loaded as a plugin bundle
|
// get system resource, trimming "res/" prefix if we are loaded as a plugin bundle
|
||||||
std::string system(std::string filename) {
|
std::string system(std::string filename) {
|
||||||
if (string::endsWith(filename, "/ComponentLibrary/ScrewSilver.svg"))
|
// Always use dark screws
|
||||||
|
if (string::endsWith(filename, "/ScrewSilver.svg"))
|
||||||
filename = filename.substr(0, filename.size()-10) + "Black.svg";
|
filename = filename.substr(0, filename.size()-10) + "Black.svg";
|
||||||
return system::join(systemDir, bundlePath.empty() ? filename : trim(filename));
|
return system::join(systemDir, bundlePath.empty() ? filename : trim(filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
// get plugin resource, also trims "res/" as needed
|
// get plugin resource
|
||||||
std::string plugin(plugin::Plugin* plugin, std::string filename) {
|
std::string plugin(plugin::Plugin* plugin, std::string filename) {
|
||||||
DISTRHO_SAFE_ASSERT_RETURN(plugin != nullptr, {});
|
DISTRHO_SAFE_ASSERT_RETURN(plugin != nullptr, {});
|
||||||
|
// always use dark scheme
|
||||||
if (plugin->slug == "GlueTheGiant")
|
if (plugin->slug == "GlueTheGiant")
|
||||||
{
|
{
|
||||||
if (filename == "res/BusDepot.svg"
|
if (filename == "res/BusDepot.svg"
|
||||||
|
|
@ -73,28 +75,24 @@ std::string plugin(plugin::Plugin* plugin, std::string filename) {
|
||||||
filename = filename.substr(0, filename.size()-4) + "_Night.svg";
|
filename = filename.substr(0, filename.size()-4) + "_Night.svg";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return system::join(plugin->path, trim(filename));
|
return system::join(plugin->path, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
// path to plugin manifest
|
// path to plugin manifest
|
||||||
std::string pluginManifest(const std::string& dirname) {
|
std::string pluginManifest(const std::string& dirname) {
|
||||||
|
// no bundlePath set, assume local source build
|
||||||
if (bundlePath.empty())
|
if (bundlePath.empty())
|
||||||
{
|
|
||||||
if (dirname == "Core")
|
|
||||||
return system::join(systemDir, "..", "..", "plugins", "Core.json");
|
|
||||||
return system::join(systemDir, "..", "..", "plugins", dirname, "plugin.json");
|
return system::join(systemDir, "..", "..", "plugins", dirname, "plugin.json");
|
||||||
}
|
// bundlePath is present, use resources from bundle
|
||||||
return system::join(bundlePath, dirname + ".json");
|
return system::join(bundlePath, dirname + ".json");
|
||||||
}
|
}
|
||||||
|
|
||||||
// path to plugin files
|
// path to plugin files
|
||||||
std::string pluginPath(const std::string& dirname) {
|
std::string pluginPath(const std::string& dirname) {
|
||||||
|
// no bundlePath set, assume local source build
|
||||||
if (bundlePath.empty())
|
if (bundlePath.empty())
|
||||||
{
|
|
||||||
if (dirname == "Core")
|
|
||||||
return systemDir;
|
|
||||||
return system::join(systemDir, "..", "..", "plugins", "res", dirname);
|
return system::join(systemDir, "..", "..", "plugins", "res", dirname);
|
||||||
}
|
// bundlePath is present, use resources from bundle
|
||||||
return system::join(systemDir, dirname);
|
return system::join(systemDir, dirname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue