check whether gtk+ gir.repository is installed

configure: add support for checking gir repositories
parent 72db25a9
......@@ -80,6 +80,46 @@ done
}
check_gir () {
for SECTION in GIR OPT_GIR; do
CHKS_COUNTER=$(grep -w ${SECTION}[0-9]* .configure/depends | wc -l)
DONE_COUNTER=1
if [[ $CHKS_COUNTER != "0" ]]; then
section_message $SECTION
while (( $DONE_COUNTER <= $CHKS_COUNTER )); do
DEPENDENCY=$(grep -w ${SECTION}${DONE_COUNTER} .configure/depends | gawk '{print $2}')
VERSION=$(grep -w ${SECTION}${DONE_COUNTER} .configure/depends | gawk '{print $3}')
TYPE_LIB=$(grep -w ${SECTION}${DONE_COUNTER} .configure/depends | gawk '{print $4}')
FILE=$(basename $(ls /usr/lib/girepository-1.0/$TYPE_LIB-* 2>/dev/null) .typelib 2>/dev/null)
if [[ $FILE != ".typelib" ]]; then
EXIST_RETURN=0
XVER=$(echo $FILE | gawk -F \- '{print $2}')
DEP_RETURN=$(echo "$XVER >= $VERSION" | bc)
fi
if [[ $EXIST_RETURN != 0 && ! $SECTION == OPT* ]]; then
fail_message m $DEPENDENCY
exit 1
elif [[ $DEP_RETURN == 1 ]]; then
ok_message $DEPENDENCY ${VERSION}+
elif [[ $EXIST_RETURN != 0 && $SECTION == OPT* ]]; then
warn_message $DEPENDENCY
ERR_MSG+=$(grep -w ${SECTION}${DONE_COUNTER} .configure/depends | gawk -F':' '{print $2}')
MISSING+=" $(grep -w ${SECTION}${DONE_COUNTER} .configure/depends | gawk '{print $2}' )"
else fail_message o $DEPENDENCY $VERSION
exit 1
fi
DONE_COUNTER=$(($DONE_COUNTER+1)); done
fi
unset CHKS_COUNTER DONE_COUNTER
done
}
check_pymods () {
for SECTION in PYMOD OPT_PYMOD; do
......@@ -107,4 +147,5 @@ imp.find_module('$DEPENDENCY')"
fi
unset CHKS_COUNTER DONE_COUNTER
done
}
......@@ -17,6 +17,8 @@ OPT_APP7 tree :* The optional tree couldn't be found. `treecd' won't work\n
OPT_SBINAPP1 dmidecode :* The optional dmidecode couldn't be found. `systeminfos --bios' won't work\n
GIR1 Gtk+3 3.0 Gtk
PYMOD1 ctypes
PYMOD2 gettext
PYMOD3 gtk
......
......@@ -36,6 +36,14 @@ section_message () {
OPT_LIB )
echo -e "\n${MAGENTA}Optional ${WHITE}Libraries:\n"
;;
GIR )
echo -e "\n${RED}Required ${WHITE}GIR Repositories:\n"
;;
OPT_GIR)
echo -e "\n${MAGENTA}Optional ${WHITE}GIR Repositories:\n"
;;
esac
fi
tput sgr0
......
......@@ -32,6 +32,9 @@ This release requires GTK+3
* #132 (show_system_load): enforce LANG=C when calling uptime, so that it
properly works in all environments
=== Added Features ===
* configure can now check for GIR Repositories
=== Removed Features ===
* bs-ng-profiler (no longer required)
* rcgenerator (no longer required)
......
......@@ -71,6 +71,7 @@ elif [[ $MODE == USER ]]; then
start_message
check_apps
check_libs
check_gir
check_pymods
copy_in_files
substitute_values
......
......@@ -23,9 +23,8 @@ for module in MODULES:
try:
from gi.repository import Gtk
from gi.repository import GdkPixbuf
except ImportError:
FAILED.append("Gtk/Gdk (from gi.repository)")
FAILED.append("Gtk (from gi.repository)")
if FAILED:
print "The following modules failed to import: %s" % (" ".join(FAILED))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment