mirror of
https://git.yoctoproject.org/meta-ti
synced 2026-01-12 01:20:20 +00:00
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>
This commit is contained in:
committed by
Denys Dmytriyenko
parent
f35a0fdd86
commit
d8a176c384
43
classes/ti-pdk-fetch.bbclass
Normal file
43
classes/ti-pdk-fetch.bbclass
Normal file
@@ -0,0 +1,43 @@
|
||||
TI_PDK_GIT_URI ?= "git://git.ti.com/processor-sdk/pdk.git"
|
||||
TI_PDK_GIT_BRANCH ?= "master"
|
||||
TI_PDK_GIT_PROTOCOL ?= "git"
|
||||
TI_PDK_SRCREV ?= "69b8b56273fe0c9085fb92d9bfcb7367b724c8af"
|
||||
|
||||
TI_PDK_VERSION ?= "2019.11.0"
|
||||
|
||||
PV = "${TI_PDK_VERSION}"
|
||||
|
||||
TI_PDK_COMP ?= ""
|
||||
TI_PDK_COMP_PATH = "${@'${TI_PDK_COMP}'.replace('.','/')}"
|
||||
|
||||
TI_PDK_SOURCE_PN = "ti-pdk-source"
|
||||
TI_PDK_SOURCE_WORKDIR = "${TMPDIR}/work-shared/ti-pdk-${PV}"
|
||||
TI_PDK_SOURCE = "${TI_PDK_SOURCE_WORKDIR}/git"
|
||||
|
||||
S = "${WORKDIR}/git/${TI_PDK_COMP_PATH}"
|
||||
|
||||
# Hard-link only required sources from PDK
|
||||
python do_unpack_append() {
|
||||
if len(d.getVar('TI_PDK_COMP') or '') > 0:
|
||||
import shutil
|
||||
|
||||
# Get src/dst paths
|
||||
src = os.path.join(d.getVar('TI_PDK_SOURCE'),'packages',d.getVar('TI_PDK_COMP_PATH'))
|
||||
s = d.getVar('S')
|
||||
|
||||
# Set up the directory structure, except for the root of the sources
|
||||
# hard-linked.
|
||||
bb.utils.mkdirhier(s)
|
||||
os.rmdir(s)
|
||||
|
||||
# Recursively hard-link the sources
|
||||
shutil.copytree(src, s, copy_function=os.link)
|
||||
}
|
||||
|
||||
# Make sure that ti-pdk-source is unpacked before we set up the hardlinks.
|
||||
python __anonymous () {
|
||||
pn = d.getVar('PN')
|
||||
pdk_src_pn = d.getVar('TI_PDK_SOURCE_PN')
|
||||
if pn != pdk_src_pn:
|
||||
d.appendVarFlag('do_unpack', 'depends', ' ${TI_PDK_SOURCE_PN}:do_unpack')
|
||||
}
|
||||
33
recipes-bsp/ti-pdk-source/ti-pdk-source_git.bb
Normal file
33
recipes-bsp/ti-pdk-source/ti-pdk-source_git.bb
Normal file
@@ -0,0 +1,33 @@
|
||||
# Recipe to fetch/unpack sources used by ti-pdk-fetch recipes.
|
||||
#
|
||||
# Mimic gcc-source.inc from oe-core.
|
||||
|
||||
# These shources will be unpacked to a "work-shared" directory. Then each
|
||||
# "ti-pdk-fetch" recipe will hard-link only the sources it requires.
|
||||
|
||||
deltask do_configure
|
||||
deltask do_compile
|
||||
deltask do_install
|
||||
deltask do_populate_sysroot
|
||||
deltask do_populate_lic
|
||||
|
||||
RM_WORK_EXCLUDE += "${PN}"
|
||||
EXCLUDE_FROM_WORLD = "1"
|
||||
|
||||
inherit nopackages ti-pdk-fetch
|
||||
|
||||
LICENSE = "BSD-3-Clause"
|
||||
|
||||
PN = "${TI_PDK_SOURCE_PN}"
|
||||
WORKDIR = "${TI_PDK_SOURCE_WORKDIR}"
|
||||
SSTATE_SWSPEC = "sstate:ti-pdk::${PV}:${PR}::${SSTATE_VERSION}:"
|
||||
|
||||
STAMP = "${STAMPS_DIR}/work-shared/ti-pdk-${PV}"
|
||||
STAMPCLEAN = "${STAMPS_DIR}/work-shared/ti-pdk-${PV}*"
|
||||
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
DEPENDS = ""
|
||||
PACKAGES = ""
|
||||
|
||||
SRC_URI = "${TI_PDK_GIT_URI};branch=${TI_PDK_GIT_BRANCH};protocol=${TI_PDK_GIT_PROTOCOL}"
|
||||
SRCREV = "${TI_PDK_SRCREV}"
|
||||
Reference in New Issue
Block a user