PKG_NAME:=kamailio5
PKG_VERSION:=5.3.3
-PKG_RELEASE:=1
+PKG_RELEASE:=2
PKG_SOURCE_URL:=https://www.kamailio.org/pub/kamailio/$(PKG_VERSION)/src
PKG_SOURCE:=kamailio-$(PKG_VERSION)$(PKG_VARIANT)_src.tar.gz
app_jsdt \
app_lua \
app_lua_sr \
+ app_python3 \
app_ruby \
app_sqlang \
async \
include $(INCLUDE_DIR)/nls.mk
include $(INCLUDE_DIR)/package.mk
+include $(TOPDIR)/feeds/packages/lang/python/python3-version.mk
# Build reproducibly
TARGET_CFLAGS += -DVERSION_NODATE=1
quiet=verbose \
run_prefix=""
+MAKE_VARS += \
+ PYTHON3=python$(PYTHON3_VERSION)
+
define Build/Configure
endef
$(eval $(call BuildKamailio5Module,app_jsdt,Execute JavaScript scripts,,))
$(eval $(call BuildKamailio5Module,app_lua,Execute embedded Lua scripts,,+liblua))
$(eval $(call BuildKamailio5Module,app_lua_sr,Old Lua API,,+kamailio5-mod-app-lua,))
+$(eval $(call BuildKamailio5Module,app_python3,Python3 scripting interpreter,,+python3-light))
$(eval $(call BuildKamailio5Module,app_ruby,Ruby scripting interpreter,,+libruby))
$(eval $(call BuildKamailio5Module,app_sqlang,Execute Squirrel language scripts,,+libstdcpp))
$(eval $(call BuildKamailio5Module,async,Asynchronous SIP handling functions,,+kamailio5-mod-tm +kamailio5-mod-tmx))
--- /dev/null
+commit 05af36d34aa2668780aa111878206c6797fa98b0
+Author: Sebastian Kemper <sebastian_ml@gmx.net>
+Date: Sun Apr 12 09:37:48 2020 +0200
+
+ app_python3: update Python3 detection mechanism
+
+ This commit
+
+ - removes the python calls whose output is never actually used.
+
+ - changes the include discovery to use python3(.x)-config. This is
+ preferable because it also works for cross-compiling. Calling
+ python3(.x) directly will always provide host flags, which for
+ cross-compiling is not feasible.
+
+ - updates LDFLAGS discovery to also work with >= Python 3.8. To
+ achieve this python3(.x)-config is first run with the argument
+ "--embed". If this does not succeed (exit status 1)
+ python3(.x)-config is run again without "--embed". This is the
+ method suggested by Python upstream to provide backwards
+ compatibility. See [1] for more details.
+
+ [1] https://docs.python.org/3/whatsnew/3.8.html
+
+ Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
+
+diff --git a/src/modules/app_python3/Makefile b/src/modules/app_python3/Makefile
+index 1c9ff1c6b6..d31cd6ab10 100644
+--- a/src/modules/app_python3/Makefile
++++ b/src/modules/app_python3/Makefile
+@@ -11,18 +11,16 @@ NAME=app_python3.so
+ # but no testing has been done with that.
+ PYTHON3?=python3
+
+-PYTHON3_VERSION=${shell ${PYTHON3} -c "import distutils.sysconfig;print(distutils.sysconfig.get_config_var('VERSION'))"}
+-PYTHON3_LIBDIR=${shell ${PYTHON3} -c "import distutils.sysconfig;print(distutils.sysconfig.get_config_var('LIBDIR'))"}
+-PYTHON3_LDFLAGS=${shell ${PYTHON3} -c "import distutils.sysconfig;print(distutils.sysconfig.get_config_var('LINKFORSHARED'))"}
+-PYTHON3_INCDIR=${shell ${PYTHON3} -c "import distutils.sysconfig;print(distutils.sysconfig.get_python_inc())"}
+-
+-LIBS=${shell ${PYTHON3}-config --ldflags}
++LIBS=${shell \
++ tmp_py3_libs=$$(${PYTHON3}-config --ldflags --embed 2>/dev/null) || \
++ tmp_py3_libs=$$(${PYTHON3}-config --ldflags); \
++ echo $$tmp_py3_libs}
+
+ ifeq ($(OS), freebsd)
+ LIBS+=-pthread
+ endif
+
+-DEFS+=-I${PYTHON3_INCDIR}
++DEFS+=${shell ${PYTHON3}-config --includes}
+
+ include ../../Makefile.modules
+