1
Fork 0

Make sure libarchive uses libzstd instead of external tools; Cleanup

This commit is contained in:
falkTX 2021-10-27 00:16:12 +01:00
parent 0c7c99c8fc
commit 570f9f94a9
4 changed files with 15 additions and 17 deletions

4
deps/Makefile vendored
View File

@ -125,15 +125,17 @@ DEP_MAKE += MACHINE=$(MACHINE)$(MACHINE_SUFFIX)
$(DEP_PATH)/lib/%.a:
$(DEP_MAKE) -C $(DEP_PATH) lib/$*.a
# skip libarchive shared lib
# skip libarchive shared lib and ensure libzstd is enabled
$(DEP_PATH)/lib/libarchive.a: $(DEP_PATH)/lib/libzstd.a $(DEP_PATH)/libarchive-3.4.3/.stamp-patched
$(DEP_PATH)/lib/libarchive_static.a: $(DEP_PATH)/lib/libzstd.a $(DEP_PATH)/libarchive-3.4.3/.stamp-patched
$(DEP_PATH)/libarchive-3.4.3/.stamp-patched:
$(DEP_MAKE) -C $(DEP_PATH) libarchive-3.4.3
sed -i -e "618,625d" $(DEP_PATH)/libarchive-3.4.3/CMakeLists.txt
sed -i -e "238,243d" $(DEP_PATH)/libarchive-3.4.3/libarchive/CMakeLists.txt
sed -i -e "s/TARGETS archive archive_static/TARGETS archive_static/" $(DEP_PATH)/libarchive-3.4.3/libarchive/CMakeLists.txt
sed -i -e "s/HAVE_LIBZSTD/1/" $(DEP_PATH)/libarchive-3.4.3/libarchive/archive_write_add_filter_zstd.c
touch $@
# skip libsamplerate tests

View File

@ -696,8 +696,10 @@ protected:
context->engine->prepareSave();
context->patch->saveAutosave();
context->patch->cleanAutosave();
data = rack::system::archiveDirectory(fAutosavePath, 1);
try {
data = rack::system::archiveDirectory(fAutosavePath, 1);
} DISTRHO_SAFE_EXCEPTION_RETURN("getState archiveDirectory", String());
}
return String::asBase64(data.data(), data.size());

View File

@ -40,8 +40,4 @@
// #define DISTRHO_PLUGIN_LV2_CATEGORY "lv2:AnalyserPlugin"
// #define DISTRHO_PLUGIN_VST3_CATEGORIES "Fx|Analyzer"
enum Parameters {
kParameterCount
};
#endif // DISTRHO_PLUGIN_INFO_H_INCLUDED

View File

@ -46,20 +46,18 @@
#include "DistrhoPlugin.hpp"
#include "../WindowParameters.hpp"
#ifndef HEADLESS
#ifdef WITH_MESA
# include "../src/Rack/dep/glfw/deps/stb_image_write.h"
# include "extra/Thread.hpp"
# include <GL/osmesa.h>
#endif
#ifdef HEADLESS
namespace rack {
namespace app {
widget::Widget* createMenuBar() { return new widget::Widget; }
}
}
#endif
namespace rack {
@ -114,7 +112,7 @@ struct WindowParams {
};
struct Window::Internal
#ifndef HEADLESS
#ifdef WITH_MESA
: public Thread
#endif
{
@ -123,7 +121,7 @@ struct Window::Internal
DISTRHO_NAMESPACE::WindowParametersCallback* callback = nullptr;
Context* context = nullptr;
Window* self = nullptr;
#ifndef HEADLESS
#ifdef WITH_MESA
OSMesaContext mesa = nullptr;
GLubyte* mesaBuffer = nullptr;
#endif
@ -143,7 +141,7 @@ struct Window::Internal
bool fbDirtyOnSubpixelChange = true;
#ifndef HEADLESS
#ifdef WITH_MESA
void run() override {
self->run();
int i=0;
@ -172,7 +170,7 @@ Window::Window() {
internal->self = this;
}
#ifndef HEADLESS
#ifdef WITH_MESA
static void flipBitmap(uint8_t* pixels, int width, int height, int depth) {
for (int y = 0; y < height / 2; y++) {
int flipY = height - y - 1;
@ -188,7 +186,7 @@ void WindowInit(Window* const window, DISTRHO_NAMESPACE::Plugin* const plugin)
{
window->internal->plugin = plugin;
#ifndef HEADLESS
#ifdef WITH_MESA
window->internal->mesa = OSMesaCreateContextExt(OSMESA_RGBA, 24, 8, 0, nullptr);
DISTRHO_SAFE_ASSERT_RETURN(window->internal->mesa != nullptr,);
@ -232,7 +230,7 @@ void WindowInit(Window* const window, DISTRHO_NAMESPACE::Plugin* const plugin)
APP->scene->onContextCreate(e);
}
#ifndef HEADLESS
#ifdef WITH_MESA
d_stdout("all good with mesa and GL? %d | %p %p %p", ok, window->internal->mesa, window->vg, window->fbVg);
// window->internal->startThread();
@ -320,7 +318,7 @@ Window::~Window() {
internal->fontCache.clear();
internal->imageCache.clear();
#ifndef HEADLESS
#ifdef WITH_MESA
// #if defined NANOVG_GL2
nvgDeleteGL2(vg);
nvgDeleteGL2(fbVg);