| 1 | # Copyright 1999-2005 Gentoo Foundation |
1 | # Copyright 1999-2007 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.9 2005/05/11 23:45:18 pythonhead Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.19 2007/07/30 01:34:13 dirtyepic Exp $ |
| 4 | # |
4 | # |
| 5 | # Author Rob Cakebread <pythonhead@gentoo.org> |
5 | # Original Author: Rob Cakebread <pythonhead@gentoo.org> |
|
|
6 | # Current Maintainers: wxWidgets team <wxwidgets@gentoo.org> |
| 6 | |
7 | |
| 7 | # This eclass helps you find the correct wx-config script so ebuilds |
8 | # This eclass helps you find the correct wx-config script so ebuilds |
| 8 | # can use gtk, gtk2 or gtk2+unicode versions of wxGTK |
9 | # can use gtk, gtk2 or gtk2+unicode versions of wxGTK |
| 9 | |
10 | |
| 10 | # FUNCTIONS: |
11 | # FUNCTIONS: |
| 11 | # need-wxwidgets: |
12 | # need-wxwidgets: |
| 12 | # Arguments: |
13 | # Arguments: |
| 13 | # 2.4: gtk gtk2 unicode |
14 | # 2.4: gtk gtk2 unicode !!! 2.4 is being removed from the tree !!! |
| 14 | # 2.6: gtk gtk2 unicode base base-unicode mac mac-unicode |
15 | # 2.6: gtk2 unicode base base-unicode mac mac-unicode |
| 15 | # |
|
|
| 16 | # |
16 | # |
| 17 | # set-wxconfig |
17 | # set-wxconfig |
| 18 | # Arguments: (wxGTK 2.4) wxgtk, wxgtk2, or wxgtk2u |
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 |
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 |
20 | # Note: Don't call this function directly from ebuilds |
|
|
21 | # |
|
|
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. |
| 21 | |
26 | |
| 22 | ECLASS=wxwidgets |
27 | inherit multilib flag-o-matic |
| 23 | INHERITED="$INHERITED $ECLASS" |
|
|
| 24 | |
28 | |
| 25 | need-wxwidgets() { |
29 | need-wxwidgets() { |
| 26 | debug-print-function $FUNCNAME $* |
30 | debug-print-function $FUNCNAME $* |
| 27 | #If you want to use wxGTK-2.6* export WX_GTK_VER in your ebuild: |
31 | #If you want to use wxGTK-2.6* export WX_GTK_VER in your ebuild: |
| 28 | if [ "${WX_GTK_VER}" = "2.6" ]; then |
32 | if [ "${WX_GTK_VER}" = "2.6" ]; then |
| … | |
… | |
| 43 | WX_GTK_VER="2.4" |
47 | WX_GTK_VER="2.4" |
| 44 | case $1 in |
48 | case $1 in |
| 45 | gtk) set-wxconfig wxgtk;; |
49 | gtk) set-wxconfig wxgtk;; |
| 46 | gtk2) set-wxconfig wxgtk2;; |
50 | gtk2) set-wxconfig wxgtk2;; |
| 47 | unicode) set-wxconfig wxgtk2u;; |
51 | unicode) set-wxconfig wxgtk2u;; |
| 48 | *) echo "!!! $FUNCNAME: Error: wxGTK was not comipled with $1." |
52 | *) echo "!!! $FUNCNAME: Error: wxGTK was not compiled with $1." |
| 49 | echo "!!! Adjust your USE flags or re-emerge wxGTK with version you want." |
53 | echo "!!! Adjust your USE flags or re-emerge wxGTK with the version you want." |
| 50 | exit 1;; |
54 | exit 1;; |
| 51 | esac |
55 | esac |
| 52 | fi |
56 | fi |
| 53 | } |
57 | } |
| 54 | |
|
|
| 55 | |
58 | |
| 56 | set-wxconfig() { |
59 | set-wxconfig() { |
| 57 | |
60 | |
| 58 | debug-print-function $FUNCNAME $* |
61 | debug-print-function $FUNCNAME $* |
| 59 | |
62 | |
| 60 | if [ "${WX_GTK_VER}" = "2.6" ] ; then |
63 | if [ "${WX_GTK_VER}" = "2.6" ] ; then |
| 61 | wxconfig_prefix="/usr/lib/wx/config" |
64 | wxconfig_prefix="/usr/$(get_libdir)/wx/config" |
| 62 | wxconfig_name="${1}-release-${WX_GTK_VER}" |
65 | wxconfig_name="${1}-release-${WX_GTK_VER}" |
| 63 | wxconfig="${wxconfig_prefix}/${wxconfig_name}" |
66 | wxconfig="${wxconfig_prefix}/${wxconfig_name}" |
| 64 | wxconfig_debug_name="${1}-debug-${WX_GTK_VER}" |
67 | wxconfig_debug_name="${1}-debug-${WX_GTK_VER}" |
| 65 | wxconfig_debug="${wxconfig_prefix}/${wxconfig_debug_name}" |
68 | wxconfig_debug="${wxconfig_prefix}/${wxconfig_debug_name}" |
| 66 | else |
69 | else |
| … | |
… | |
| 87 | echo "!!! $FUNCNAME: ${wxconfig} not found" |
90 | echo "!!! $FUNCNAME: ${wxconfig} not found" |
| 88 | echo "!!! $FUNCNAME: ${wxconfig_debug} not found" |
91 | echo "!!! $FUNCNAME: ${wxconfig_debug} not found" |
| 89 | case $1 in |
92 | case $1 in |
| 90 | wxgtk) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";; |
93 | wxgtk) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";; |
| 91 | wxgtkd) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";; |
94 | wxgtkd) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";; |
| 92 | gtk-ansi) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";; |
95 | gtk-ansi) echo "!!! GTK-1 support is not available in wxGTK-2.6." |
| 93 | gtkd-ansi) echo "!!! You need to emerge wxGTK with wxgtk1 in your USE";; |
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.";; |
| 94 | |
98 | |
| 95 | wxgtk2) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |
99 | wxgtk2) echo "!!! You need to emerge wxGTK with gtk in your USE";; |
| 96 | wxgtk2d) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |
100 | wxgtk2d) echo "!!! You need to emerge wxGTK with gtk in your USE";; |
| 97 | gtk2-ansi) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |
101 | gtk2-ansi) echo "!!! You need to emerge wxGTK with gtk in your USE";; |
| 98 | gtk2d-ansi) echo "!!! You need to emerge wxGTK with gtk2 in your USE";; |
102 | gtk2d-ansi) echo "!!! You need to emerge wxGTK with gtk in your USE";; |
| 99 | |
103 | |
| 100 | wxgtk2u) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
104 | wxgtk2u) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
| 101 | wxgtk2ud) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
105 | wxgtk2ud) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
| 102 | gtk2-unicode) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
106 | gtk2-unicode) echo "!!! You need to emerge wxGTK with unicode in your USE";; |
| 103 | gtk2d-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";; |
| 104 | esac |
108 | esac |
| 105 | exit 1 |
109 | exit 1 |
| 106 | fi |
110 | fi |
| 107 | } |
111 | } |
| 108 | |
112 | |
|
|
113 | 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 | } |