diff options
author | Jacob Stiffler <j-stiffler@ti.com> | 2019-12-07 02:11:49 +0000 |
---|---|---|
committer | Denys Dmytriyenko <denys@ti.com> | 2019-12-09 18:15:23 +0000 |
commit | d8a176c3844fc48a09905a376948c40aa434de49 (patch) | |
tree | da5cc709b000905a090830f5c562fae501f1ec17 /classes | |
parent | f35a0fdd869110d268c14ba6925f589152791127 (diff) | |
download | meta-ti-d8a176c3844fc48a09905a376948c40aa434de49.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.bbclass | 43 |
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 @@ | |||
1 | TI_PDK_GIT_URI ?= "git://git.ti.com/processor-sdk/pdk.git" | ||
2 | TI_PDK_GIT_BRANCH ?= "master" | ||
3 | TI_PDK_GIT_PROTOCOL ?= "git" | ||
4 | TI_PDK_SRCREV ?= "69b8b56273fe0c9085fb92d9bfcb7367b724c8af" | ||
5 | |||
6 | TI_PDK_VERSION ?= "2019.11.0" | ||
7 | |||
8 | PV = "${TI_PDK_VERSION}" | ||
9 | |||
10 | TI_PDK_COMP ?= "" | ||
11 | TI_PDK_COMP_PATH = "${@'${TI_PDK_COMP}'.replace('.','/')}" | ||
12 | |||
13 | TI_PDK_SOURCE_PN = "ti-pdk-source" | ||
14 | TI_PDK_SOURCE_WORKDIR = "${TMPDIR}/work-shared/ti-pdk-${PV}" | ||
15 | TI_PDK_SOURCE = "${TI_PDK_SOURCE_WORKDIR}/git" | ||
16 | |||
17 | S = "${WORKDIR}/git/${TI_PDK_COMP_PATH}" | ||
18 | |||
19 | # Hard-link only required sources from PDK | ||
20 | python 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. | ||
38 | python __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 | } | ||