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