Hello,

this patch enables built-in Python C module (as "import _ssl").

Regards,
Jiri Slachta, CESNET, z.s.p.o.
Signed-off-by: Jiri Slachta <slac...@cesnet.cz>
Index: feeds/packages/lang/python/Makefile
===================================================================
--- feeds/packages/lang/python/Makefile (revision 33526)
+++ feeds/packages/lang/python/Makefile (working copy)
@@ -57,10 +57,16 @@
  This package contains the full Python install.
 endef
 
+define Package/python/config
+       config PYTHON_SSL_LIB
+               bool    "Enable built-in Python SSL C library"
+               depends on PACKAGE_python-mini
+endef
+
 define Package/python-mini
 $(call Package/python/Default)
   TITLE+= (minimal)
-  DEPENDS:=+libpthread +zlib
+  DEPENDS:=+libpthread +zlib +PYTHON_SSL_LIB:libopenssl
 endef
 
 define Package/python-mini/description
@@ -152,6 +158,9 @@
        # be used to compute the path of the config files.
        $(CP) $(STAGING_DIR_HOST)/bin/pgen $(PKG_BUILD_DIR)/hostpgen
        $(CP) $(STAGING_DIR_HOST)/bin/python$(PYTHON_VERSION) 
$(PKG_BUILD_DIR)/hostpython
+ifeq ($(CONFIG_PYTHON_SSL_LIB),y)
+               echo -e "_socket socketmodule.c\\ \n_ssl _ssl.c -DUSE_SSL 
-I$(STAGING_DIR)/usr -I$(STAGING_DIR)/usr/include/openssl 
-L$(STAGING_DIR)/usr/lib -lssl -lcrypto\n" >> 
$(PKG_BUILD_DIR)/Modules/Setup.dist
+endif
        $(call Build/Configure/Default, \
                --sysconfdir=/etc \
                --disable-shared \
@@ -454,6 +463,9 @@
 define Host/Configure
        -$(MAKE) -C $(HOST_BUILD_DIR) distclean
        (cd $(HOST_BUILD_DIR); autoreconf --force --install || exit 0)
+ifeq ($(CONFIG_PYTHON_SSL_LIB),y)
+               echo -e "_socket socketmodule.c\\ \n_ssl _ssl.c -DUSE_SSL -lssl 
-lcrypto\n" >> $(HOST_BUILD_DIR)/Modules/Setup.dist
+endif
        (cd $(HOST_BUILD_DIR); \
                rm -rf config.cache; \
                CONFIG_SITE= \
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to