| 1 | # Copyright 1999-2004 Gentoo Foundation |
1 | # Copyright 1999-2004 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.3 2004/08/16 16:42:40 pythonhead Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.4 2004/11/13 02:50:53 pythonhead Exp $ |
| 4 | # |
4 | # |
| 5 | # Author Rob Cakebread <pythonhead@gentoo.org> |
5 | # Author Rob Cakebread <pythonhead@gentoo.org> |
| 6 | |
6 | |
| 7 | # This eclass helps you find the correct wx-config script so ebuilds |
7 | # This eclass helps you find the correct wx-config script so ebuilds |
| 8 | # can use gtk, gtk2 or gtk2+unicode versions of wxGTK |
8 | # can use gtk, gtk2 or gtk2+unicode versions of wxGTK |
| 9 | |
9 | |
| 10 | #FUNCTIONS: |
10 | # FUNCTIONS: |
| 11 | # need-wxwidgets: |
11 | # need-wxwidgets: |
| 12 | # Arguments: gtk, gtk2 or unicode |
12 | # Arguments: gtk, gtk2 or unicode |
| 13 | # |
13 | # |
|
|
14 | # |
| 14 | # set-wxconfig |
15 | # set-wxconfig |
| 15 | # Arguments wxgtk, wxgtk2, or wxgtk2u |
16 | # Arguments: (wxGTK 2.4) wxgtk, wxgtk2, or wxgtk2u |
|
|
17 | # Arguments: (wxGTK 2.5 and 2.6) gtk, gtk2, or unicode |
|
|
18 | # Note: Don't call this function directly from ebuilds |
| 16 | |
19 | |
| 17 | ECLASS=wxwidgets |
20 | ECLASS=wxwidgets |
| 18 | INHERITED="$INHERITED $ECLASS" |
21 | INHERITED="$INHERITED $ECLASS" |
| 19 | |
22 | |
| 20 | need-wxwidgets() { |
23 | need-wxwidgets() { |
|
|
24 | debug-print-function $FUNCNAME $* |
|
|
25 | #If you want to use wxGTK-2.5* export WX_GTK_VER in your ebuild: |
|
|
26 | if [ "${WX_GTK_VER}" = "2.5" ]; then |
|
|
27 | case $1 in |
|
|
28 | gtk) set-wxconfig gtk-ansi;; |
|
|
29 | gtk2) set-wxconfig gtk2-ansi;; |
|
|
30 | unicode) set-wxconfig gtk2-unicode;; |
|
|
31 | *) echo "!!! $FUNCNAME: Error: unrecognized wxconfig version $1 requested" |
|
|
32 | exit 1;; |
|
|
33 | esac |
| 21 | |
34 | |
| 22 | debug-print-function $FUNCNAME $* |
35 | else |
| 23 | |
36 | WX_GTK_VER="2.4" |
| 24 | case $1 in |
37 | case $1 in |
| 25 | gtk) set-wxconfig wxgtk;; |
38 | gtk) set-wxconfig wxgtk;; |
| 26 | gtk2) set-wxconfig wxgtk2;; |
39 | gtk2) set-wxconfig wxgtk2;; |
| 27 | unicode) set-wxconfig wxgtk2u;; |
40 | unicode) set-wxconfig wxgtk2u;; |
| 28 | *) echo "!!! $FUNCNAME: Error: unrecognized wxconfig version $1 requested" |
41 | *) echo "!!! $FUNCNAME: Error: unrecognized wxconfig version $1 requested" |
| 29 | exit 1;; |
42 | exit 1;; |
| 30 | esac |
43 | esac |
| 31 | |
44 | fi |
| 32 | } |
45 | } |
| 33 | |
46 | |
| 34 | |
47 | |
| 35 | set-wxconfig() { |
48 | set-wxconfig() { |
| 36 | |
49 | |
| 37 | debug-print-function $FUNCNAME $* |
50 | debug-print-function $FUNCNAME $* |
| 38 | |
51 | |
| 39 | local wxgtk_ver=`/usr/bin/wx-config --release` |
52 | if [ "${WX_GTK_VER}" = "2.5" ] ; then |
| 40 | local wxconfig="/usr/bin/${1}-${wxgtk_ver}-config" |
53 | wxconfig_prefix="/usr/lib/wx/config" |
| 41 | local wxconfig_debug="/usr/bin/${1}d-${wxgtk_ver}-config" |
54 | wxconfig_name="${1}-release-${WX_GTK_VER}" |
|
|
55 | wxconfig="${wxconfig_prefix}/${wxconfig_name}" |
|
|
56 | wxconfig_debug_name="${1}d-release-${WX_GTK_VER}" |
|
|
57 | wxconfig_debug="${wxconfig_prefix}/${wxconfig_debug_name}" |
|
|
58 | else |
|
|
59 | # Default is 2.4: |
|
|
60 | wxconfig_prefix="/usr/bin" |
|
|
61 | wxconfig_name="${1}-${WX_GTK_VER}-config" |
|
|
62 | wxconfig="${wxconfig_prefix}/${wxconfig_name}" |
|
|
63 | wxconfig_debug_name="${1}d-${WX_GTK_VER}-config" |
|
|
64 | wxconfig_debug="${wxconfig_prefix}/${wxconfig_debug_name}" |
|
|
65 | fi |
| 42 | |
66 | |
| 43 | if [ -e ${wxconfig} ] ; then |
67 | if [ -e ${wxconfig} ] ; then |
| 44 | export WX_CONFIG=${wxconfig} |
68 | export WX_CONFIG=${wxconfig} |
| 45 | export WX_CONFIG_NAME="${1}-${wxgtk_ver}-config" |
69 | export WX_CONFIG_NAME=${wxconfig_name} |
| 46 | export WXBASE_CONFIG_NAME="${1}-${wxgtk_ver}-config" |
70 | export WXBASE_CONFIG_NAME=${wxconfig_name} |
| 47 | echo ${WX_CONFIG_NAME} |
|
|
| 48 | echo " * Using ${wxconfig}" |
71 | echo " * Using ${wxconfig}" |
| 49 | elif [ -e ${wxconfig_debug} ] ; then |
72 | elif [ -e ${wxconfig_debug} ] ; then |
| 50 | export WX_CONFIG=${wxconfig_debug} |
73 | export WX_CONFIG=${wxconfig_debug} |
| 51 | export WX_CONFIG_NAME="${1}d-${wxgtk_ver}-config" |
74 | export WX_CONFIG_NAME=${wxconfig_debug_name} |
| 52 | export WXBASE_CONFIG_NAME="${1}d-${wxgtk_ver}-config" |
75 | export WXBASE_CONFIG_NAME=${wxconfig_debug_name} |
| 53 | echo " * Using ${wxconfig_debug}" |
76 | echo " * Using ${wxconfig_debug}" |
| 54 | else |
77 | else |
| 55 | echo "!!! $FUNCNAME: Error: Can't find normal or debug version:" |
78 | echo "!!! $FUNCNAME: Error: Can't find normal or debug version:" |
| 56 | echo "!!! $FUNCNAME: ${wxconfig} not found" |
79 | echo "!!! $FUNCNAME: ${wxconfig} not found" |
| 57 | echo "!!! $FUNCNAME: ${wxconfig_debug} not found" |
80 | echo "!!! $FUNCNAME: ${wxconfig_debug} not found" |
| 58 | case $1 in |
81 | case $1 in |
| 59 | wxgtk) echo "!!! You need to emerge wxGTK with -no_wxgtk1 in your USE";; |
82 | wxgtk) echo "!!! You need to emerge wxGTK with -no_wxgtk1 in your USE";; |
| 60 | wxgtkd) echo "!!! You need to emerge wxGTK with -no_wxgtk1 in your USE";; |
83 | wxgtkd) echo "!!! You need to emerge wxGTK with -no_wxgtk1 in your USE";; |
|
|
84 | gtk-ansi) echo "!!! You need to emerge wxGTK with -no_wxgtk1 in your USE";; |
|
|
85 | gtkd-ansi) echo "!!! You need to emerge wxGTK with -no_wxgtk1 in your USE";; |
|
|
86 | |
| 61 | wxgtk2) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |
87 | wxgtk2) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |
| 62 | wxgtk2d) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |
88 | wxgtk2d) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |
|
|
89 | gtk2-ansi) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |
|
|
90 | gtk2d-ansi) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |
|
|
91 | |
| 63 | wxgtk2u) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
92 | wxgtk2u) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
| 64 | wxgtk2ud) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
93 | wxgtk2ud) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
|
|
94 | gtk2-unicode) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
|
|
95 | gtk2d-unicode) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
| 65 | esac |
96 | esac |
| 66 | exit 1 |
97 | exit 1 |
| 67 | fi |
98 | fi |
| 68 | } |
99 | } |
| 69 | |
100 | |
| 70 | |
|
|