summaryrefslogtreecommitdiff
blob: 8a30541d43d71edaaf52086fc292f22853ee24c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash -
#
# /usr/bin/wxrc
#	a lame wrapper by dirtyepic@gentoo.org

_wxerror() {
    echo "An error occurred while calling wxrc:"
    echo
    echo "    ${1}"
    echo
    echo "Please use \`eselect wxwidgets\` to select an available profile and try again."
    exit 1
}

# Ebuilds should not use this wrapper and use wxwidgets.eclass instead.
if [[ -n ${EBUILD_PHASE} ]]; then
	cat <<- EOF
"


***     This ebuild is attempting to use /usr/bin/wxrc directly.
***     Please see wxwidgets.eclass for instructions how to add wxWidgets support
***     to your package.


"
	EOF
	exit 1
fi

if [[ -n ${WX_ECLASS_CONFIG} ]]; then
    ${WX_ECLASS_CONFIG} "$@"
    exit 0
else
    if [[ -e /var/lib/wxwidgets/current ]]; then
        source /var/lib/wxwidgets/current
    else
        _wxerror "Cannot find wxWidgets profile configuration file ( /var/lib/wxwidgets/current )"
    fi

    [[ ${WXCONFIG} == none ]] && _wxerror "No profile currently selected"

    if [[ -f /usr/lib/wx/config/${WXCONFIG} \
       && -x /usr/lib/wx/config/${WXCONFIG} ]]; then
       $(/usr/lib/wx/config/${WXCONFIG} --utility=wxrc) "$@"
    else
        _wxerror "Cannot find wxWidgets profile ( ${WXCONFIG} )"
	fi
	exit 0
fi