diff options
Diffstat (limited to 'meta/classes/externalsrc.bbclass')
-rw-r--r-- | meta/classes/externalsrc.bbclass | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index 31908c3ca2..5ba6c3472b 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass | |||
@@ -28,34 +28,34 @@ SRCTREECOVEREDTASKS ?= "do_patch do_unpack do_fetch" | |||
28 | EXTERNALSRC_SYMLINKS ?= "oe-workdir:${WORKDIR} oe-logs:${T}" | 28 | EXTERNALSRC_SYMLINKS ?= "oe-workdir:${WORKDIR} oe-logs:${T}" |
29 | 29 | ||
30 | python () { | 30 | python () { |
31 | externalsrc = d.getVar('EXTERNALSRC', True) | 31 | externalsrc = d.getVar('EXTERNALSRC') |
32 | 32 | ||
33 | # If this is the base recipe and EXTERNALSRC is set for it or any of its | 33 | # If this is the base recipe and EXTERNALSRC is set for it or any of its |
34 | # derivatives, then enable BB_DONT_CACHE to force the recipe to always be | 34 | # derivatives, then enable BB_DONT_CACHE to force the recipe to always be |
35 | # re-parsed so that the file-checksums function for do_compile is run every | 35 | # re-parsed so that the file-checksums function for do_compile is run every |
36 | # time. | 36 | # time. |
37 | bpn = d.getVar('BPN', True) | 37 | bpn = d.getVar('BPN') |
38 | if bpn == d.getVar('PN', True): | 38 | if bpn == d.getVar('PN'): |
39 | classextend = (d.getVar('BBCLASSEXTEND', True) or '').split() | 39 | classextend = (d.getVar('BBCLASSEXTEND') or '').split() |
40 | if (externalsrc or | 40 | if (externalsrc or |
41 | ('native' in classextend and | 41 | ('native' in classextend and |
42 | d.getVar('EXTERNALSRC_pn-%s-native' % bpn, True)) or | 42 | d.getVar('EXTERNALSRC_pn-%s-native' % bpn)) or |
43 | ('nativesdk' in classextend and | 43 | ('nativesdk' in classextend and |
44 | d.getVar('EXTERNALSRC_pn-nativesdk-%s' % bpn, True)) or | 44 | d.getVar('EXTERNALSRC_pn-nativesdk-%s' % bpn)) or |
45 | ('cross' in classextend and | 45 | ('cross' in classextend and |
46 | d.getVar('EXTERNALSRC_pn-%s-cross' % bpn, True))): | 46 | d.getVar('EXTERNALSRC_pn-%s-cross' % bpn))): |
47 | d.setVar('BB_DONT_CACHE', '1') | 47 | d.setVar('BB_DONT_CACHE', '1') |
48 | 48 | ||
49 | if externalsrc: | 49 | if externalsrc: |
50 | d.setVar('S', externalsrc) | 50 | d.setVar('S', externalsrc) |
51 | externalsrcbuild = d.getVar('EXTERNALSRC_BUILD', True) | 51 | externalsrcbuild = d.getVar('EXTERNALSRC_BUILD') |
52 | if externalsrcbuild: | 52 | if externalsrcbuild: |
53 | d.setVar('B', externalsrcbuild) | 53 | d.setVar('B', externalsrcbuild) |
54 | else: | 54 | else: |
55 | d.setVar('B', '${WORKDIR}/${BPN}-${PV}/') | 55 | d.setVar('B', '${WORKDIR}/${BPN}-${PV}/') |
56 | 56 | ||
57 | local_srcuri = [] | 57 | local_srcuri = [] |
58 | fetch = bb.fetch2.Fetch((d.getVar('SRC_URI', True) or '').split(), d) | 58 | fetch = bb.fetch2.Fetch((d.getVar('SRC_URI') or '').split(), d) |
59 | for url in fetch.urls: | 59 | for url in fetch.urls: |
60 | url_data = fetch.ud[url] | 60 | url_data = fetch.ud[url] |
61 | parm = url_data.parm | 61 | parm = url_data.parm |
@@ -94,7 +94,7 @@ python () { | |||
94 | # Note that we cannot use d.appendVarFlag() here because deps is expected to be a list object, not a string | 94 | # Note that we cannot use d.appendVarFlag() here because deps is expected to be a list object, not a string |
95 | d.setVarFlag('do_configure', 'deps', (d.getVarFlag('do_configure', 'deps', False) or []) + ['do_unpack']) | 95 | d.setVarFlag('do_configure', 'deps', (d.getVarFlag('do_configure', 'deps', False) or []) + ['do_unpack']) |
96 | 96 | ||
97 | for task in d.getVar("SRCTREECOVEREDTASKS", True).split(): | 97 | for task in d.getVar("SRCTREECOVEREDTASKS").split(): |
98 | if local_srcuri and task in fetch_tasks: | 98 | if local_srcuri and task in fetch_tasks: |
99 | continue | 99 | continue |
100 | bb.build.deltask(task, d) | 100 | bb.build.deltask(task, d) |
@@ -106,13 +106,13 @@ python () { | |||
106 | d.setVarFlag('do_configure', 'file-checksums', '${@srctree_configure_hash_files(d)}') | 106 | d.setVarFlag('do_configure', 'file-checksums', '${@srctree_configure_hash_files(d)}') |
107 | 107 | ||
108 | # We don't want the workdir to go away | 108 | # We don't want the workdir to go away |
109 | d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN', True)) | 109 | d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN')) |
110 | 110 | ||
111 | # If B=S the same builddir is used even for different architectures. | 111 | # If B=S the same builddir is used even for different architectures. |
112 | # Thus, use a shared CONFIGURESTAMPFILE and STAMP directory so that | 112 | # Thus, use a shared CONFIGURESTAMPFILE and STAMP directory so that |
113 | # change of do_configure task hash is correctly detected and stamps are | 113 | # change of do_configure task hash is correctly detected and stamps are |
114 | # invalidated if e.g. MACHINE changes. | 114 | # invalidated if e.g. MACHINE changes. |
115 | if d.getVar('S', True) == d.getVar('B', True): | 115 | if d.getVar('S') == d.getVar('B'): |
116 | configstamp = '${TMPDIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}/configure.sstate' | 116 | configstamp = '${TMPDIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}/configure.sstate' |
117 | d.setVar('CONFIGURESTAMPFILE', configstamp) | 117 | d.setVar('CONFIGURESTAMPFILE', configstamp) |
118 | d.setVar('STAMP', '${STAMPS_DIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}') | 118 | d.setVar('STAMP', '${STAMPS_DIR}/work-shared/${PN}/${EXTENDPE}${PV}-${PR}') |
@@ -120,10 +120,10 @@ python () { | |||
120 | 120 | ||
121 | python externalsrc_configure_prefunc() { | 121 | python externalsrc_configure_prefunc() { |
122 | # Create desired symlinks | 122 | # Create desired symlinks |
123 | symlinks = (d.getVar('EXTERNALSRC_SYMLINKS', True) or '').split() | 123 | symlinks = (d.getVar('EXTERNALSRC_SYMLINKS') or '').split() |
124 | for symlink in symlinks: | 124 | for symlink in symlinks: |
125 | symsplit = symlink.split(':', 1) | 125 | symsplit = symlink.split(':', 1) |
126 | lnkfile = os.path.join(d.getVar('S', True), symsplit[0]) | 126 | lnkfile = os.path.join(d.getVar('S'), symsplit[0]) |
127 | target = d.expand(symsplit[1]) | 127 | target = d.expand(symsplit[1]) |
128 | if len(symsplit) > 1: | 128 | if len(symsplit) > 1: |
129 | if os.path.islink(lnkfile): | 129 | if os.path.islink(lnkfile): |
@@ -139,7 +139,7 @@ python externalsrc_configure_prefunc() { | |||
139 | 139 | ||
140 | python externalsrc_compile_prefunc() { | 140 | python externalsrc_compile_prefunc() { |
141 | # Make it obvious that this is happening, since forgetting about it could lead to much confusion | 141 | # Make it obvious that this is happening, since forgetting about it could lead to much confusion |
142 | bb.plain('NOTE: %s: compiling from external source tree %s' % (d.getVar('PN', True), d.getVar('EXTERNALSRC', True))) | 142 | bb.plain('NOTE: %s: compiling from external source tree %s' % (d.getVar('PN'), d.getVar('EXTERNALSRC'))) |
143 | } | 143 | } |
144 | 144 | ||
145 | def srctree_hash_files(d): | 145 | def srctree_hash_files(d): |
@@ -147,7 +147,7 @@ def srctree_hash_files(d): | |||
147 | import subprocess | 147 | import subprocess |
148 | import tempfile | 148 | import tempfile |
149 | 149 | ||
150 | s_dir = d.getVar('EXTERNALSRC', True) | 150 | s_dir = d.getVar('EXTERNALSRC') |
151 | git_dir = os.path.join(s_dir, '.git') | 151 | git_dir = os.path.join(s_dir, '.git') |
152 | oe_hash_file = os.path.join(git_dir, 'oe-devtool-tree-sha1') | 152 | oe_hash_file = os.path.join(git_dir, 'oe-devtool-tree-sha1') |
153 | 153 | ||
@@ -165,7 +165,7 @@ def srctree_hash_files(d): | |||
165 | fobj.write(sha1) | 165 | fobj.write(sha1) |
166 | ret = oe_hash_file + ':True' | 166 | ret = oe_hash_file + ':True' |
167 | else: | 167 | else: |
168 | ret = d.getVar('EXTERNALSRC', True) + '/*:True' | 168 | ret = d.getVar('EXTERNALSRC') + '/*:True' |
169 | return ret | 169 | return ret |
170 | 170 | ||
171 | def srctree_configure_hash_files(d): | 171 | def srctree_configure_hash_files(d): |
@@ -173,7 +173,7 @@ def srctree_configure_hash_files(d): | |||
173 | Get the list of files that should trigger do_configure to re-execute, | 173 | Get the list of files that should trigger do_configure to re-execute, |
174 | based on the value of CONFIGURE_FILES | 174 | based on the value of CONFIGURE_FILES |
175 | """ | 175 | """ |
176 | in_files = (d.getVar('CONFIGURE_FILES', True) or '').split() | 176 | in_files = (d.getVar('CONFIGURE_FILES') or '').split() |
177 | out_items = [] | 177 | out_items = [] |
178 | search_files = [] | 178 | search_files = [] |
179 | for entry in in_files: | 179 | for entry in in_files: |
@@ -182,7 +182,7 @@ def srctree_configure_hash_files(d): | |||
182 | else: | 182 | else: |
183 | search_files.append(entry) | 183 | search_files.append(entry) |
184 | if search_files: | 184 | if search_files: |
185 | s_dir = d.getVar('EXTERNALSRC', True) | 185 | s_dir = d.getVar('EXTERNALSRC') |
186 | for root, _, files in os.walk(s_dir): | 186 | for root, _, files in os.walk(s_dir): |
187 | for f in files: | 187 | for f in files: |
188 | if f in search_files: | 188 | if f in search_files: |