aboutsummaryrefslogtreecommitdiffstats
path: root/main/uwsgi/0005-uwsgiconfig-plugin_build_dir.patch
blob: 9840c6919922cbd95f93ab54aed98490f8bb491c (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
From 6dc5730a234f4bc8a0cbfb0bd3360e860d39e340 Mon Sep 17 00:00:00 2001
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Sat, 26 Mar 2016 00:17:35 +0100
Subject: [PATCH] Add variable plugin_build_dir to uwsgiconfig

Package managers in Alpine Linux (APK) and Gentoo (Portage) builds
packages in different directory than where are eventually installed.
Therefore we need to set different plugin_dir for build and runtime.

Gentoo ebuild for uWSGI solved this problem using simple workaround that
involves patching uwsgiconfig.py (see [1]). This patch do the same
thing; it adds build variable plugin_build_dir, but with fallback to
plugin_dir for backward compatibility.

[1]: https://github.com/gentoo/gentoo/blob/master/www-servers/uwsgi/uwsgi-2.0.11.2-r1.ebuild#L149
---
 uwsgiconfig.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/uwsgiconfig.py b/uwsgiconfig.py
index 835d6b4..617d6b3 100644
--- a/uwsgiconfig.py
+++ b/uwsgiconfig.py
@@ -1424,7 +1424,7 @@ def build_plugin(path, uc, cflags, ldflags, libs, name=None):
         pass
 
     if uc:
-        plugin_dest = uc.get('plugin_dir') + '/' + name + '_plugin'
+        plugin_dest = uc.get('plugin_build_dir', uc.get('plugin_dir')) + '/' + name + '_plugin'
     else:
         plugin_dest = name + '_plugin'