/[gentoo-x86]/eclass/wxwidgets.eclass
Gentoo

Contents of /eclass/wxwidgets.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Wed May 25 15:19:16 2005 UTC (9 years, 6 months ago) by herbs
Branch: MAIN
Changes since 1.9: +3 -2 lines
multilib fix

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

  ViewVC Help
Powered by ViewVC 1.1.20