From 15428fa009200785eee1f1950169703cd74ab938 Mon Sep 17 00:00:00 2001 From: Andrei Tatar Date: Tue, 29 Aug 2023 02:17:05 +0200 Subject: [PATCH] Add support for the Pillow extension 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 Reviewed-by: Stefan Jumarea Reviewed-by: Radu Nichita Approved-by: Razvan Deaconescu GitHub-Closes: #22 --- Config.uk | 6 ++++++ modules_config.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/Config.uk b/Config.uk index f8f55d6..5a3ff92 100644 --- 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 diff --git a/modules_config.c b/modules_config.c index 2e5f58e..1829eee 100644 --- a/modules_config.c +++ b/modules_config.c @@ -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} }; -- 2.39.5