summarylogtreecommitdiffstats
path: root/plugins.patch
blob: 0d74d1debee062f425e9947dd6fd82c2beb3990e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/plugin.mk b/plugin.mk
index 47438416..e1f70545 100644
--- a/plugin.mk
+++ b/plugin.mk
@@ -1,9 +1,13 @@
+ifndef ARCH_LIN
 ifndef RACK_DIR
 $(error RACK_DIR is not defined)
 endif
+else
+RACK_DIR ?= /usr/share/vcvrack
+endif
 
-SLUG := $(shell jq -r .slug plugin.json)
-VERSION := $(shell jq -r .version plugin.json)
+SLUG ?= $(shell jq -r .slug plugin.json)
+VERSION ?= $(shell jq -r .version plugin.json)
 
 ifndef SLUG
 $(error SLUG could not be found in manifest)
@@ -33,10 +37,10 @@ ifdef ARCH_LIN
 	TARGET := $(TARGET).so
 	# This prevents static variables in the DSO (dynamic shared object) from being preserved after dlclose().
 	FLAGS += -fno-gnu-unique
-	# When Rack loads a plugin, it symlinks /tmp/Rack2 to its system dir, so the plugin can link to libRack.
-	LDFLAGS += -Wl,-rpath=/tmp/Rack2
-	# Since the plugin's compiler could be a different version than Rack's compiler, link libstdc++ and libgcc statically to avoid ABI issues.
-	LDFLAGS += -static-libstdc++ -static-libgcc
+	# Installed includes
+	FLAGS += -I/usr/include/vcvrack -I/usr/include/vcvrack/dep
+	# Link shared libs
+	LDFLAGS += -ldl
 	RACK_USER_DIR ?= $(HOME)/.Rack2
 endif
 
diff --git a/src/plugin.cpp b/src/plugin.cpp
index 25621f66..33571d9e 100644
--- a/src/plugin.cpp
+++ b/src/plugin.cpp
@@ -269,6 +269,9 @@ void init() {
 	if (settings::safeMode)
 		return;
 
+	// Load system-wide plugins
+	loadPlugins(asset::system("plugins"));
+
 	// Extract packages and load plugins
 	extractPackages(pluginsPath);
 	loadPlugins(pluginsPath);