Postinstall intercept fall-back solution + leftover patches with postinstall fixes
cover Postinstall intercept fall-back solution + leftover patches with postinstall fixes
Hi all,
This patchset adds the fall-back solution to intercept hooks. That is, if intercept hooks fail than the postinstalls will run on target, at first boot. This way we will avoid unwanted situations when the intercept hooks fail and the build cannot complete. The previous solution had some issue with adding the final package names to the intercept hook. So, after having a discussion with Richard, we agreed to use a separate directory in scripts/ where we can put all the intercept hooks. This solution also avoids adding extra, unnecesary code (from the target point of view), to the postinstall scriptlets.
Besides this, there are other postinstall fixes from a previous patchset that I adviced not to be merged so I can resend them with the latest changes in place.
Thanks,
Laurentiu
The following changes since commit 02d2a5e68cab490cb83db6e4f2f0802221efe8a2:
distro_check: Remove creation of empty Meego filelist. (2013-02-12 13:22:44 +0000)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib lpalcu/intercept
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=lpalcu/intercept
Laurentiu Palcu (11):
Add separate directory for postinstall intercepts image.bbclass: add fall-back functionality when running intercepts rootfs_(ipk|deb|rpm).bbclass: check package installation status after
ROOTFS_POSTPROCESS_COMMAND
gtk-icon-cache.bbclass: use postinst_intercept script fontcache.bbclass: use the postinst_intercept script
Add pixbufcache class
gdk-pixbuf: use the new pixbufcache class
librsvg: use the new pixbufcache class
gnome-keyring: compile schemas on host
gtk-immodules-cache: add weak asignment for GTKIMMODULES_PACKAGES gtk+: use gtk-immodules-cache class
meta/classes/fontcache.bbclass | 20 +++----- meta/classes/gtk-icon-cache.bbclass | 39 ++++----------- meta/classes/gtk-immodules-cache.bbclass | 2 + meta/classes/image.bbclass | 43 ++++++++++++++--- meta/classes/pixbufcache.bbclass | 50 ++++++++++++++++++++ meta/classes/rootfs_deb.bbclass | 14 +++--- meta/classes/rootfs_ipk.bbclass | 13 +++-- meta/classes/rootfs_rpm.bbclass | 20 ++++---- meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.26.5.bb | 48 ++----------------- meta/recipes-gnome/gnome/gnome-keyring_2.32.1.bb | 12 +---- meta/recipes-gnome/gtk+/gtk+.inc | 8 +--- meta/recipes-gnome/gtk+/gtk+3_3.4.4.bb | 12 +---- meta/recipes-gnome/gtk+/gtk+_2.24.14.bb | 4 +- meta/recipes-gnome/librsvg/librsvg_2.32.1.bb | 21 ++------ scripts/postinst-intercepts/postinst_intercept | 37 +++++++++++++++ scripts/postinst-intercepts/update_font_cache | 7 +++ scripts/postinst-intercepts/update_icon_cache | 12 +++++ scripts/postinst-intercepts/update_pixbuf_cache | 10 ++++ 18 files changed, 207 insertions(+), 165 deletions(-) create mode 100644 meta/classes/pixbufcache.bbclass create mode 100755 scripts/postinst-intercepts/postinst_intercept create mode 100644 scripts/postinst-intercepts/update_font_cache create mode 100644 scripts/postinst-intercepts/update_icon_cache create mode 100644 scripts/postinst-intercepts/update_pixbuf_cache
Signature · 1 line
1.7.9.5
PATCH 1/11 Add separate directory for postinstall intercepts
The scripts/postinst-intercepts will contain all postinstall hooks that we need to run after all packages have been installed.
If one wants to install such a postinst hook, all it needs to do is put the hook in this directory and, from the package postinstall scriptlet, call:
postinst_intercept <hook_name> <package_name> <var1=...> ...
This will, practically, add the package_name in the list of packages that need the hook to run and, also, set any variables that would be needed in the hook. For example, variables like ${libdir}, ${bindir}, etc. that might depend on distribution can be passed on to the script in this way.
--- scripts/postinst-intercepts/postinst_intercept | 37 +++++++++++++++++++++++ scripts/postinst-intercepts/update_font_cache | 7 +++++ scripts/postinst-intercepts/update_icon_cache | 12 ++++++++ scripts/postinst-intercepts/update_pixbuf_cache | 10 ++++++ 4 files changed, 66 insertions(+) create mode 100755 scripts/postinst-intercepts/postinst_intercept create mode 100644 scripts/postinst-intercepts/update_font_cache create mode 100644 scripts/postinst-intercepts/update_icon_cache create mode 100644 scripts/postinst-intercepts/update_pixbuf_cache
scripts/postinst-intercepts/postinst_intercept new file +37 -0
@@ -0,0 +1,37 @@ +#!/bin/sh +# +# This script is called from inside postinstall scriptlets at do_rootfs time. It +# actually adds, at the end, the list of packages for which the intercept script +# is valid. Also, if one wants to pass any variables to the intercept script from +# the postinstall itself, they will be added immediately after the shebang line. +# +# Usage: postinst_intercept <intercept_script_name> <package_name> <var1=...> ... <varN=...> +# * intercept_script_name - the name of the intercept script we want to change; +# * package_name - add the package_name to list of packages the intercept script +# is used for; +# * var1=... - var1 will have the value we provide in the intercept script. This +# is useful when we want to pass on variables like ${libdir} to +# the intercept script; +# +[ $# -lt 2 ] && exit 1 + +intercept_script=$INTERCEPT_DIR/$1 && shift +package_name=$1 && shift + +[ -f "$intercept_script" ] || exit 1 + +chmod +x "$intercept_script" + +pkgs_line="$(cat $intercept_script|grep "##PKGS:")" +if [ -n "$pkgs_line" ]; then + # line exists, add this package to the list only if it's not already there + if [ -z "$(echo "$pkgs_line" | grep " $package_name ")" ]; then + sed -i -e "s/##PKGS:.*/\0${package_name} /" $intercept_script + fi +else + for var in $@; do + sed -i -e "\%^#\!/bin/.*sh%a $var" $intercept_script + done + echo "##PKGS: ${package_name} " >> $intercept_script +fi +
scripts/postinst-intercepts/update_font_cache new file +7 -0
@@ -0,0 +1,7 @@ +#!/bin/sh + +PSEUDO_UNLOAD=1 qemuwrapper $D$(readelf -l $D${bindir}/fc-cache| grep "Requesting program interpreter"|sed -e 's/^.*\[.*: \(.*\)\]/\1/') \ + --library-path $D/lib:$D/usr/lib $D${bindir}/fc-cache \ + --sysroot=$D >/dev/null 2>&1 + +
scripts/postinst-intercepts/update_icon_cache new file +12 -0
@@ -0,0 +1,12 @@ +#!/bin/sh + +set -e +# update native pixbuf loaders +gdk-pixbuf-query-loaders --update-cache + +for icondir in $D/usr/share/icons/*/ ; do + if [ -d $icondir ] ; then + gtk-update-icon-cache -fqt $icondir + fi +done +
scripts/postinst-intercepts/update_pixbuf_cache new file +10 -0
@@ -0,0 +1,10 @@ +#!/bin/sh + +export GDK_PIXBUF_MODULEDIR=$D${libdir}/gdk-pixbuf-2.0/2.10.0/loaders + +PSEUDO_UNLOAD=1 qemuwrapper $D$(readelf -l $D${bindir}/gdk-pixbuf-query-loaders|grep "Requesting program interpreter"|sed -e 's/^.*\[.*: \(.*\)\]/\1/') \ + --library-path $D/lib:$D/usr/lib $D${bindir}/gdk-pixbuf-query-loaders \ + >$GDK_PIXBUF_MODULEDIR/../loaders.cache 2>/dev/null && \ + sed -i -e "s:$D::g" $GDK_PIXBUF_MODULEDIR/../loaders.cache + +
Signature · 1 line
1.7.9.5
PATCH 2/11 image.bbclass: add fall-back functionality when running intercepts
In reply to Laurentiu PalcuIf an intercept script fails, it would be helpful to fall-back to running the postinstall on target's first boot. In order to achieve that, the postinstalls that install a host intercept hook will have to return 1, so that the postinstall is marked as unpacked only. If the intercept hook fails, then we're ok, the postinstalls will be run on target anyway. If it succeeds, then mark the packages as installed.
This logic was chosen mainly because of rpm backend which saves the failed postinstalls in /etc/rpm-postinsts. Hence, in order to mark the packages as installed, all we have to do is delete the scriptlets from there.
--- meta/classes/image.bbclass | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-)
meta/classes/image.bbclass +37 -6
@@ -194,13 +194,41 @@ run_intercept_scriptlets () { cd ${WORKDIR}/intercept_scripts echo "Running intercept scripts:" for script in *; do - if [ "$script" = "*" ]; then break; fi + [ "$script" = "*" ] && break + [ "$script" = "postinst_intercept" ] || [ ! -x "$script" ] && continue echo "> Executing $script" - chmod +x $script - ./$script - if [ $? -ne 0 ]; then - echo "ERROR: intercept script \"$script\" failed!" - fi + ./$script || (echo "WARNING: intercept script \"$script\" failed, falling back to running postinstalls at first boot" && continue) + # + # If we got here, than the intercept was successful. Next, we must + # mark the postinstalls as "installed". For rpm is a little bit + # different, we just have to delete the saved postinstalls from + # /etc/rpm-postinsts + # + pkgs="$(cat ./$script|grep "^##PKGS"|cut -d':' -f2)" || continue + case ${IMAGE_PKGTYPE} in + "rpm") + for pi in ${IMAGE_ROOTFS}${sysconfdir}/rpm-postinsts/*; do + pkg_name="$(cat $pi|sed -n -e "s/^.*postinst_intercept $script \([^ ]*\).*/\1/p")" + if [ -n "$pkg_name" -a -n "$(echo "$pkgs"|grep " $pkg_name ")" ]; then + rm $pi + fi + done + # move to the next intercept script + continue + ;; + "ipk") + status_file="${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/status" + ;; + "deb") + status_file="${IMAGE_ROOTFS}/var/lib/dpkg/status" + ;; + esac + # the next piece of code is run only for ipk/dpkg + sed_expr="" + for p in $pkgs; do + sed_expr="$sed_expr -e \"/^Package: ${p}$/,/^Status: install.* unpacked$/ {s/unpacked/installed/}\"" + done + eval sed -i $sed_expr $status_file done fi }
@@ -223,6 +251,9 @@ fakeroot do_rootfs () { cp ${COREBASE}/meta/files/deploydir_readme.txt ${DEPLOY_DIR_IMAGE}/README_-_DO_NOT_DELETE_FILES_IN_THIS_DIRECTORY.txt || true + # copy the intercept scripts + cp ${COREBASE}/scripts/postinst-intercepts/* ${WORKDIR}/intercept_scripts/ + # If "${IMAGE_ROOTFS}/dev" exists, then the device had been made by # the previous build if [ "${USE_DEVFS}" != "1" -a ! -r "${IMAGE_ROOTFS}/dev" ]; then
Signature · 1 line
1.7.9.5
PATCH 3/11 rootfs_(ipk|deb|rpm).bbclass: check package installation status after ROOTFS_POSTPROCESS_COMMAND
In reply to Laurentiu PalcuSince the intercept fall-back procedure will change the package installation status, do the checking after ROOTFS_POSTPROCESS_COMMAND ends.
--- meta/classes/rootfs_deb.bbclass | 14 +++++++------- meta/classes/rootfs_ipk.bbclass | 13 ++++++------- meta/classes/rootfs_rpm.bbclass | 20 ++++++++++---------- 3 files changed, 23 insertions(+), 24 deletions(-)
meta/classes/rootfs_deb.bbclass +7 -7
@@ -70,13 +70,6 @@ fakeroot rootfs_deb_do_rootfs () { set -e - if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then - if grep Status:.install.ok.unpacked ${IMAGE_ROOTFS}/var/lib/dpkg/status; then - bberror "Some packages could not be configured offline and rootfs is read-only." - exit 1 - fi - fi - install -d ${IMAGE_ROOTFS}/${sysconfdir} echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version
@@ -91,6 +84,13 @@ fakeroot rootfs_deb_do_rootfs () { ${ROOTFS_POSTPROCESS_COMMAND} + if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then + if grep Status:.install.ok.unpacked ${IMAGE_ROOTFS}/var/lib/dpkg/status; then + bberror "Some packages could not be configured offline and rootfs is read-only." + exit 1 + fi + fi + log_check rootfs }
meta/classes/rootfs_ipk.bbclass +6 -7
@@ -80,7 +80,12 @@ fakeroot rootfs_ipk_do_rootfs () { ${OPKG_POSTPROCESS_COMMANDS} ${ROOTFS_POSTINSTALL_COMMAND} - + + install -d ${IMAGE_ROOTFS}/${sysconfdir} + echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version + + ${ROOTFS_POSTPROCESS_COMMAND} + if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then if grep Status:.install.ok.unpacked ${STATUS}; then bberror "Some packages could not be configured offline and rootfs is read-only."
@@ -88,11 +93,6 @@ fakeroot rootfs_ipk_do_rootfs () { fi fi - install -d ${IMAGE_ROOTFS}/${sysconfdir} - echo ${BUILDNAME} > ${IMAGE_ROOTFS}/${sysconfdir}/version - - ${ROOTFS_POSTPROCESS_COMMAND} - rm -f ${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/lists/* if ${@base_contains("IMAGE_FEATURES", "package-management", "false", "true", d)}; then if ! grep Status:.install.ok.unpacked ${STATUS}; then
@@ -114,7 +114,6 @@ fakeroot rootfs_ipk_do_rootfs () { remove_packaging_data_files fi fi - set +x log_check rootfs }
meta/classes/rootfs_rpm.bbclass +10 -10
@@ -87,15 +87,6 @@ fakeroot rootfs_rpm_do_rootfs () { ${ROOTFS_POSTINSTALL_COMMAND} - if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then - if [ -d ${IMAGE_ROOTFS}/etc/rpm-postinsts ] ; then - if [ "`ls -A ${IMAGE_ROOTFS}/etc/rpm-postinsts`" != "" ] ; then - bberror "Some packages could not be configured offline and rootfs is read-only." - exit 1 - fi - fi - fi - # Report delayed package scriptlets for i in ${IMAGE_ROOTFS}/etc/rpm-postinsts/*; do if [ -f $i ]; then
@@ -126,7 +117,16 @@ EOF ${RPM_POSTPROCESS_COMMANDS} ${ROOTFS_POSTPROCESS_COMMAND} - + + if ${@base_contains("IMAGE_FEATURES", "read-only-rootfs", "true", "false" ,d)}; then + if [ -d ${IMAGE_ROOTFS}/etc/rpm-postinsts ] ; then + if [ "`ls -A ${IMAGE_ROOTFS}/etc/rpm-postinsts`" != "" ] ; then + bberror "Some packages could not be configured offline and rootfs is read-only." + exit 1 + fi + fi + fi + rm -rf ${IMAGE_ROOTFS}/var/cache2/ rm -rf ${IMAGE_ROOTFS}/var/run2/ rm -rf ${IMAGE_ROOTFS}/var/log2/
Signature · 1 line
1.7.9.5
PATCH 4/11 gtk-icon-cache.bbclass: use postinst_intercept script
In reply to Laurentiu PalcuSince the hook has been made a standalone script, use postinst_intercept script in order to "link" the package to the hook.
--- meta/classes/gtk-icon-cache.bbclass | 39 ++++++++--------------------------- 1 file changed, 9 insertions(+), 30 deletions(-)
meta/classes/gtk-icon-cache.bbclass +9 -30
@@ -2,23 +2,15 @@ FILES_${PN} += "${datadir}/icons/hicolor" DEPENDS += "${@['hicolor-icon-theme', '']['${BPN}' == 'hicolor-icon-theme']} gtk+-native" +# +# On host, the postinstall MUST return 1 because we do not know if the intercept +# hook will succeed. If it does succeed, than the packages will be marked as +# installed. +# gtk_icon_cache_postinst() { if [ "x$D" != "x" ]; then - if [ ! -f $INTERCEPT_DIR/update_icon_cache ]; then - cat << "EOF" > $INTERCEPT_DIR/update_icon_cache -#!/bin/sh - -# update native pixbuf loaders -gdk-pixbuf-query-loaders --update-cache - -for icondir in $D/usr/share/icons/*/ ; do - if [ -d $icondir ] ; then - gtk-update-icon-cache -fqt $icondir - fi -done -EOF - fi - exit 0 + $INTERCEPT_DIR/postinst_intercept update_icon_cache ${PKG} + exit 1 fi # Update the pixbuf loaders in case they haven't been registered yet
@@ -33,21 +25,8 @@ done gtk_icon_cache_postrm() { if [ "x$D" != "x" ]; then - if [ ! -f $INTERCEPT_DIR/update_icon_cache ]; then - cat << "EOF" > $INTERCEPT_DIR/update_icon_cache -#!/bin/sh - -# update native pixbuf loaders -gdk-pixbuf-query-loaders --update-cache - -for icondir in $D/usr/share/icons/*/ ; do - if [ -d $icondir ] ; then - gtk-update-icon-cache -fqt $icondir - fi -done -EOF - fi - exit 0 + $INTERCEPT_DIR/postinst_intercept update_icon_cache ${PKG} + exit 1 fi for icondir in /usr/share/icons/* ; do
Signature · 1 line
1.7.9.5
PATCH 5/11 fontcache.bbclass: use the postinst_intercept script
In reply to Laurentiu Palcu"Link" the package to the postinstall hook by running the postinst_intercept script.
--- meta/classes/fontcache.bbclass | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-)
meta/classes/fontcache.bbclass +7 -13
@@ -8,21 +8,15 @@ inherit qemu FONT_PACKAGES ??= "${PN}" +# +# On host, the postinstall MUST return 1 because we do not know if the intercept +# hook will succeed. If it does succeed, than the packages will be marked as +# installed. +# fontcache_common() { if [ "x$D" != "x" ] ; then - if [ ! -f $INTERCEPT_DIR/update_font_cache ]; then - cat << "EOF" > $INTERCEPT_DIR/update_font_cache -#!/bin/sh - -${@qemu_run_binary(d, '$D', '/usr/bin/fc-cache')} --sysroot=$D >/dev/null 2>&1 - -if [ $? -ne 0 ]; then - exit 1 -fi - -EOF - fi - exit 0 + $INTERCEPT_DIR/postinst_intercept update_font_cache ${PKG} bindir=${bindir} + exit 1 fi fc-cache
Signature · 1 line
1.7.9.5
PATCH 6/11 Add pixbufcache class
In reply to Laurentiu PalcuAll packages exporting pixbuf loaders should inherit this class in order to generate the correct postinst/postrm scriptlets.
[YOCTO #3852]
--- meta/classes/pixbufcache.bbclass | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 meta/classes/pixbufcache.bbclass
meta/classes/pixbufcache.bbclass new file +50 -0
@@ -0,0 +1,50 @@ +# +# This class will generate the proper postinst/postrm scriptlets for pixbuf +# packages. +# + +DEPENDS += "qemu-native" +inherit qemu + +PIXBUF_PACKAGES ??= "${PN}" + +# +# On host, the postinstall MUST return 1 because we do not know if the intercept +# hook will succeed. If it does succeed, than the packages will be marked as +# installed. +# +pixbufcache_common() { +if [ "x$D" != "x" ]; then + $INTERCEPT_DIR/postinst_intercept update_pixbuf_cache ${PKG} libdir=${libdir} bindir=${bindir} + exit 1 +fi + +# Update the pixbuf loaders in case they haven't been registered yet +GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders gdk-pixbuf-query-loaders --update-cache + +if [ -x ${bindir}/gtk-update-icon-cache ] && [ -d ${datadir}/icons ]; then + for icondir in /usr/share/icons/*; do + if [ -d ${icondir} ]; then + gtk-update-icon-cache -t -q ${icondir} + fi + done +fi +} + +python populate_packages_append() { + pixbuf_pkgs = d.getVar('PIXBUF_PACKAGES', True).split() + + for pkg in pixbuf_pkgs: + bb.note("adding pixbuf postinst and postrm scripts to %s" % pkg) + postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True) + if not postinst: + postinst = '#!/bin/sh\n' + postinst += d.getVar('pixbufcache_common', True) + d.setVar('pkg_postinst_%s' % pkg, postinst) + + postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True) + if not postrm: + postrm = '#!/bin/sh\n' + postrm += d.getVar('pixbufcache_common', True) + d.setVar('pkg_postrm_%s' % pkg, postrm) +}
Signature · 1 line
1.7.9.5
PATCH 7/11 gdk-pixbuf: use the new pixbufcache class
In reply to Laurentiu Palcu[YOCTO #3582]
--- meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.26.5.bb | 48 ++------------------ 1 file changed, 3 insertions(+), 45 deletions(-)
meta/recipes-gnome/gdk-pixbuf/gdk-pixbuf_2.26.5.bb +3 -45
@@ -20,9 +20,9 @@ SRC_URI = "http://ftp.acc.umu.se/pub/GNOME/sources/gdk-pixbuf/2.26/gdk-pixbuf-${ SRC_URI[md5sum] = "339329e6d619ee3e1cb93979111b04c0" SRC_URI[sha256sum] = "77696fd163bca95a130a1883dbd78d0ae4d782de2fc85a9a38556d13681f5c84" -PR = "r0" +PR = "r1" -inherit autotools pkgconfig gettext +inherit autotools pkgconfig gettext pixbufcache LIBV = "2.10.0"
@@ -56,48 +56,6 @@ FILES_${PN}-dbg += " \ ${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/.debug/* \ " -postinst_pixbufloader () { -if [ "x$D" != "x" ]; then -# Update the target's pixbuf loader's cache. Since the native binary will -# throw an error if the shared objects do not belong to the same ELF class, -# we trick the gdk-pixbuf-query-loaders into scanning the native shared -# objects and then we remove the NATIVE_ROOT prefix from the paths in -# loaders.cache. -gdk-pixbuf-query-loaders $(ls -d -1 $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.so |\ - sed -e "s:$D:$NATIVE_ROOT:g") > \ - $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \ - 2>$D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.err - -# gdk-pixbuf-query-loaders always returns 0, so we need to check if loaders.err -# has anything in it -if [ -s $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.err ]; then - echo "${PN} postinstall scriptlet failed:" - cat $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.err - rm $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.err - # we've got errors, postpone postinstall for first boot - exit 1 -fi - -sed -i -e "s:$NATIVE_ROOT:/:g" $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.cache - -# remove the empty loaders.err -rm $D/${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders.err - -exit 0 -fi - -# Update the pixbuf loaders in case they haven't been registered yet -GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders gdk-pixbuf-query-loaders --update-cache - -if [ -x ${bindir}/gtk-update-icon-cache ] && [ -d ${datadir}/icons ]; then - for icondir in /usr/share/icons/*; do - if [ -d ${icondir} ]; then - gtk-update-icon-cache -t -q ${icondir} - fi - done -fi -} - PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*" PACKAGES_DYNAMIC_class-native = ""
@@ -106,7 +64,7 @@ python populate_packages_prepend () { loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders') - do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s', postinst_pixbufloader) + d.setVar('PIXBUF_PACKAGES', ' '.join(do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))) } do_install_append_class-native() {
Signature · 1 line
1.7.9.5
PATCH 8/11 librsvg: use the new pixbufcache class
In reply to Laurentiu PalcuAlso, fix the GDK_PIXBUF_QUERYLOADERS path.
[YOCTO #3582]
--- meta/recipes-gnome/librsvg/librsvg_2.32.1.bb | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-)
meta/recipes-gnome/librsvg/librsvg_2.32.1.bb +4 -17
@@ -11,9 +11,9 @@ DEPENDS = "gtk+ cairo libxml2" DEPENDS_class-native = "cairo-native pango-native gdk-pixbuf-native" BBCLASSEXTEND = "native" -PR = "r11" +PR = "r12" -inherit autotools pkgconfig gnome gtk-doc +inherit autotools pkgconfig gnome gtk-doc pixbufcache EXTRA_OECONF = "--disable-mozilla-plugin --without-svgz"
@@ -31,7 +31,7 @@ SRC_URI[archive.md5sum] = "4b00d0fee130c936644892c152f42db7" SRC_URI[archive.sha256sum] = "91b98051f352fab8a6257688d6b2fd665b4648ed66144861f2f853ccf876d334" do_configure_prepend () { - export GDK_PIXBUF_QUERYLOADERS="${libdir}/gtk-2.0/version/loaders" + export GDK_PIXBUF_QUERYLOADERS="${libdir}/gdk-pixbuf-2.0/2.10.0/loaders" } PACKAGES =+ "librsvg-gtk librsvg-gtk-dbg librsvg-gtk-dev rsvg"
@@ -53,18 +53,5 @@ FILES_librsvg-gtk-dbg += "${libdir}/gdk-pixbuf-2.0/.debug \ ${libdir}/gtk-2.0/.debug \ ${libdir}/gtk-2.0/*/*/.debug" -pkg_postinst_librsvg-gtk() { -if [ "x$D" != "x" ]; then - exit 1 -fi - -if [ -d ${libdir}/gtk-2.0/2.10.0/loaders ] ; then - export GDK_PIXBUF_MODULEDIR=${libdir}/gtk-2.0/2.10.0/loaders -else - export GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders -fi - -test -x ${bindir}/gdk-pixbuf-query-loaders && gdk-pixbuf-query-loaders > ${sysconfdir}/gtk-2.0/gdk-pixbuf.loaders -test -x ${bindir}/gtk-update-icon-cache && gtk-update-icon-cache -q ${datadir}/icons/hicolor -} +PIXBUF_PACKAGES = "librsvg-gtk" PARALLEL_MAKE = ""
Signature · 1 line
1.7.9.5
PATCH 9/11 gnome-keyring: compile schemas on host
In reply to Laurentiu Palcugsettings.bbclass offers just that.
[YOCTO #3854]
--- meta/recipes-gnome/gnome/gnome-keyring_2.32.1.bb | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
meta/recipes-gnome/gnome/gnome-keyring_2.32.1.bb +2 -10
@@ -11,9 +11,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ SECTION = "x11/gnome" -PR = "r10" +PR = "r11" -inherit autotools gnome gtk-doc pkgconfig +inherit autotools gnome gtk-doc pkgconfig gsettings DEPENDS = "gtk+ libgcrypt libtasn1 libtasn1-native gconf ${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" RDEPENDS_${PN} = "libgnome-keyring glib-2.0-utils"
@@ -30,14 +30,6 @@ do_install_append () { install -m 0644 ${WORKDIR}/org.gnome.keyring.service ${D}${datadir}/dbus-1/services } -pkg_postinst_${PN} () { - if [ "x$D" != "x" ]; then - exit 1 - fi - - test -x ${bindir}/glib-compile-schemas && glib-compile-schemas ${datadir}/glib-2.0/schemas -} - FILES_${PN} += "${datadir}/dbus-1/services ${datadir}/gcr"
Signature · 1 line
1.7.9.5
PATCH 10/11 gtk-immodules-cache: add weak asignment for GTKIMMODULES_PACKAGES
In reply to Laurentiu PalcuThis is needed if the GTKIMMODULES_PACKAGES is changed later, in do_populate_packages for example. This way, we don't have to add another dumb asignment in the recipe inheriting this.
[YOCTO #3853]
--- meta/classes/gtk-immodules-cache.bbclass | 2 ++ 1 file changed, 2 insertions(+)
meta/classes/gtk-immodules-cache.bbclass +2 -0
@@ -6,6 +6,8 @@ DEPENDS =+ "qemu-native" inherit qemu +GTKIMMODULES_PACKAGES ?= "${PN}" + gtk_immodule_cache_postinst() { if [ "x$D" != "x" ]; then for maj_ver in 2 3; do
Signature · 1 line
1.7.9.5
PATCH 11/11 gtk+: use gtk-immodules-cache class
In reply to Laurentiu PalcuIn order to have the proper postinst/postrm scriptlets generated for gtk+ immodules packages, use the already existing class.
[YOCTO #3853]
--- meta/recipes-gnome/gtk+/gtk+.inc | 8 +------- meta/recipes-gnome/gtk+/gtk+3_3.4.4.bb | 12 ++---------- meta/recipes-gnome/gtk+/gtk+_2.24.14.bb | 4 +--- 3 files changed, 4 insertions(+), 20 deletions(-)
meta/recipes-gnome/gtk+/gtk+.inc +1 -7
@@ -18,7 +18,7 @@ PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" PACKAGECONFIG[x11] = "--with-x=yes --with-gdktarget=x11,--with-x=no,${X11DEPENDS}" -inherit autotools gtk-doc pkgconfig update-alternatives +inherit autotools gtk-doc pkgconfig update-alternatives gtk-immodules-cache PACKAGES += "libgail gtk-demo"
@@ -94,9 +94,3 @@ gtk_sysroot_preprocess () { fi } -postinst_prologue() { -if [ "x$D" != "x" ]; then - exit 1 -fi - -}
meta/recipes-gnome/gtk+/gtk+3_3.4.4.bb +2 -10
@@ -21,7 +21,7 @@ SRC_URI = "http://download.gnome.org/sources/gtk+/3.4/gtk+-${PV}.tar.xz \ SRC_URI[md5sum] = "1b2cf29502a6394e8d4b30f7f5bb9131" SRC_URI[sha256sum] = "f154e460075034da4c0ce89c320025dcd459da2a1fdf32d92a09522eaca242c7" -inherit autotools pkgconfig gtk-doc update-alternatives +inherit autotools pkgconfig gtk-doc update-alternatives gtk-immodules-cache S = "${WORKDIR}/gtk+-${PV}"
@@ -90,22 +90,14 @@ ALTERNATIVE_TARGET[gtk-update-icon-cache] = "${bindir}/gtk-update-icon-cache-3.0 python populate_packages_prepend () { import os.path - prologue = d.getVar("postinst_prologue", 1) - gtk_libdir = d.expand('${libdir}/gtk-3.0/${LIBV}') immodules_root = os.path.join(gtk_libdir, 'immodules') printmodules_root = os.path.join(gtk_libdir, 'printbackends'); - do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-3.0 > /etc/gtk-3.0/gtk.immodules') + d.setVar('GTKIMMODULES_PACKAGES', ' '.join(do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk3-immodule-%s', 'GTK input module for %s'))) do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk3-printbackend-%s', 'GTK printbackend module for %s') if (d.getVar('DEBIAN_NAMES', 1)): d.setVar('PKG_${PN}', 'libgtk-3.0') } -postinst_prologue() { -if [ "x$D" != "x" ]; then - exit 1 -fi - -}
meta/recipes-gnome/gtk+/gtk+_2.24.14.bb +1 -3
@@ -49,13 +49,11 @@ do_install_append_class-native () { } python populate_packages_prepend () { - prologue = d.getVar("postinst_prologue", True) - gtk_libdir = d.expand('${libdir}/gtk-2.0/${LIBV}') immodules_root = os.path.join(gtk_libdir, 'immodules') printmodules_root = os.path.join(gtk_libdir, 'printbackends'); - do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s', prologue + 'gtk-query-immodules-2.0 > /etc/gtk-2.0/gtk.immodules') + d.setVar('GTKIMMODULES_PACKAGES', ' '.join(do_split_packages(d, immodules_root, '^im-(.*)\.so$', 'gtk-immodule-%s', 'GTK input module for %s'))) do_split_packages(d, printmodules_root, '^libprintbackend-(.*)\.so$', 'gtk-printbackend-%s', 'GTK printbackend module for %s') if (d.getVar('DEBIAN_NAMES', True)):
Signature · 1 line
1.7.9.5