• 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/python3-000-generate-sysconfigdata-buildir.patch
Maxime RipardMaxime Ripard committed f1c092da8ba29 May 2013
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
changeset:   79745:f85c3f4d9b98
2
parent:      79743:36b2ca7dc893
3
parent:      79744:24d52d3060e8
4
user:        Trent Nelson <trent@trent.me>
5
date:        Tue Oct 16 08:17:11 2012 -0400
6
summary:     Merge issue #15298: ensure _sysconfigdata is generated in build directory,
7
​
8
Taken from upstream.
9
​
10
---
11
 Lib/sysconfig.py |   11 ++++++++++-
12
 Makefile.pre.in  |   24 +++++++++++++-----------
13
 setup.py         |   14 --------------
14
 3 files changed, 23 insertions(+), 26 deletions(-)
15
​
16
Index: Python-3.3.0/Lib/sysconfig.py
17
===================================================================
18
--- Python-3.3.0.orig/Lib/sysconfig.py
19
+++ Python-3.3.0/Lib/sysconfig.py
20
@@ -390,13 +390,22 @@
21
     if _PYTHON_BUILD:
22
         vars['LDSHARED'] = vars['BLDSHARED']
23
 
24
-    destfile = os.path.join(os.path.dirname(__file__), '_sysconfigdata.py')
25
+    pybuilddir = 'build/lib.%s-%s' % (get_platform(), sys.version[:3])
26
+    if hasattr(sys, "gettotalrefcount"):
27
+        pybuilddir += '-pydebug'
28
+    os.makedirs(pybuilddir, exist_ok=True)
29
+    destfile = os.path.join(pybuilddir, '_sysconfigdata.py')
30
+
31
     with open(destfile, 'w', encoding='utf8') as f:
32
         f.write('# system configuration generated and used by'
33
                 ' the sysconfig module\n')
34
         f.write('build_time_vars = ')
35
         pprint.pprint(vars, stream=f)
36
 
37
+    # Create file used for sys.path fixup -- see Modules/getpath.c
38
+    with open('pybuilddir.txt', 'w', encoding='ascii') as f:
39
+        f.write(pybuilddir)
40
+
41
 def _init_posix(vars):
42
     """Initialize the module as appropriate for POSIX systems."""
43
     # _sysconfigdata is generated at build time, see _generate_posix_vars()
44
Index: Python-3.3.0/Makefile.pre.in
45
===================================================================
46
--- Python-3.3.0.orig/Makefile.pre.in
47
+++ Python-3.3.0/Makefile.pre.in
48
@@ -410,8 +410,6 @@
49
        Objects/unicodectype.o \
50
        Objects/weakrefobject.o
51
 
52
-SYSCONFIGDATA=$(srcdir)/Lib/_sysconfigdata.py
53
-
54
 ##########################################################################
55
 # objects that get linked into the Python library
56
 LIBRARY_OBJS_OMIT_FROZEN=  \
57
@@ -432,7 +430,7 @@
58
 
59
 # Default target
60
 all:       build_all
61
-build_all: $(BUILDPYTHON) $(SYSCONFIGDATA) oldsharedmods sharedmods gdbhooks Modules/_testembed
62
+build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Modules/_testembed
63
 
64
 # Compile a binary with gcc profile guided optimization.
65
 profile-opt:
66
@@ -466,15 +464,17 @@
67
 $(BUILDPYTHON):    Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
68
    $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
69
 
70
-platform: $(BUILDPYTHON) $(SYSCONFIGDATA)
71
+platform: $(BUILDPYTHON)
72
    $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform
73
 
74
-# Generate the sysconfig build-time data
75
-$(SYSCONFIGDATA): $(BUILDPYTHON)
76
+# Create build directory and generate the sysconfig build-time data there.
77
+# pybuilddir.txt contains the name of the build dir and is used for
78
+# sys.path fixup -- see Modules/getpath.c.
79
+pybuilddir.txt: $(BUILDPYTHON)
80
    $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars
81
 
82
 # Build the shared modules
83
-sharedmods: $(BUILDPYTHON) $(SYSCONFIGDATA)
84
+sharedmods: $(BUILDPYTHON) pybuilddir.txt
85
    case $$MAKEFLAGS in *s*) quiet=-q; esac; \
86
    $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
87
        $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
88
@@ -1036,7 +1036,7 @@
89
        else    true; \
90
        fi; \
91
    done
92
-   @for i in $(srcdir)/Lib/*.py ; \
  • 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.