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

Contents of /eclass/wxwidgets.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sat Nov 13 02:50:53 2004 UTC (9 years, 8 months ago) by pythonhead
Branch: MAIN
Changes since 1.3: +52 -22 lines
Updated to work with wxGTK 2.5.3

1 # Copyright 1999-2004 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.3 2004/08/16 16:42:40 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: gtk, gtk2 or unicode
13 #
14 #
15 # set-wxconfig
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
19
20 ECLASS=wxwidgets
21 INHERITED="$INHERITED $ECLASS"
22
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
34
35 else
36 WX_GTK_VER="2.4"
37 case $1 in
38 gtk) set-wxconfig wxgtk;;
39 gtk2) set-wxconfig wxgtk2;;
40 unicode) set-wxconfig wxgtk2u;;
41 *) echo "!!! $FUNCNAME: Error: unrecognized wxconfig version $1 requested"
42 exit 1;;
43 esac
44 fi
45 }
46
47
48 set-wxconfig() {
49
50 debug-print-function $FUNCNAME $*
51
52 if [ "${WX_GTK_VER}" = "2.5" ] ; then
53 wxconfig_prefix="/usr/lib/wx/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
66
67 if [ -e ${wxconfig} ] ; then
68 export WX_CONFIG=${wxconfig}
69 export WX_CONFIG_NAME=${wxconfig_name}
70 export WXBASE_CONFIG_NAME=${wxconfig_name}
71 echo " * Using ${wxconfig}"
72 elif [ -e ${wxconfig_debug} ] ; then
73 export WX_CONFIG=${wxconfig_debug}
74 export WX_CONFIG_NAME=${wxconfig_debug_name}
75 export WXBASE_CONFIG_NAME=${wxconfig_debug_name}
76 echo " * Using ${wxconfig_debug}"
77 else
78 echo "!!! $FUNCNAME: Error: Can't find normal or debug version:"
79 echo "!!! $FUNCNAME: ${wxconfig} not found"
80 echo "!!! $FUNCNAME: ${wxconfig_debug} not found"
81 case $1 in
82 wxgtk) 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
87 wxgtk2) 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
92 wxgtk2u) 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";;
96 esac
97 exit 1
98 fi
99 }

  ViewVC Help
Powered by ViewVC 1.1.20