python3-103-optional-sqlite.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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: b/configure.ac
  9. ===================================================================
  10. --- a/configure.ac
  11. +++ b/configure.ac
  12. @@ -2666,6 +2666,15 @@
  13. AC_CHECK_FUNCS(pthread_atfork)
  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: b/Makefile.pre.in
  27. ===================================================================
  28. --- a/Makefile.pre.in
  29. +++ b/Makefile.pre.in
  30. @@ -1131,7 +1131,6 @@
  31. email email/mime \
  32. ensurepip ensurepip/_bundled \
  33. html json http dbm xmlrpc \
  34. - sqlite3 \
  35. logging csv wsgiref urllib \
  36. ctypes ctypes/macholib \
  37. idlelib idlelib/Icons \
  38. @@ -1173,7 +1172,7 @@
  39. test/namespace_pkgs/project3/parent/child \
  40. test/namespace_pkgs/module_and_namespace_package \
  41. test/namespace_pkgs/module_and_namespace_package/a_test \
  42. - sqlite3/test idlelib/idle_test \
  43. + idlelib/idle_test \
  44. test/test_importlib test/test_importlib/builtin \
  45. test/test_importlib/extension test/test_importlib/frozen \
  46. test/test_importlib/import_ test/test_importlib/source \
  47. @@ -1192,6 +1191,11 @@
  48. lib2to3/tests/data/fixers/myfixes
  49. endif
  50. +ifeq (@SQLITE3@,yes)
  51. +LIBSUBDIRS += sqlite3
  52. +TESTSUBDIRS += sqlite3/test
  53. +endif
  54. +
  55. ifeq (@TEST_MODULES@,yes)
  56. LIBSUBDIRS += $(TESTSUBDIRS)
  57. endif