summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2009-11-02 20:43:22 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2009-11-13 12:15:23 +0000
commitd7399bd56c8fc7c58af79ef91dc67382cc23eb47 (patch)
tree40b56eb43f211fbe6bd79d70bc61018e2dcb5751 /meta/classes/base.bbclass
parenta1d93ee3260d8161c7ae14674e01b516b952dea9 (diff)
downloadpoky-d7399bd56c8fc7c58af79ef91dc67382cc23eb47.tar.gz
base.bbclass: Rework staging function to use a DESTDIR style configuration based on the data from the do_install step. This falls back to any standard do_stage function if defined, see the mailing list for more info.
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass68
1 files changed, 59 insertions, 9 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index b536f92e48..086a6d05d0 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -976,15 +976,22 @@ sysroot_stage_dirs() {
976 sysroot_stage_dir $from${datadir} $to${STAGING_DATADIR} 976 sysroot_stage_dir $from${datadir} $to${STAGING_DATADIR}
977} 977}
978 978
979
980sysroot_stage_all() { 979sysroot_stage_all() {
981 sysroot_stage_dirs ${D} ${SYSROOT_DESTDIR} 980 sysroot_stage_dirs ${D} ${SYSROOT_DESTDIR}
982} 981}
983 982
984 983def is_legacy_staging(d):
985base_do_stage () { 984 stagefunc = bb.data.getVar('do_stage', d, True)
986 : 985 legacy = True
987} 986 if stagefunc is None:
987 legacy = False
988 elif stagefunc.strip() == "autotools_stage_all":
989 legacy = False
990 elif stagefunc.strip() == "do_stage_native" and bb.data.getVar('AUTOTOOLS_NATIVE_STAGE_INSTALL', d, 1) == "1":
991 legacy = False
992 if bb.data.getVar('PSTAGE_BROKEN_DESTDIR', d, 1) == "1":
993 legacy = True
994 return legacy
988 995
989do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${bindir} ${STAGING_DIR_TARGET}/${libdir} \ 996do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${bindir} ${STAGING_DIR_TARGET}/${libdir} \
990 ${STAGING_DIR_TARGET}/${includedir} \ 997 ${STAGING_DIR_TARGET}/${includedir} \
@@ -996,19 +1003,60 @@ do_populate_staging[dirs] = "${STAGING_DIR_TARGET}/${bindir} ${STAGING_DIR_TARGE
996# Could be compile but populate_staging and do_install shouldn't run at the same time 1003# Could be compile but populate_staging and do_install shouldn't run at the same time
997addtask populate_staging after do_install 1004addtask populate_staging after do_install
998 1005
1006PSTAGING_ACTIVE = "0"
999SYSROOT_PREPROCESS_FUNCS ?= "" 1007SYSROOT_PREPROCESS_FUNCS ?= ""
1000SYSROOT_DESTDIR = "${WORKDIR}/sysroot-destdir/" 1008SYSROOT_DESTDIR = "${WORKDIR}/sysroot-destdir/"
1001SYSROOT_LOCK = "${STAGING_DIR}/staging.lock" 1009SYSROOT_LOCK = "${STAGING_DIR}/staging.lock"
1002 1010
1011python populate_staging_prehook () {
1012 return
1013}
1014
1015python populate_staging_posthook () {
1016 return
1017}
1018
1019packagedstageing_fastpath () {
1020 :
1021}
1022
1003python do_populate_staging () { 1023python do_populate_staging () {
1004 # 1024 #
1005 # Only run do_stage if its not the empty default above 1025 # if do_stage exists, we're legacy. In that case run the do_stage,
1026 # modify the SYSROOT_DESTDIR variable and then run the staging preprocess
1027 # functions against staging directly.
1006 # 1028 #
1007 stagefunc = bb.data.getVar('do_stage', d, 1).strip() 1029 # Otherwise setup a destdir, copy the results from do_install
1008 if stagefunc != "base_do_stage": 1030 # and run the staging preprocess against that
1031 #
1032 pstageactive = (bb.data.getVar("PSTAGING_ACTIVE", d, True) == "1")
1033 lockfile = bb.data.getVar("SYSROOT_LOCK", d, True)
1034 stagefunc = bb.data.getVar('do_stage', d, True)
1035 legacy = is_legacy_staging(d)
1036 if legacy:
1037 bb.data.setVar("SYSROOT_DESTDIR", "", d)
1038 bb.note("Legacy staging mode for %s" % bb.data.getVar("FILE", d, True))
1039 lock = bb.utils.lockfile(lockfile)
1009 bb.build.exec_func('do_stage', d) 1040 bb.build.exec_func('do_stage', d)
1041 bb.build.exec_func('populate_staging_prehook', d)
1042 for f in (bb.data.getVar('SYSROOT_PREPROCESS_FUNCS', d, True) or '').split():
1043 bb.build.exec_func(f, d)
1044 bb.build.exec_func('populate_staging_posthook', d)
1045 bb.utils.unlockfile(lock)
1046 else:
1047 dest = bb.data.getVar('D', d, True)
1048 sysrootdest = bb.data.expand('${SYSROOT_DESTDIR}${STAGING_DIR_TARGET}', d)
1049 bb.mkdirhier(sysrootdest)
1050
1051 bb.build.exec_func("sysroot_stage_all", d)
1052 #os.system('cp -pPR %s/* %s/' % (dest, sysrootdest))
1010 for f in (bb.data.getVar('SYSROOT_PREPROCESS_FUNCS', d, True) or '').split(): 1053 for f in (bb.data.getVar('SYSROOT_PREPROCESS_FUNCS', d, True) or '').split():
1011 bb.build.exec_func(f, d) 1054 bb.build.exec_func(f, d)
1055 bb.build.exec_func("packagedstageing_fastpath", d)
1056
1057 lock = bb.utils.lockfile(lockfile)
1058 os.system('cp -pPR %s/* /' % (sysrootdest))
1059 bb.utils.unlockfile(lock)
1012} 1060}
1013 1061
1014addtask install after do_compile 1062addtask install after do_compile
@@ -1149,6 +1197,8 @@ def base_after_parse(d):
1149 1197
1150python () { 1198python () {
1151 base_after_parse(d) 1199 base_after_parse(d)
1200 if is_legacy_staging(d):
1201 bb.debug(1, "Legacy staging mode for %s" % bb.data.getVar("FILE", d, True))
1152} 1202}
1153 1203
1154def check_app_exists(app, d): 1204def check_app_exists(app, d):
@@ -1175,7 +1225,7 @@ inherit patch
1175# Move to autotools.bbclass? 1225# Move to autotools.bbclass?
1176inherit siteinfo 1226inherit siteinfo
1177 1227
1178EXPORT_FUNCTIONS do_setscene do_clean do_fetch do_unpack do_configure do_compile do_install do_package do_populate_pkgs do_stage do_rebuild do_fetchall 1228EXPORT_FUNCTIONS do_setscene do_clean do_fetch do_unpack do_configure do_compile do_install do_package do_populate_pkgs do_rebuild do_fetchall
1179 1229
1180MIRRORS[func] = "0" 1230MIRRORS[func] = "0"
1181MIRRORS () { 1231MIRRORS () {