summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorJacob Stiffler <j-stiffler@ti.com>2019-12-07 02:11:49 +0000
committerDenys Dmytriyenko <denys@ti.com>2019-12-06 22:38:10 +0000
commitd1ad0605c4d03e005c6df4170e14ecf134a3bf65 (patch)
treed41dc86c9e7888b034e910f636c60f04f5ccccfe /classes
parent3d0ddebddeb53ff781a152b7cd90628e312ced3c (diff)
downloadmeta-ti-d1ad0605c4d03e005c6df4170e14ecf134a3bf65.tar.gz
ti-pdk-fetch: add class for common pdk sources
Recently individual components and LLD sources have been combined into a single PDK repo. Use this class to specify the common source. Also use this class to keep the sources separate from each other when building. This keeps the build identical to previous recipes while keeping control on interdependencies. Similar to gcc-source, use the ti-pdk-source recipe to unpack the sources into a "work-shared" area. Then hard-link only the necessary files into a recipe's WORKDIR. Signed-off-by: Jacob Stiffler <j-stiffler@ti.com> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/ti-pdk-fetch.bbclass43
1 files changed, 43 insertions, 0 deletions
diff --git a/classes/ti-pdk-fetch.bbclass b/classes/ti-pdk-fetch.bbclass
new file mode 100644
index 00000000..e7f88757
--- /dev/null
+++ b/classes/ti-pdk-fetch.bbclass
@@ -0,0 +1,43 @@
1TI_PDK_GIT_URI ?= "git://git.ti.com/processor-sdk/pdk.git"
2TI_PDK_GIT_BRANCH ?= "master"
3TI_PDK_GIT_PROTOCOL ?= "git"
4TI_PDK_SRCREV ?= "69b8b56273fe0c9085fb92d9bfcb7367b724c8af"
5
6TI_PDK_VERSION ?= "2019.11.0"
7
8PV = "${TI_PDK_VERSION}"
9
10TI_PDK_COMP ?= ""
11TI_PDK_COMP_PATH = "${@'${TI_PDK_COMP}'.replace('.','/')}"
12
13TI_PDK_SOURCE_PN = "ti-pdk-source"
14TI_PDK_SOURCE_WORKDIR = "${TMPDIR}/work-shared/ti-pdk-${PV}"
15TI_PDK_SOURCE = "${TI_PDK_SOURCE_WORKDIR}/git"
16
17S = "${WORKDIR}/git/${TI_PDK_COMP_PATH}"
18
19# Hard-link only required sources from PDK
20python do_unpack_append() {
21 if len(d.getVar('TI_PDK_COMP') or '') > 0:
22 import shutil
23
24 # Get src/dst paths
25 src = os.path.join(d.getVar('TI_PDK_SOURCE'),'packages',d.getVar('TI_PDK_COMP_PATH'))
26 s = d.getVar('S')
27
28 # Set up the directory structure, except for the root of the sources
29 # hard-linked.
30 bb.utils.mkdirhier(s)
31 os.rmdir(s)
32
33 # Recursively hard-link the sources
34 shutil.copytree(src, s, copy_function=os.link)
35}
36
37# Make sure that ti-pdk-source is unpacked before we set up the hardlinks.
38python __anonymous () {
39 pn = d.getVar('PN')
40 pdk_src_pn = d.getVar('TI_PDK_SOURCE_PN')
41 if pn != pdk_src_pn:
42 d.appendVarFlag('do_unpack', 'depends', ' ${TI_PDK_SOURCE_PN}:do_unpack')
43}