2 RDEPENDS += "gdk-pixbuf-loader-png"
4 #only icons present in the package
9 ALTERNATIVE_NAME = "gpe-pixmaps"
10 ALTERNATIVE_LINK = "${datadir}/gpe/pixmaps"
11 ALTERNATIVE_PATH = "${datadir}/gpe/pixmaps.${PN}"
12 ALTERNATIVE_PRIORITY ?= 1
14 # copy icons from other alternatives if they are not provided by current alternative
15 # ie gpe-sketchbook install own icon to pixmaps dir even before gpe-icons_*.bb is installed
16 # so if we switch pixmaps link to neo theme, there would be no icon for gpe-sketchbook
17 # unless we copy it to neo theme in postinst too
18 # inherit update-alternatives is not used, because not all distributions want to use it
19 # and conditional inherit is a bit difficult to use (inherit ${GPE_INHERIT} works, but only if we always want at least 1 bbclass)
22 if [[ -e ${ALTERNATIVE_LINK} && ! -h ${ALTERNATIVE_LINK} ]] ; then
23 echo "warn: ${ALTERNATIVE_LINK} exists and it's not a link!"
24 echo "warn: It will be replaced with link managed by update-alternatives"
25 echo "warn: Moving ${ALTERNATIVE_LINK} to ${ALTERNATIVE_LINK}.old."
26 echo "warn: It should be empty but probably isn't!"
27 echo "warn: Check what's left there and remove it manually."
28 mv -f ${ALTERNATIVE_LINK} ${ALTERNATIVE_LINK}.old
30 pixmap_dirs_root="${datadir}/gpe/"
31 cd ${pixmap_dirs_root}
32 for pixmap_dir in pixmaps.*; do
33 if [ "${pixmap_dir}"x == "pixmaps.${PN}"x ] ; then
36 for pixmap in `find ${pixmap_dir}`; do
37 pixmap_target=`echo ${pixmap} | sed "s/${pixmap_dir}/pixmaps.${PN}/g"`;
38 if [ ! -e ${pixmap_target} ] ; then
39 cp -ra ${pixmap} ${pixmap_target};
40 echo "${pixmap} merged";
44 update-alternatives --install ${ALTERNATIVE_LINK} ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH} ${ALTERNATIVE_PRIORITY}
48 update-alternatives --remove ${ALTERNATIVE_NAME} ${ALTERNATIVE_PATH}