• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/python3/101-optional-pydoc.patch
Thomas PetazzoniThomas Petazzoni committed c24c874810028 Dec 2014
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
Add an option to disable pydoc
2
​
3
It removes 0.5 MB of data from the target plus the pydoc script
4
itself.
5
​
6
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
7
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
8
​
9
---
10
 Makefile.pre.in |    8 +++++++-
11
 configure.ac    |    5 +++++
12
 setup.py        |    9 +++++++--
13
 3 files changed, 19 insertions(+), 3 deletions(-)
14
​
15
Index: b/Makefile.pre.in
16
===================================================================
17
--- a/Makefile.pre.in
18
+++ b/Makefile.pre.in
19
@@ -1102,7 +1102,9 @@
20
    -rm -f $(DESTDIR)$(BINDIR)/idle3
21
    (cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
22
    -rm -f $(DESTDIR)$(BINDIR)/pydoc3
23
+ifeq (@PYDOC@,yes)
24
    (cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
25
+endif
26
    -rm -f $(DESTDIR)$(BINDIR)/2to3
27
    (cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
28
    -rm -f $(DESTDIR)$(BINDIR)/pyvenv
29
@@ -1153,7 +1155,7 @@
30
        multiprocessing multiprocessing/dummy \
31
        unittest \
32
        venv venv/scripts venv/scripts/posix \
33
-       curses pydoc_data $(MACHDEPS)
34
+       curses $(MACHDEPS)
35
 
36
 TESTSUBDIRS =  tkinter/test tkinter/test/test_tkinter tkinter/test/test_ttk \
37
        test test/test_asyncio \
38
@@ -1197,6 +1199,10 @@
39
        test/test_importlib/import_ test/test_importlib/source \
40
        unittest/test unittest/test/testmock
41
 
42
+ifeq (@PYDOC@,yes)
43
+LIBSUBDIRS += pydoc_data
44
+endif
45
+
46
 ifeq (@TEST_MODULES@,yes)
47
 LIBSUBDIRS += $(TESTSUBDIRS)
48
 endif
49
Index: b/configure.ac
50
===================================================================
51
--- a/configure.ac
52
+++ b/configure.ac
53
@@ -2672,6 +2672,11 @@
54
       AC_CHECK_FUNCS(pthread_atfork)
55
 fi
56
 
57
+AC_SUBST(PYDOC)
58
+
59
+AC_ARG_ENABLE(pydoc,
60
+   AS_HELP_STRING([--disable-pydoc], [disable pydoc]),
61
+   [ PYDOC="${enableval}" ], [ PYDOC=yes ])
62
 
63
 AC_SUBST(TEST_MODULES)
64
 
65
Index: b/setup.py
66
===================================================================
67
--- a/setup.py
68
+++ b/setup.py
69
@@ -2212,6 +2212,12 @@
70
     # turn off warnings when deprecated modules are imported
71
     import warnings
72
     warnings.filterwarnings("ignore",category=DeprecationWarning)
73
+
74
+    scripts = ['Tools/scripts/idle3', 'Tools/scripts/2to3',
75
+               'Lib/smtpd.py']
76
+    if not '--disable-pydoc' in sysconfig.get_config_var("CONFIG_ARGS"):
77
+        scripts += [ 'Tools/scripts/pydoc3' ]
78
+
79
     setup(# PyPI Metadata (PEP 301)
80
           name = "Python",
81
           version = sys.version.split()[0],
82
@@ -2236,8 +2242,7 @@
83
           # If you change the scripts installed here, you also need to
84
           # check the PyBuildScripts command above, and change the links
85
           # created by the bininstall target in Makefile.pre.in
86
-          scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3",
87
-                     "Tools/scripts/2to3", "Tools/scripts/pyvenv"]
88
+          scripts = scripts,
89
         )
90
 
91
 # --install-platlib
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.