world: rework cmake sanity and sysroot alignment

This is a panic commit in the middle of development - have the feeling my host
dies...

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
This commit is contained in:
Andreas Müller
2016-08-31 21:25:11 +02:00
parent ee9a61fb25
commit 31f95ec92d
46 changed files with 126 additions and 65 deletions

View File

@@ -1,3 +1,5 @@
inherit cmake_sysroot
# do_install_append_class-cross does not work so hack
do_install_prepend_class-native() {
no_staging_check=true
@@ -34,6 +36,7 @@ do_install_append() {
bbwarn "$f contains links to build host sysroot!"
error=true
fi
done
if [ x != x$error ] ; then
@@ -41,3 +44,28 @@ do_install_append() {
fi
fi
}
do_populate_sysroot[postfuncs] += "do_sysroot_cmake_sanity "
# check sysroot cmake files for links not relative and not to sysroots
do_sysroot_cmake_sanity() {
error=
for f in `cat ${CMAKEINSTALLED}` ; do
if grep -q ';${libdir}' "$f" ; then
bbwarn "$f contains links to ${libdir}!"
error=true
fi
if grep -q ';${includedir}' "$f" ; then
bbwarn "$f contains links to ${includedir}!"
error=true
fi
if grep -q '\"${includedir}' "$f" ; then
bbwarn "$f contains links to ${includedir}!"
error=true
fi
done
if [ x != x$error ] ; then
bbfatal "One or more files in sysroot contain links to ${prefix}"
fi
}

View File

@@ -55,9 +55,7 @@
# CMAKE_ALIGN_SYSROOT[<unique-id>] = "ignore"
#
# filename for the file containg full names of all cmakefiles staged
CMAKEINSTALLED = "${WORKDIR}/staged_cmake_files"
inherit cmake_sysroot
# global helper to get CMAKE_ALIGN_SYSROOT array
def get_align_flags(d):
@@ -89,25 +87,10 @@ python () {
if num != 3:
bb.fatal('CMAKE_ALIGN_SYSROOT[%s] requires 3 parameters (dir, search, replace) in %s' % (flag, pn))
else:
bb.fatal('The recipe %s inherits cmake-lib but does not set CMAKE_ALIGN_SYSROOT' % pn)
bb.fatal('The recipe %s inherits cmake_lib but does not set CMAKE_ALIGN_SYSROOT' % pn)
}
# 2. remove tmp file from last build
python do_populate_sysroot_prepend() {
tmpfile = d.getVar('CMAKEINSTALLED', True)
if os.path.isfile(tmpfile):
os.remove(tmpfile)
}
# 3. keep cmake files staged to sysroot
sysroot_stage_dir_append() {
# avoid doubles causing double replacement
for file in `find $dest -name '*.cmake'`; do
if ! grep -q "$file" ${CMAKEINSTALLED} ; then
echo "$file" >> ${CMAKEINSTALLED}
fi
done
}
# 2. 3. in cmake_sysroot
# 4. Handle CMAKE_ALIGN_SYSROOT
python do_populate_sysroot_append() {

View File

@@ -0,0 +1,22 @@
# class to keep cmake files staged to sysroot for modifications/checks
# filename for the file containg full names of all cmakefiles staged
CMAKEINSTALLED = "${WORKDIR}/staged_cmake_files"
# 1. remove tmp file from last build
python do_populate_sysroot_prepend() {
tmpfile = d.getVar('CMAKEINSTALLED', True)
if os.path.isfile(tmpfile):
os.remove(tmpfile)
}
# 2. keep cmake files staged to sysroot
sysroot_stage_dir_append() {
# avoid doubles causing double replacement
for file in `find $dest -name '*.cmake'`; do
if ! grep -q "$file" ${CMAKEINSTALLED} ; then
echo "$file" >> ${CMAKEINSTALLED}
fi
done
}

View File

@@ -2,7 +2,7 @@ SRC_URI = "git://github.com/hawaii-desktop/${BPN}.git"
DEPENDS += "qtbase qtdeclarative qtquickcontrols extra-cmake-modules-native"
inherit cmake_qt5 cmake-extra-sanity pkgconfig
inherit cmake_qt5 cmake_extra_sanity pkgconfig
EXTRA_OECMAKE += " \
-DQML_INSTALL_DIR=${OE_QMAKE_PATH_QML} \

View File

@@ -17,7 +17,7 @@ ${KDE_MIRROR} http://kde.c3sl.ufpr.br \n \
SRC_URI = "${KDE_MIRROR}/stable/${BPN}/${PV}/src/${BPN}-${PV}.tar.xz"
# extra-cmake-modules cause dependent to check for python
inherit cmake_qt5 cmake-extra-sanity pythonnative
inherit cmake_qt5 cmake_extra_sanity pythonnative
do_compile_prepend() {
export XDG_DATA_HOME=${STAGING_DATADIR}

View File

@@ -1,4 +1,4 @@
inherit cmake_qt5 cmake-extra-sanity qt5-translation
inherit cmake_qt5 cmake_extra_sanity qt5-translation
HOMEPAGE = "http://lxqt.org/"