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

Contents of /eclass/wxwidgets.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (hide annotations) (download)
Mon Jul 30 01:34:13 2007 UTC (7 years, 6 months ago) by dirtyepic
Branch: MAIN
Changes since 1.18: +29 -5 lines
Add check_wxuse, a small utility fuction to make checking wxGTK USE flags consistent.

1 dirtyepic 1.19 # Copyright 1999-2007 Gentoo Foundation
2 pythonhead 1.1 # Distributed under the terms of the GNU General Public License v2
3 dirtyepic 1.19 # $Header: $
4 pythonhead 1.1 #
5 dirtyepic 1.19 # Original Author: Rob Cakebread <pythonhead@gentoo.org>
6     # Current Maintainers: wxWidgets team <wxwidgets@gentoo.org>
7 pythonhead 1.1
8     # This eclass helps you find the correct wx-config script so ebuilds
9 swegener 1.13 # can use gtk, gtk2 or gtk2+unicode versions of wxGTK
10 pythonhead 1.1
11 pythonhead 1.4 # FUNCTIONS:
12 pythonhead 1.1 # need-wxwidgets:
13 pythonhead 1.6 # Arguments:
14 dirtyepic 1.18 # 2.4: gtk gtk2 unicode !!! 2.4 is being removed from the tree !!!
15     # 2.6: gtk2 unicode base base-unicode mac mac-unicode
16 pythonhead 1.1 #
17     # set-wxconfig
18 pythonhead 1.4 # Arguments: (wxGTK 2.4) wxgtk, wxgtk2, or wxgtk2u
19 pythonhead 1.9 # Arguments: (wxGTK 2.6) gtk-ansi gtk2-ansi unicode base-ansi base-unicode mac-ansi mac-unicode
20 pythonhead 1.4 # Note: Don't call this function directly from ebuilds
21 dirtyepic 1.19 #
22     # check_wxuse
23     # Check if wxGTK was built with the specified USE flag.
24     # Usage: check_wxuse <USE flag>
25     # Note: for now, requires WX_GTK_VER to be set.
26 pythonhead 1.1
27 flameeyes 1.15 inherit multilib flag-o-matic
28 pythonhead 1.1
29     need-wxwidgets() {
30     debug-print-function $FUNCNAME $*
31 pythonhead 1.6 #If you want to use wxGTK-2.6* export WX_GTK_VER in your ebuild:
32     if [ "${WX_GTK_VER}" = "2.6" ]; then
33 pythonhead 1.4 case $1 in
34     gtk) set-wxconfig gtk-ansi;;
35     gtk2) set-wxconfig gtk2-ansi;;
36 pythonhead 1.8 unicode) set-wxconfig gtk2-unicode;;
37 pythonhead 1.6 base) set-wxconfig base-ansi;;
38     base-unicode) set-wxconfig base-unicode;;
39     mac) set-wxconfig mac-ansi;;
40     mac-unicode) set-wxconfig mac-unicode;;
41     *) echo "!!! $FUNCNAME: Error: wxGTK was not comipled with $1."
42     echo "!!! Adjust your USE flags or re-emerge wxGTK with version you want."
43 pythonhead 1.4 exit 1;;
44     esac
45 pythonhead 1.1
46 pythonhead 1.4 else
47     WX_GTK_VER="2.4"
48     case $1 in
49     gtk) set-wxconfig wxgtk;;
50     gtk2) set-wxconfig wxgtk2;;
51     unicode) set-wxconfig wxgtk2u;;
52 sekretarz 1.14 *) echo "!!! $FUNCNAME: Error: wxGTK was not compiled with $1."
53     echo "!!! Adjust your USE flags or re-emerge wxGTK with the version you want."
54 pythonhead 1.4 exit 1;;
55     esac
56     fi
57 pythonhead 1.1 }
58    
59     set-wxconfig() {
60    
61     debug-print-function $FUNCNAME $*
62    
63 pythonhead 1.6 if [ "${WX_GTK_VER}" = "2.6" ] ; then
64 herbs 1.10 wxconfig_prefix="/usr/$(get_libdir)/wx/config"
65 pythonhead 1.4 wxconfig_name="${1}-release-${WX_GTK_VER}"
66     wxconfig="${wxconfig_prefix}/${wxconfig_name}"
67 pythonhead 1.5 wxconfig_debug_name="${1}-debug-${WX_GTK_VER}"
68 pythonhead 1.4 wxconfig_debug="${wxconfig_prefix}/${wxconfig_debug_name}"
69     else
70     # Default is 2.4:
71     wxconfig_prefix="/usr/bin"
72     wxconfig_name="${1}-${WX_GTK_VER}-config"
73     wxconfig="${wxconfig_prefix}/${wxconfig_name}"
74     wxconfig_debug_name="${1}d-${WX_GTK_VER}-config"
75     wxconfig_debug="${wxconfig_prefix}/${wxconfig_debug_name}"
76     fi
77 pythonhead 1.1
78     if [ -e ${wxconfig} ] ; then
79     export WX_CONFIG=${wxconfig}
80 pythonhead 1.4 export WX_CONFIG_NAME=${wxconfig_name}
81     export WXBASE_CONFIG_NAME=${wxconfig_name}
82 pythonhead 1.1 echo " * Using ${wxconfig}"
83     elif [ -e ${wxconfig_debug} ] ; then
84     export WX_CONFIG=${wxconfig_debug}
85 pythonhead 1.4 export WX_CONFIG_NAME=${wxconfig_debug_name}
86     export WXBASE_CONFIG_NAME=${wxconfig_debug_name}
87 pythonhead 1.1 echo " * Using ${wxconfig_debug}"
88     else
89     echo "!!! $FUNCNAME: Error: Can't find normal or debug version:"
90 pythonhead 1.2 echo "!!! $FUNCNAME: ${wxconfig} not found"
91     echo "!!! $FUNCNAME: ${wxconfig_debug} not found"
92     case $1 in
93 pythonhead 1.6 wxgtk) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";;
94     wxgtkd) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";;
95 dirtyepic 1.18 gtk-ansi) echo "!!! GTK-1 support is not available in wxGTK-2.6."
96     echo "!!! Please search bugzilla for this package and file a new bug if one is not already present.";;
97     gtkd-ansi) echo "!!! GTK-1 support is not available in wxGTK-2.6.";;
98    
99     wxgtk2) echo "!!! You need to emerge wxGTK with gtk in your USE";;
100     wxgtk2d) echo "!!! You need to emerge wxGTK with gtk in your USE";;
101     gtk2-ansi) echo "!!! You need to emerge wxGTK with gtk in your USE";;
102     gtk2d-ansi) echo "!!! You need to emerge wxGTK with gtk in your USE";;
103 pythonhead 1.4
104     wxgtk2u) echo "!!! You need to emerge wxGTK with unicode in your USE";;
105 pythonhead 1.2 wxgtk2ud) echo "!!! You need to emerge wxGTK with unicode in your USE";;
106 pythonhead 1.4 gtk2-unicode) echo "!!! You need to emerge wxGTK with unicode in your USE";;
107     gtk2d-unicode) echo "!!! You need to emerge wxGTK with unicode in your USE";;
108 pythonhead 1.2 esac
109 pythonhead 1.1 exit 1
110     fi
111     }
112    
113 dirtyepic 1.19 check_wxuse() {
114     if [[ -z ${WX_GTK_VER} ]]; then
115     echo
116     eerror "You need to set WX_GTK_VER before calling ${FUNCNAME}."
117     die "Missing WX_GTK_VER."
118     fi
119    
120     ebegin "Checking wxGTK-${WX_GTK_VER} for ${1} support"
121     if $(built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* ${1}); then
122     eend 0
123     else
124     eend 1
125     echo
126     eerror "${FUNCNAME} - You have requested functionality that requires ${1} support to"
127     eerror "have been built into x11-libs/wxGTK."
128     eerror
129     eerror "Please re-merge =x11-libs/wxGTK-${WX_GTK_VER}* with the ${1} USE flag enabled."
130     die "Missing USE flags."
131     fi
132     }

  ViewVC Help
Powered by ViewVC 1.1.20