python3-103-optional-sqlite.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. Add option to disable the sqlite3 module
  2. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Signed-off-by: Samuel Martin <s.martin49@gmail.com>
  4. ---
  5. Makefile.pre.in | 9 +++++++--
  6. configure.ac | 9 +++++++++
  7. 2 files changed, 16 insertions(+), 2 deletions(-)
  8. Index: cpython/configure.ac
  9. ===================================================================
  10. --- cpython.orig/configure.ac
  11. +++ cpython/configure.ac
  12. @@ -2448,6 +2448,15 @@
  13. esac])
  14. fi
  15. +AC_SUBST(SQLITE3)
  16. +AC_ARG_ENABLE(sqlite3,
  17. + AS_HELP_STRING([--disable-sqlite3], [disable sqlite3]),
  18. + [ SQLITE3="${enableval}" ], [ SQLITE3=yes ])
  19. +
  20. +if test "$SQLITE3" = "no" ; then
  21. + DISABLED_EXTENSIONS="${DISABLED_EXTENSIONS} _sqlite3"
  22. +fi
  23. +
  24. AC_SUBST(PYDOC)
  25. AC_ARG_ENABLE(pydoc,
  26. Index: cpython/Makefile.pre.in
  27. ===================================================================
  28. --- cpython.orig/Makefile.pre.in
  29. +++ cpython/Makefile.pre.in
  30. @@ -985,7 +985,6 @@
  31. collections concurrent concurrent/futures encodings \
  32. email email/mime \
  33. html json http dbm xmlrpc \
  34. - sqlite3 \
  35. logging csv wsgiref urllib \
  36. ctypes ctypes/macholib idlelib idlelib/Icons \
  37. distutils distutils/command $(XMLLIBSUBDIRS) \
  38. @@ -1025,7 +1024,6 @@
  39. test/namespace_pkgs/module_and_namespace_package/a_test \
  40. test/test_email test/test_email/data \
  41. test/json_tests \
  42. - sqlite3/test \
  43. ctypes/test \
  44. distutils/tests \
  45. test/test_importlib test/test_importlib/builtin \
  46. @@ -1048,6 +1046,13 @@
  47. endif
  48. endif
  49. +ifeq (@SQLITE3@,yes)
  50. +LIBSUBDIRS += sqlite3
  51. +ifeq (@TEST_MODULES@,yes)
  52. +LIBSUBDIRS += sqlite3/test
  53. +endif
  54. +endif
  55. +
  56. libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
  57. @for i in $(SCRIPTDIR) $(LIBDEST); \
  58. do \