]> xenbits.xensource.com Git - unikraft/libs/python3.git/commitdiff
Add support for the Pillow extension
authorAndrei Tatar <andrei@unikraft.io>
Tue, 29 Aug 2023 00:17:05 +0000 (02:17 +0200)
committerRazvan Deaconescu <razvand@unikraft.io>
Mon, 16 Oct 2023 00:46:59 +0000 (03:46 +0300)
This change only adds the necessary module registrations and Kconfig
options. Pillow itself is provided by its own Unikraft port.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Radu Nichita <radunichita99@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #22

Config.uk
modules_config.c

index f8f55d6efa368c6e09580f62bded2801a76a821c..5a3ff929038258dde40a6b9d5ddb5b4ada67bc27 100644 (file)
--- a/Config.uk
+++ b/Config.uk
@@ -94,5 +94,11 @@ config LIBPYTHON3_EXTENSION_SHAPELY
     default y
 endif
 
+if LIBPYTHON_PILLOW
+config LIBPYTHON3_EXTENSION_PILLOW
+    bool "Pillow"
+    default y
+endif
+
 endif
 endif
index 2e5f58e29222c4b5a7d127e22e87b8319db4134d..1829eee6b960d16c0e65ff532047958415d26c63 100644 (file)
@@ -194,6 +194,18 @@ extern PyObject* PyInit__geos(void);
 /* Shapely end */
 #endif
 
+#if CONFIG_LIBPYTHON3_EXTENSION_PILLOW
+/* Pillow */
+extern PyObject* PyInit__imaging(void);
+extern PyObject* PyInit__imagingcms(void);
+extern PyObject* PyInit__imagingft(void);
+extern PyObject* PyInit__imagingmath(void);
+extern PyObject* PyInit__imagingmorph(void);
+extern PyObject* PyInit__imagingtk(void);
+extern PyObject* PyInit__webp(void);
+/* Pillow end */
+#endif
+
 struct _inittab _PyImport_Inittab[] = {
 
     {"posix", PyInit_posix},
@@ -398,6 +410,22 @@ struct _inittab _PyImport_Inittab[] = {
     {"shapely__geos", PyInit__geos},
 #endif
 
+#if CONFIG_LIBPYTHON3_EXTENSION_PILLOW
+    {"PIL__imaging", PyInit__imaging},
+#if CONFIG_LIBLITTLECMS
+    {"PIL__imagingcms", PyInit__imagingcms},
+#endif
+#if CONFIG_LIBFREETYPE
+    {"PIL__imagingft", PyInit__imagingft},
+#endif
+    {"PIL__imagingmath", PyInit__imagingmath},
+    {"PIL__imagingmorph", PyInit__imagingmorph},
+    {"PIL__imagingtk", PyInit__imagingtk},
+#if CONFIG_LIBWEBP
+    {"PIL__webp", PyInit__webp},
+#endif
+#endif
+
     /* Sentinel */
     {0, 0}
 };